UM Java API 6.17.1

- Main Page
- Related Pages
- Classes

- Class List
- Class Hierarchy
- Class Members

Public Member Functions | Public Attributes | Protected Member Functions | List of all members
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

  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.

Parameters

  lbmevqattr | LBMEventQueueAttributes used to initialize the event queue.

Exceptions

  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.

Parameters

  cb | An object implementing the LBMEventQueueCallback interface
  cbArg | Callback object passed as token to callback interface

Exceptions

  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.

Parameters

  lbmevqattr | LBMEventQueueAttributes used to initialize the event queue.
  cb | An object implementing the LBMEventQueueCallback interface
  cbArg | Callback object passed as token to callback interface

Exceptions

  LBMException | if 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

  cb | Object 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

  cb | Object implementing the LBMEventQueueCallback interface
  cbArg | Callback 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

  attributeName | Name of the attribute to retrieve

Returns
  Value corresponding to the specified attribute name

Exceptions

  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.

Returns
  LBMEventQueueStatistics object containing the statistics corresponding to this event queue.

Exceptions

  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.

Parameters

  inStream | Input stream of bytes

Exceptions

  IOException | if any I/O error occurs.
  LBMRuntimeException | if 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

  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)

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

  LBMException | if any error occurs.

void com.latencybusters.lbm.LBMEventQueue.removeMonitor | ( | LBMEventQueueCallback | cb | ) |

Deregister a monitor callback

Parameters

  cb | Previously 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

  cb | Previously registered object implementing the LBMEventQueueCallback interface
  cbArg | Callback token for previously registered object

See also
  LBMEventQueueCallback
  addMonitor

void com.latencybusters.lbm.LBMEventQueue.resetStatistics | ( |  | ) | throws LBMException

Reset the event queue statistics.

Exceptions

  LBMException | if any error occurs resetting the statistics.

void com.latencybusters.lbm.LBMEventQueue.run | ( | long | milliseconds | ) |

Dispatch waiting events to the appropriate callback methods.

Parameters

  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.

Parameters

  attributeName | Name of the attribute to set
  attributeValue | New attribute value

Exceptions

  LBMException | if `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

  attributeName | Name of the attribute to set
  attributeValue | New attribute value

Exceptions

  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.

Returns
  Always returns 0 although an exception may be thrown in the event of an error.

Exceptions

  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 from run(long) as soon as possible (unblocks the queue).

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:

- LBMEventQueue.java