UM Java API  6.16.1
com.latencybusters.lbm.LBMEventQueue Class Reference
Inheritance diagram for com.latencybusters.lbm.LBMEventQueue:

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)
 

Detailed Description

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.

Constructor & Destructor Documentation

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.

Exceptions
LBMExceptionif 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.

Parameters
lbmevqattrLBMEventQueueAttributes used to initialize the event queue.
Exceptions
LBMExceptionif 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.

Parameters
cbAn object implementing the LBMEventQueueCallback interface
cbArgCallback object passed as token to callback interface
Exceptions
LBMExceptionif 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.

Parameters
lbmevqattrLBMEventQueueAttributes used to initialize the event queue.
cbAn object implementing the LBMEventQueueCallback interface
cbArgCallback object passed as token to callback interface
Exceptions
LBMExceptionif any error occurs creating the event queue.

References com.latencybusters.lbm.LBMEventQueue.addMonitor().

Member Function Documentation

void com.latencybusters.lbm.LBMEventQueue.addMonitor ( LBMEventQueueCallback  cb)

Register a monitor callback

Parameters
cbObject implementing the LBMEventQueueCallback interface
See also
LBMEventQueueCallback
removeMonitor

Referenced by com.latencybusters.lbm.LBMEventQueue.LBMEventQueue().

void com.latencybusters.lbm.LBMEventQueue.addMonitor ( LBMEventQueueCallback  cb,
Object  cbArg 
)

Register a monitor callback (and callback token)

Parameters
cbObject implementing the LBMEventQueueCallback interface
cbArgCallback token object
See also
LBMEventQueueCallback
removeMonitor
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.

Returns
Array of LBMConfigOption
void com.latencybusters.lbm.LBMEventQueue.finalize ( )
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.

Parameters
attributeNameName of the attribute to retrieve
Returns
Value corresponding to the specified attribute name
Exceptions
LBMExceptionif attributeName is not a valid attribute.
LBMEventQueueStatistics com.latencybusters.lbm.LBMEventQueue.getStatistics ( ) throws LBMException

Return the current set of statistics for this event queue.

Returns
LBMEventQueueStatistics object containing the statistics corresponding to this event queue.
Exceptions
LBMExceptionif 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.

Parameters
inStreamInput stream of bytes
Exceptions
IOExceptionif any I/O error occurs.
LBMRuntimeExceptionif any invalid attribute is detected in inStream.

References com.latencybusters.lbm.LBMEventQueue.setProperty().

void com.latencybusters.lbm.LBMEventQueue.monitor ( int  eventType,
int  eventQueueSize,
long  eventQueueDelay 
)
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.

Parameters
eventTypemonitoring event type
eventQueueSizecurrent event queue size (when monitor fires due
eventQueueDelaycurrent event queue delay in microseconds (when monitor fires due to excessive queue delay)
See also
addMonitor
removeMonitor

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.

Returns
Number of keys in the property list.
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 size()
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.

Returns
Number of queued events on the event queue
Exceptions
LBMExceptionif any error occurs.
void com.latencybusters.lbm.LBMEventQueue.removeMonitor ( LBMEventQueueCallback  cb)

Deregister a monitor callback

Parameters
cbPreviously registered object implementing the LBMEventQueueCallback interface
See also
LBMEventQueueCallback
addMonitor
void com.latencybusters.lbm.LBMEventQueue.removeMonitor ( LBMEventQueueCallback  cb,
Object  cbArg 
)

Deregister a monitor callback (and callback token)

Parameters
cbPreviously registered object implementing the LBMEventQueueCallback interface
cbArgCallback token for previously registered object
See also
LBMEventQueueCallback
addMonitor
void com.latencybusters.lbm.LBMEventQueue.resetStatistics ( ) throws LBMException

Reset the event queue statistics.

Exceptions
LBMExceptionif any error occurs resetting the statistics.
void com.latencybusters.lbm.LBMEventQueue.run ( long  milliseconds)

Dispatch waiting events to the appropriate callback methods.

Parameters
millisecondsNumber 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.

Parameters
attributeNameName of the attribute to set
attributeValueNew attribute value
Exceptions
LBMExceptionif attributeName is not a valid attribute, or attributeValue is not a valid value for attributeName.
See also
setProperty

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.

Parameters
attributeNameName of the attribute to set
attributeValueNew attribute value
Exceptions
LBMRuntimeExceptionif 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.

Returns
Always returns 0 although an exception may be thrown in the event of an error.
Exceptions
LBMExceptionif 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.

See also
run(long)

Member Data Documentation

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().


The documentation for this class was generated from the following file: