org.ws4d.java.configuration
Class DispatchingProperties

java.lang.Object
  extended by org.ws4d.java.configuration.DispatchingProperties
All Implemented Interfaces:
PropertiesHandler

public class DispatchingProperties
extends java.lang.Object
implements PropertiesHandler

Class holds dispatching properties.


Field Summary
static java.lang.String PROP_APPLICATION_MAX_DELAY
          Amount of time in millis dispatcher will wait to send probe matches and hello messages.
static java.lang.String PROP_DEVICE_REFERENCE_AUTO_BUILD
          Property to build up a device reference for each recognized remote device.
static java.lang.String PROP_MATCH_WAIT_TIME
          Time to wait until a time exception is thrown, after a request was sent and no answer was received.
static java.lang.String PROP_MESSAGE_ID_BUFFER_SIZE
          Size of message id buffer.
static java.lang.String PROP_REFERENCE_CACHING_TIME
          Caching time in milliseconds for references without reference holder.
static java.lang.String PROP_RESPONSE_WAIT_TIME
          Time to wait until a time exception is thrown, after a request was sent and no answer was received.
static java.lang.String PROP_SERVICE_REFERENCE_CACHE_SIZE
          Size of the cache for remote service references.
 
Fields inherited from interface org.ws4d.java.configuration.PropertiesHandler
FALSE, TRUE
 
Method Summary
 void finishedSection(int depth)
          This method indicates the PropertiesHandler, that the last section with the given depth has been read completely.
static DispatchingProperties getInstance()
          Gets instance of dispatching properties.
 long getMatchWaitTime()
          Gets time in millis for which the framework waits for a resolve matches or a probe matches message, before it throws a TimeoutException.
 int getMessageIdBufferSize()
          Gets size of message id buffer.
 int getReferenceCachingTime()
          Gets target reference caching time, i. e. the time a DeviceReference is cached in the DeviceServiceRegistry without having a registered DeviceListener.
 int getResponseWaitTime()
          Gets time until request will timeout, if no response is received.
 int getServiceReferenceCacheSize()
          Gets cache size of ServiceReferences of remote services not linked to a parent device.
 boolean isDeviceReferenceAutoBuild()
          Is a device reference created for each recognized remote device.
 void setDeviceReferenceAutoBuild(boolean deviceReferenceAutoBuild)
          Sets if a device reference should be created for each recognized remote device.
 void setMatchWaitTime(long matchWaitTime)
          Sets time in millis for which the framework waits for a resolve matches or a probe matches message, before it throws a TimeoutException.
 void setMessageIdBufferSize(int msgIdBufferSize)
          Sets size of message id buffer.
 void setProperties(PropertyHeader header, Property property)
           
 void setReferenceCachingTime(int targetReferenceCachingTime)
          Sets target reference caching time, i. e. the time a DeviceReference is cached in the DeviceServiceRegistry without having a registered DeviceListener.
 void setResponseWaitTime(int responseWaitTime)
          Sets time until request will timeout, if no response is received.
 void setServiceReferenceCacheSize(int servRefCacheSize)
          Sets cache size of ServiceReferences of remote services not linked to a parent device.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PROP_REFERENCE_CACHING_TIME

public static final java.lang.String PROP_REFERENCE_CACHING_TIME
Caching time in milliseconds for references without reference holder.
Type: int
Default: 20000

See Also:
Constant Field Values

PROP_RESPONSE_WAIT_TIME

public static final java.lang.String PROP_RESPONSE_WAIT_TIME
Time to wait until a time exception is thrown, after a request was sent and no answer was received.
Type: int
Default: 10000

See Also:
Constant Field Values

PROP_MATCH_WAIT_TIME

public static final java.lang.String PROP_MATCH_WAIT_TIME
Time to wait until a time exception is thrown, after a request was sent and no answer was received.
Type: int
Default: 10000

See Also:
Constant Field Values

PROP_APPLICATION_MAX_DELAY

public static final java.lang.String PROP_APPLICATION_MAX_DELAY
Amount of time in millis dispatcher will wait to send probe matches and hello messages.
Type: long
Default: 2500

See Also:
Constant Field Values

PROP_MESSAGE_ID_BUFFER_SIZE

public static final java.lang.String PROP_MESSAGE_ID_BUFFER_SIZE
Size of message id buffer. The buffer is used to ignore multiplicated udp messages.
Type: int
Default: 50

See Also:
Constant Field Values

PROP_SERVICE_REFERENCE_CACHE_SIZE

public static final java.lang.String PROP_SERVICE_REFERENCE_CACHE_SIZE
Size of the cache for remote service references.
Type: int
Default: 50

See Also:
Constant Field Values

PROP_DEVICE_REFERENCE_AUTO_BUILD

public static final java.lang.String PROP_DEVICE_REFERENCE_AUTO_BUILD
Property to build up a device reference for each recognized remote device.
Type: boolean
Default: false

See Also:
Constant Field Values
Method Detail

getInstance

public static DispatchingProperties getInstance()
Gets instance of dispatching properties.

Returns:
the singleton instance of the dispatching properties

setProperties

public void setProperties(PropertyHeader header,
                          Property property)
Specified by:
setProperties in interface PropertiesHandler
Parameters:
header - header of section
property - property within section

finishedSection

public void finishedSection(int depth)
Description copied from interface: PropertiesHandler
This method indicates the PropertiesHandler, that the last section with the given depth has been read completely.

Specified by:
finishedSection in interface PropertiesHandler
Parameters:
depth - depth of section.

getReferenceCachingTime

public int getReferenceCachingTime()
Gets target reference caching time, i. e. the time a DeviceReference is cached in the DeviceServiceRegistry without having a registered DeviceListener.

Returns:
Time in millis a DeviceReference is cached without having a registered DeviceListener. Afterwards the reference is removed from the DeviceServiceRegistry.

setReferenceCachingTime

public void setReferenceCachingTime(int targetReferenceCachingTime)
Sets target reference caching time, i. e. the time a DeviceReference is cached in the DeviceServiceRegistry without having a registered DeviceListener.

Parameters:
targetReferenceCachingTime - Time in millis a DeviceReference is cached without having a registered DeviceListener. Afterwards the reference is removed from DeviceServiceRegistry.

getResponseWaitTime

public int getResponseWaitTime()
Gets time until request will timeout, if no response is received.

Returns:
time for request until response must have been received, or will timeout.

setResponseWaitTime

public void setResponseWaitTime(int responseWaitTime)
Sets time until request will timeout, if no response is received.

Parameters:
responseWaitTime - time for request until response must have been received, or will timeout

getMessageIdBufferSize

public int getMessageIdBufferSize()
Gets size of message id buffer. The buffer is used to ignore multiple received udp messages.

Returns:
the size for message ID buffers

setMessageIdBufferSize

public void setMessageIdBufferSize(int msgIdBufferSize)
Sets size of message id buffer. The buffer is used to ignore multiple received udp messages.

Parameters:
msgIdBufferSize -

getServiceReferenceCacheSize

public int getServiceReferenceCacheSize()
Gets cache size of ServiceReferences of remote services not linked to a parent device. The longest not used service reference will be disposed, if cache size is reached and an new service reference must be inserted into the cache.

Returns:
size of cache

setServiceReferenceCacheSize

public void setServiceReferenceCacheSize(int servRefCacheSize)
Sets cache size of ServiceReferences of remote services not linked to a parent device. The longest not used service reference will be disposed, if cache size is reached and an new service reference must be inserted into the cache.

Parameters:
servRefCacheSize - size of cache

getMatchWaitTime

public long getMatchWaitTime()
Gets time in millis for which the framework waits for a resolve matches or a probe matches message, before it throws a TimeoutException.

Returns:
time in millis.

setMatchWaitTime

public void setMatchWaitTime(long matchWaitTime)
Sets time in millis for which the framework waits for a resolve matches or a probe matches message, before it throws a TimeoutException.

Parameters:
matchWaitTime - time in millis.

isDeviceReferenceAutoBuild

public boolean isDeviceReferenceAutoBuild()
Is a device reference created for each recognized remote device.

Returns:
true, if a device reference is created for each recognized remote device, else false.

setDeviceReferenceAutoBuild

public void setDeviceReferenceAutoBuild(boolean deviceReferenceAutoBuild)
Sets if a device reference should be created for each recognized remote device.

Parameters:
deviceReferenceAutoBuild - true, if a device reference should be created for each recognized remote device, else false.