UM Java API
6.16.1
|
Public Member Functions | |
LBMEventQueue () throws LBMException | |
LBMEventQueue (LBMEventQueueAttributes lbmevqattr) throws LBMException | |
LBMEventQueue (LBMEventQueueCallback cb, Object cbArg) throws LBMException | |
LBMEventQueue (LBMEventQueueAttributes lbmevqattr, LBMEventQueueCallback cb, Object cbArg) throws LBMException | |
void | close () |
int | queueSize () throws LBMException |
int | propertySize () |
int | shutdown () throws LBMException |
LBMConfigOption[] | dumpAttributeList () |
String | getAttributeValue (String attributeName) throws LBMException |
void | setAttributeValue (String attributeName, String attributeValue) throws LBMException |
Object | setProperty (String attributeName, String attributeValue) |
void | load (InputStream inStream) throws IOException |
void | run (long milliseconds) |
void | stop () |
LBMEventQueueStatistics | getStatistics () throws LBMException |
void | resetStatistics () throws LBMException |
void | addMonitor (LBMEventQueueCallback cb) |
void | addMonitor (LBMEventQueueCallback cb, Object cbArg) |
void | removeMonitor (LBMEventQueueCallback cb) |
void | removeMonitor (LBMEventQueueCallback cb, Object cbArg) |
Public Attributes | |
int | maxIterationRunTime = 1000 |
Protected Member Functions | |
void | finalize () |
void | monitor (int eventType, int eventQueueSize, long eventQueueDelay) |
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.
com.latencybusters.lbm.LBMEventQueue.LBMEventQueue | ( | ) | throws LBMException |
Instantiate an LBM Event Queue object using default attributes. See Event Queue Object for a full description of Event Queues.
LBMException | if there was an error creating the event queue. |
com.latencybusters.lbm.LBMEventQueue.LBMEventQueue | ( | LBMEventQueueAttributes | lbmevqattr | ) | throws LBMException |
Instantiate an LBM Event Queue object using the given attributes. See Event Queue Object for a full description of Event Queues.
lbmevqattr | LBMEventQueueAttributes used to initialize the event queue. |
LBMException | if any error occurs creating the event queue. |
com.latencybusters.lbm.LBMEventQueue.LBMEventQueue | ( | LBMEventQueueCallback | cb, |
Object | cbArg | ||
) | throws LBMException |
Instantiate an LBM Event Queue object using default attributes. See Event Queue Object for a full description of Event Queues.
cb | An object implementing the LBMEventQueueCallback interface |
cbArg | Callback object passed as token to callback interface |
LBMException | if any error occurs creating the event queue. |
References com.latencybusters.lbm.LBMEventQueue.addMonitor().
com.latencybusters.lbm.LBMEventQueue.LBMEventQueue | ( | LBMEventQueueAttributes | lbmevqattr, |
LBMEventQueueCallback | cb, | ||
Object | cbArg | ||
) | throws LBMException |
Instantiate an LBM Event Queue object using the given attributes. See Event Queue Object for a full description of Event Queues.
lbmevqattr | LBMEventQueueAttributes used to initialize the event queue. |
cb | An object implementing the LBMEventQueueCallback interface |
cbArg | Callback object passed as token to callback interface |
LBMException | if any error occurs creating the event queue. |
References com.latencybusters.lbm.LBMEventQueue.addMonitor().
void com.latencybusters.lbm.LBMEventQueue.addMonitor | ( | LBMEventQueueCallback | cb | ) |
Register a monitor callback
cb | Object implementing the LBMEventQueueCallback interface |
Referenced by com.latencybusters.lbm.LBMEventQueue.LBMEventQueue().
void com.latencybusters.lbm.LBMEventQueue.addMonitor | ( | LBMEventQueueCallback | cb, |
Object | cbArg | ||
) |
Register a monitor callback (and callback token)
cb | Object implementing the LBMEventQueueCallback interface |
cbArg | Callback token object |
void com.latencybusters.lbm.LBMEventQueue.close | ( | ) |
Close this event queue. Since this method deletes the underlying LBM event queue object, it should not be called prior to closing or canceling of its dependent objects (e.g., LBMSource, LBMReceiver, LBMRequest, LBMTimer).
Referenced by com.latencybusters.lbm.LBMEventQueue.finalize().
LBMConfigOption [] com.latencybusters.lbm.LBMEventQueue.dumpAttributeList | ( | ) |
Returns an array of LBMConfigOptions.
|
protected |
This method is for internal use only, and is not supported for customer applications.
References com.latencybusters.lbm.LBMEventQueue.close().
String com.latencybusters.lbm.LBMEventQueue.getAttributeValue | ( | String | attributeName | ) | throws LBMException |
Returns the value of an event queue-related attribute for this event queue.
attributeName | Name of the attribute to retrieve |
LBMException | if attributeName is not a valid attribute. |
LBMEventQueueStatistics com.latencybusters.lbm.LBMEventQueue.getStatistics | ( | ) | throws LBMException |
Return the current set of statistics for this event queue.
LBMException | if any error occurred retrieving statistics. |
References com.latencybusters.lbm.LBMEventQueueStatistics.refresh(), and com.latencybusters.lbm.LBMObjectRecyclerBase.retrieveEventQueueStatistics().
void com.latencybusters.lbm.LBMEventQueue.load | ( | InputStream | inStream | ) | throws IOException |
Reads a property (attribute) list (key and element pairs) from the input stream.
inStream | Input stream of bytes |
IOException | if any I/O error occurs. |
LBMRuntimeException | if any invalid attribute is detected in inStream . |
References com.latencybusters.lbm.LBMEventQueue.setProperty().
|
protected |
Default event queue monitoring callback. This method may be overridden by subclassing the LBMEventQueue class. Alternatively, the callback may be registered (deregistered) using the addMonitor() (removeMonitor()) methods.
eventType | monitoring event type |
eventQueueSize | current event queue size (when monitor fires due |
eventQueueDelay | current event queue delay in microseconds (when monitor fires due to excessive queue delay) |
References com.latencybusters.lbm.LBMEventQueueCallback.monitor().
int com.latencybusters.lbm.LBMEventQueue.propertySize | ( | ) |
A wrapper for the size() method in java.util.Properties due to an unfortunate name choice.
int com.latencybusters.lbm.LBMEventQueue.queueSize | ( | ) | throws LBMException |
Determine the number of queued events in the event queue. This method is only supported when the queue_size_warning config variable is set. If not set, then this function will throw an exception with an error number == LBM.EINVAL.
LBMException | if any error occurs. |
void com.latencybusters.lbm.LBMEventQueue.removeMonitor | ( | LBMEventQueueCallback | cb | ) |
Deregister a monitor callback
cb | Previously registered object implementing the LBMEventQueueCallback interface |
void com.latencybusters.lbm.LBMEventQueue.removeMonitor | ( | LBMEventQueueCallback | cb, |
Object | cbArg | ||
) |
Deregister a monitor callback (and callback token)
cb | Previously registered object implementing the LBMEventQueueCallback interface |
cbArg | Callback token for previously registered object |
void com.latencybusters.lbm.LBMEventQueue.resetStatistics | ( | ) | throws LBMException |
Reset the event queue statistics.
LBMException | if any error occurs resetting the statistics. |
void com.latencybusters.lbm.LBMEventQueue.run | ( | long | milliseconds | ) |
Dispatch waiting events to the appropriate callback methods.
milliseconds | Number of milliseconds to block before returning. |
References com.latencybusters.lbm.LBM.EVENT_QUEUE_BLOCK, and com.latencybusters.lbm.LBMEventQueue.maxIterationRunTime.
void com.latencybusters.lbm.LBMEventQueue.setAttributeValue | ( | String | attributeName, |
String | attributeValue | ||
) | throws LBMException |
Set the value of an event queue-related attribute for this event queue. Note that this method bypasses the property list. As such no attributes configured using this method will appear in the property list.
attributeName | Name of the attribute to set |
attributeValue | New attribute value |
LBMException | if attributeName is not a valid attribute, or attributeValue is not a valid value for attributeName . |
Referenced by com.latencybusters.lbm.LBMEventQueue.setProperty().
Object com.latencybusters.lbm.LBMEventQueue.setProperty | ( | String | attributeName, |
String | attributeValue | ||
) |
Set the value of an event queue-related attribute for this event queue.
attributeName | Name of the attribute to set |
attributeValue | New attribute value |
LBMRuntimeException | if attributeName is not a valid attribute, or attributeValue is not a valid value for attributeName . |
References com.latencybusters.lbm.LBMEventQueue.setAttributeValue().
Referenced by com.latencybusters.lbm.LBMEventQueue.load().
int com.latencybusters.lbm.LBMEventQueue.shutdown | ( | ) | throws LBMException |
Shutdown the event queue by purging any pending events and not allowing additional events to be added to the queue.
LBMException | if any error occurs shutting down the event queue. |
void com.latencybusters.lbm.LBMEventQueue.stop | ( | ) |
Signal any threads dispatching the event queue to return as soon as possible.
int com.latencybusters.lbm.LBMEventQueue.maxIterationRunTime = 1000 |
Maximum time (in milliseconds) the event queue will run for at one time.
Referenced by com.latencybusters.lbm.LBMEventQueue.run().