|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.util.Dictionary<K,V>
java.util.Hashtable<java.lang.Object,java.lang.Object>
java.util.Properties
com.latencybusters.lbm.LBMEventQueue
public class LBMEventQueue
LBM Event Queue class. This class may be subclassed to override the default event queue monitoring method or an LBMEventQueueCallback interface may be specified to handle the monitor callback.
Field Summary | |
---|---|
int |
maxIterationRunTime
Maximum time (in milliseconds) the event queue will run for at one time. |
Fields inherited from class java.util.Properties |
---|
defaults |
Constructor Summary | |
---|---|
LBMEventQueue()
Instantiate an LBM Event Queue object using default attributes. |
|
LBMEventQueue(LBMEventQueueAttributes lbmevqattr)
Instantiate an LBM Event Queue object using the given attributes. |
|
LBMEventQueue(LBMEventQueueAttributes lbmevqattr,
LBMEventQueueCallback cb,
java.lang.Object cbArg)
Instantiate an LBM Event Queue object using the given attributes. |
|
LBMEventQueue(LBMEventQueueCallback cb,
java.lang.Object cbArg)
Instantiate an LBM Event Queue object using default attributes. |
Method Summary | |
---|---|
void |
addMonitor(LBMEventQueueCallback cb)
Register a monitor callback |
void |
addMonitor(LBMEventQueueCallback cb,
java.lang.Object cbArg)
Register a monitor callback (and callback token) |
void |
close()
Close this event queue. |
LBMConfigOption[] |
dumpAttributeList()
Returns an array of LBMConfigOptions. |
protected void |
finalize()
|
java.lang.String |
getAttributeValue(java.lang.String attributeName)
Returns the value of an event queue-related attribute for this event queue. |
LBMEventQueueStatistics |
getStatistics()
Return the current set of statistics for this event queue. |
void |
load(java.io.InputStream inStream)
Reads a property (attribute) list (key and element pairs) from the input stream. |
protected void |
monitor(int eventType,
int eventQueueSize,
long eventQueueDelay)
Default event queue monitoring callback. |
int |
propertySize()
Deprecated. In LBM4.0. This API existed because there was an LBMEventQueue.size() API which conflicted with java.util.Properties. This has been removed so propertySize() is no longer required. Use Hashtable.size() |
int |
queueSize()
Determine the number of queued events in the event queue. |
void |
removeMonitor(LBMEventQueueCallback cb)
Deregister a monitor callback |
void |
removeMonitor(LBMEventQueueCallback cb,
java.lang.Object cbArg)
Deregister a monitor callback (and callback token) |
void |
resetStatistics()
Reset the event queue statistics. |
void |
run(long milliseconds)
Dispatch waiting events to the appropriate callback methods. |
void |
setAttributeValue(java.lang.String attributeName,
java.lang.String attributeValue)
Set the value of an event queue-related attribute for this event queue. |
java.lang.Object |
setProperty(java.lang.String attributeName,
java.lang.String attributeValue)
Set the value of an event queue-related attribute for this event queue. |
int |
shutdown()
Shutdown the event queue by purging any pending events and not allowing additional events to be added to the queue. |
void |
stop()
Signal any threads dispatching the event queue to return as soon as possible. |
Methods inherited from class java.util.Properties |
---|
getProperty, getProperty, list, list, load, loadFromXML, propertyNames, save, store, store, storeToXML, storeToXML, stringPropertyNames |
Methods inherited from class java.util.Hashtable |
---|
clear, clone, contains, containsKey, containsValue, elements, entrySet, equals, get, hashCode, isEmpty, keys, keySet, put, putAll, rehash, remove, size, toString, values |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public int maxIterationRunTime
Constructor Detail |
---|
public LBMEventQueue() throws LBMException
LBMException
- if there was an error creating the event queue.public LBMEventQueue(LBMEventQueueAttributes lbmevqattr) throws LBMException
lbmevqattr
- LBMEventQueueAttributes used to initialize the event queue.
LBMException
- if any error occurs creating the event queue.public LBMEventQueue(LBMEventQueueCallback cb, java.lang.Object cbArg) throws LBMException
cb
- An object implementing the LBMEventQueueCallback interfacecbArg
- Callback object passed as token to callback interface
LBMException
- if any error occurs creating the event queue.public LBMEventQueue(LBMEventQueueAttributes lbmevqattr, LBMEventQueueCallback cb, java.lang.Object cbArg) throws LBMException
lbmevqattr
- LBMEventQueueAttributes used to initialize the event queue.cb
- An object implementing the LBMEventQueueCallback interfacecbArg
- Callback object passed as token to callback interface
LBMException
- if any error occurs creating the event queue.Method Detail |
---|
protected void finalize()
finalize
in class java.lang.Object
public void close()
public int queueSize() throws LBMException
LBMException
- if any error occurs.public int propertySize()
Hashtable.size()
public int shutdown() throws LBMException
LBMException
- if any error occurs shutting down the event queue.public LBMConfigOption[] dumpAttributeList()
public java.lang.String getAttributeValue(java.lang.String attributeName) throws LBMException
attributeName
- Name of the attribute to retrieve
LBMException
- if attributeName
is not a valid attribute.public void setAttributeValue(java.lang.String attributeName, java.lang.String attributeValue) throws LBMException
attributeName
- Name of the attribute to setattributeValue
- New attribute value
LBMException
- if attributeName
is not a valid attribute,
or attributeValue
is not a valid value for attributeName
.setProperty(java.lang.String, java.lang.String)
public java.lang.Object setProperty(java.lang.String attributeName, java.lang.String attributeValue)
setProperty
in class java.util.Properties
attributeName
- Name of the attribute to setattributeValue
- New attribute value
LBMRuntimeException
- if attributeName
is not a valid attribute,
or attributeValue
is not a valid value for attributeName
.public void load(java.io.InputStream inStream) throws java.io.IOException
load
in class java.util.Properties
inStream
- Input stream of bytes
java.io.IOException
- if any I/O error occurs.
LBMRuntimeException
- if any invalid attribute is detected in inStream
.public void run(long milliseconds)
milliseconds
- Number of milliseconds to block before returning.public void stop()
run(long)
public LBMEventQueueStatistics getStatistics() throws LBMException
LBMException
- if any error occurred retrieving statistics.public void resetStatistics() throws LBMException
LBMException
- if any error occurs resetting the statistics.public void addMonitor(LBMEventQueueCallback cb)
cb
- Object implementing the LBMEventQueueCallback interfaceLBMEventQueueCallback
,
removeMonitor(com.latencybusters.lbm.LBMEventQueueCallback)
public void addMonitor(LBMEventQueueCallback cb, java.lang.Object cbArg)
cb
- Object implementing the LBMEventQueueCallback interfacecbArg
- Callback token objectLBMEventQueueCallback
,
removeMonitor(com.latencybusters.lbm.LBMEventQueueCallback)
public void removeMonitor(LBMEventQueueCallback cb)
cb
- Previously registered object implementing the
LBMEventQueueCallback interfaceLBMEventQueueCallback
,
addMonitor(com.latencybusters.lbm.LBMEventQueueCallback)
public void removeMonitor(LBMEventQueueCallback cb, java.lang.Object cbArg)
cb
- Previously registered object implementing the
LBMEventQueueCallback interfacecbArg
- Callback token for previously registered objectLBMEventQueueCallback
,
addMonitor(com.latencybusters.lbm.LBMEventQueueCallback)
protected void monitor(int eventType, int eventQueueSize, long eventQueueDelay)
eventType
- monitoring event typeeventQueueSize
- current event queue size (when monitor fires dueeventQueueDelay
- current event queue delay in microseconds
(when monitor fires due to excessive queue delay)addMonitor(com.latencybusters.lbm.LBMEventQueueCallback)
,
removeMonitor(com.latencybusters.lbm.LBMEventQueueCallback)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |