UM Java API  6.16
com.latencybusters.lbm.LBMReceiver Class Reference
Inheritance diagram for com.latencybusters.lbm.LBMReceiver:
com.latencybusters.lbm.LBMHotFailoverReceiver

Public Member Functions

 LBMReceiver (LBMContext lbmctx, LBMTopic lbmtopic, LBMReceiverCallback cb, Object cbArg) throws LBMException
 
 LBMReceiver (LBMContext lbmctx, LBMTopic lbmtopic, LBMReceiverCallback cb, Object cbArg, LBMEventQueue lbmevq) 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
 
LBMReceiverStatistics getStatistics (String source) throws LBMException
 
void resetStatistics (String source) throws LBMException
 
LBMReceiverStatistics getStatistics (int maxStats) throws LBMException
 
void resetStatistics () throws LBMException
 
void subscribeChannel (long channelNumber, LBMReceiverCallback cb, Object cbArg) throws LBMException
 
void unsubscribeChannel (long channelNumber) throws LBMException
 
final void close () throws LBMException
 
int receiverCount ()
 
void addReceiver (LBMReceiverCallback cb)
 
void addReceiver (LBMReceiverCallback cb, Object cbArg)
 
void removeReceiver (LBMReceiverCallback cb)
 
void removeReceiver (LBMReceiverCallback cb, Object cbArg)
 
void setSourceClientObject (String source, Object newClientObject) throws LBMEInvalException
 
void umederegister () throws LBMException
 
void umewrcvderegister () throws LBMException
 
void deregister () throws LBMException
 
void deregister (String queue) throws LBMException
 
void indexStopAssignment (String queue) throws LBMException
 
void indexStartAssignment (String queue) throws LBMException
 
void indexRelease (String queue, UMQIndexInfo index) throws LBMException
 
List< LBMMessagebrowseQueueMessages (String queue, int max, long timeoutMS) throws LBMException
 
void queueMessageList (String queue, LBMAsyncOperationCallback asyncOpCb) throws LBMException
 
void queueMessageList (String queue, LBMAsyncOperationCallback asyncOpCb, Object cbArg) throws LBMException
 
void queueMessageList (String queue, LBMAsyncOperationCallback asyncOpCb, Object cbArg, String msgSelector) throws LBMException
 
void queueMessageRetrieve (String queue, List< UMQMessageId > messageIDs, LBMAsyncOperationCallback asyncOpCb) throws LBMException
 
void queueMessageRetrieve (String queue, List< UMQMessageId > messageIDs, LBMAsyncOperationCallback asyncOpCb, Object cbArg) throws LBMException
 

Protected Member Functions

 LBMReceiver (LBMContext lbmctx, LBMTopic lbmtopic) throws LBMException
 
 LBMReceiver (LBMContext lbmctx, LBMTopic lbmtopic, LBMEventQueue lbmevq) throws LBMException
 
void finalize () throws LBMException
 
int onReceive (LBMMessage lbmmsg)
 
int onChannelReceive (LBMMessage lbmmsg, LBMReceiverCallback cb, Object cbArg)
 

Detailed Description

LBM Receiver class. This class can be subclassed in order to override the default onReceive() method used to deliver received data or an LBMReceiverCallback interface may be specified for handling the received message callback.

Warning: It is not safe to instantiate this class from a context thread callback.

Constructor & Destructor Documentation

com.latencybusters.lbm.LBMReceiver.LBMReceiver ( LBMContext  lbmctx,
LBMTopic  lbmtopic 
) throws LBMException
protected

Instantiate an LBM Receiver object associated with a given context and topic. ATTENTION: An application must have at least one receiver callback registered per receiver object. Use of this constructor in a class that does not override the onReceive method creates a window after receiver creation and before adding a callback in which messages may be lost. Using this constructor in a class that overrides the onReceive method yields the best performance, and is recommended. If multiple callbacks support is needed, or if overriding the onReceive method is not desirable, use a constructor that specifies at least one initial callback.

Warning: It is not safe to call this constructor from a context thread callback.

Parameters
lbmctxContext with which to associate the receiver.
lbmtopicLBMTopic used to initialize the receiver.
Exceptions
LBMExceptionif an error occurs creating the receiver.
com.latencybusters.lbm.LBMReceiver.LBMReceiver ( LBMContext  lbmctx,
LBMTopic  lbmtopic,
LBMEventQueue  lbmevq 
) throws LBMException
protected

Instantiate an LBM Receiver object associated with a given context, topic, and event queue. ATTENTION: An application must have at least one receiver callback registered per receiver object. Use of this constructor in a class that does not override the onReceive method creates a window after receiver creation and before adding a callback in which messages may be lost. Using this constructor in a class that overrides the onReceive method yields the best performance, and is recommended. If multiple callbacks support is needed, or if overriding the onReceive method is not desirable, use a constructor that specifies at least one initial callback.

Warning: It is not safe to call this constructor from a context thread callback.

Parameters
lbmctxContext with which to associate the receiver.
lbmtopicLBMTopic used to initialize the receiver.
lbmevqEvent queue with which to associate the receiver (all receiver events will be posted to this event queue).
Exceptions
LBMExceptionif an error occurs creating the receiver.
com.latencybusters.lbm.LBMReceiver.LBMReceiver ( LBMContext  lbmctx,
LBMTopic  lbmtopic,
LBMReceiverCallback  cb,
Object  cbArg 
) throws LBMException

Instantiate an LBM Receiver object associated with a given context and topic.

Warning: It is not safe to call this constructor from a context thread callback.

Parameters
lbmctxContext with which to associate the receiver.
lbmtopicLBMTopic used to initialize the receiver.
cbAn object implementing the LBMReceiverCallback interface
cbArgCallback object passed as token to callback interface
Exceptions
LBMExceptionif an error occurs creating the receiver.
com.latencybusters.lbm.LBMReceiver.LBMReceiver ( LBMContext  lbmctx,
LBMTopic  lbmtopic,
LBMReceiverCallback  cb,
Object  cbArg,
LBMEventQueue  lbmevq 
) throws LBMException

Instantiate an LBM Receiver object associated with a given context, topic, and event queue.

Warning: It is not safe to call this constructor from a context thread callback.

Parameters
lbmctxContext with which to associate the receiver.
lbmtopicLBMTopic used to initialize the receiver.
cbAn object implementing the LBMReceiverCallback interface
cbArgCallback object passed as token to callback interface
lbmevqEvent queue with which to associate the receiver (all receiver events will be posted to this event queue).
Exceptions
LBMExceptionif an error occurs creating the receiver.

References com.latencybusters.lbm.LBM.EINVAL.

Member Function Documentation

void com.latencybusters.lbm.LBMReceiverBase.addReceiver ( LBMReceiverCallback  cb)
inherited

Register a receiver callback

Parameters
cbObject implementing the LBMReceiverCallback interface
See also
LBMReceiverCallback
LBMReceiverBase::removeReceiver(LBMReceiverCallback)
void com.latencybusters.lbm.LBMReceiverBase.addReceiver ( LBMReceiverCallback  cb,
Object  cbArg 
)
inherited

Register a receiver callback (and callback token)

Parameters
cbObject implementing the LBMReceiverCallback interface
cbArgCallback token object
See also
LBMReceiverCallback
LBMReceiverBase::removeReceiver(LBMReceiverCallback)
List<LBMMessage> com.latencybusters.lbm.LBMReceiverBase.browseQueueMessages ( String  queue,
int  max,
long  timeoutMS 
) throws LBMException
inherited

Not currently supported. When implemented, it will browse messages on the given UMQ queue.

Parameters
queueName of the queue at which to browse.
maxThe max number of messages to return
timeoutMSTimeout
Exceptions
LBMExceptionif any error occurs.
final void com.latencybusters.lbm.LBMReceiverBase.close ( ) throws LBMException
inherited

Close this receiver.

Warning: It is not safe to call this method from a context thread callback.

void com.latencybusters.lbm.LBMReceiverBase.deregister ( ) throws LBMException
inherited

Deregister from all UMQ queues.

Exceptions
LBMEOPExceptionif an error occurs while attempting to deregister.
void com.latencybusters.lbm.LBMReceiverBase.deregister ( String  queue) throws LBMException
inherited

Deregister from a queue.

Parameters
queueThe name of the queue to deregister from.
Exceptions
LBMEOPExceptionif an error occurs while attempting to deregister.
LBMConfigOption [] com.latencybusters.lbm.LBMReceiver.dumpAttributeList ( )

Returns an array of LBMConfigOptions

Returns
Array of LBMConfigOption
void com.latencybusters.lbm.LBMReceiver.finalize ( ) throws LBMException
protected

This method is for internal use only, and is not supported for customer applications.

String com.latencybusters.lbm.LBMReceiver.getAttributeValue ( String  attributeName) throws LBMException

Returns the value of a receiver-related attribute for this receiver.

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

Return the current set of receiver transport statistics for a particular source.

Parameters
sourceSource string (as returned by LBMMesage source()) that specifies the set of statistics to return.
Returns
LBMReceiverStatistics object containing the statistics corresponding to the specified source.
Exceptions
LBMExceptionif any error occurred retrieving receiver statistics.

References com.latencybusters.lbm.LBMReceiverStatistics.refresh().

LBMReceiverStatistics com.latencybusters.lbm.LBMReceiver.getStatistics ( int  maxStats) throws LBMException

Return the current set of receiver transport statistics for all sources.

Parameters
maxStatsMaximum number of sources
Returns
LBMReceiverStatistics object containing the statistics corresponding to the specified number of sources
Exceptions
LBMExceptionif any error occurred retrieving receiver statistics.

References com.latencybusters.lbm.LBMReceiverStatistics.refresh().

void com.latencybusters.lbm.LBMReceiverBase.indexRelease ( String  queue,
UMQIndexInfo  index 
) throws LBMException
inherited

Instruct the given UMQ queue(s) to release the given UMQ index that is assigned to the given receiver.

Parameters
queueName of the queue at which to release the index, or null for all queues.
indexThe index to release, or null for all indices.
Exceptions
LBMExceptionif any error occurs.
Since
UMQ 1.2
void com.latencybusters.lbm.LBMReceiverBase.indexStartAssignment ( String  queue) throws LBMException
inherited

Starts this receiver's eligibility for new index assignments from a queue.

Parameters
queueThe name of the queue to start new index assignment from, or null for all queues.
Exceptions
LBMExceptionif an error occurs while attempting to start index assignment.
Since
UMQ 1.2
void com.latencybusters.lbm.LBMReceiverBase.indexStopAssignment ( String  queue) throws LBMException
inherited

Stops this receiver's eligibility for new index assignments from a queue.

Parameters
queueThe name of the queue to stop new index assignment from, or null for all queues.
Exceptions
LBMExceptionif an error occurs while attempting to stop index assignment.
Since
UMQ 1.2
void com.latencybusters.lbm.LBMReceiver.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.LBMReceiver.setProperty().

int com.latencybusters.lbm.LBMReceiverBase.onReceive ( LBMMessage  lbmmsg)
protectedinherited

Default received message callback. This method may be overridden by subclassing the LBMReceiverBase class (or one of the classes derived from LBMReceiverBase). Alternatively, a callback may be registered (deregistered) using the addReceiver() (removeReceiver()) methods.

Parameters
lbmmsgLBMMessage object containing the received data
See also
LBMReceiverBase::addReceiver(LBMReceiverCallback)
LBMReceiverBase::removeReceiver(LBMReceiverCallback)
void com.latencybusters.lbm.LBMReceiverBase.queueMessageList ( String  queue,
LBMAsyncOperationCallback  asyncOpCb 
) throws LBMException
inherited

Returns a list of currently-enqueued messages from the specified queue (which the receiver must be registered with).

Deprecated:
Parameters
queueName of the queue to retrieve the list of messages from.
asyncOpCbObject implementing the LBMAsyncOperationCallback interface that will receive updates and results for the asynchronous operation.
Exceptions
LBMExceptionif queue or asyncObCb parameters are invalid, or if an error occurs.
void com.latencybusters.lbm.LBMReceiverBase.queueMessageList ( String  queue,
LBMAsyncOperationCallback  asyncOpCb,
Object  cbArg 
) throws LBMException
inherited

Returns a list of currently-enqueued messages from the specified queue (which the receiver must be registered with).

Deprecated:
Parameters
queueName of the queue to retrieve the list of messages from.
asyncOpCbObject implementing the LBMAsyncOperationCallback interface that will receive updates and results for the asynchronous operation.
cbArgUser-supplied callback object which will be passed back when asyncOpCb's onAsyncOperation method is called.
Exceptions
LBMExceptionif queue or asyncObCb parameters are invalid, or if an error occurs.
void com.latencybusters.lbm.LBMReceiverBase.queueMessageList ( String  queue,
LBMAsyncOperationCallback  asyncOpCb,
Object  cbArg,
String  msgSelector 
) throws LBMException
inherited

Returns a list of currently-enqueued messages from the specified queue (which the receiver must be registered with).

Deprecated:
Parameters
queueName of the queue to retrieve the list of messages from.
asyncOpCbObject implementing the LBMAsyncOperationCallback interface that will receive updates and results for the asynchronous operation.
cbArgUser-supplied callback object which will be passed back when asyncOpCb's onAsyncOperation method is called.
msgSelectorUser-supplied message selector string.
Exceptions
LBMExceptionif queue or asyncObCb parameters are invalid, or if an error occurs.
void com.latencybusters.lbm.LBMReceiverBase.queueMessageRetrieve ( String  queue,
List< UMQMessageId messageIDs,
LBMAsyncOperationCallback  asyncOpCb 
) throws LBMException
inherited

Retrieves the given list of UMQ messages (specified by UMQMessageId) and their associated status information from the specified queue.

Deprecated:
Parameters
queueName of the queue to retrieve the messages from.
messageIDsA list of the UMQ message IDs of the messages desired.
asyncOpCbObject implementing the LBMAsyncOperationCallback interface that will receive updates and results for the asynchronous operation.
Exceptions
LBMExceptionif queue, asyncObCb, or messageIDs parameters are invalid, or if an error occurs.
void com.latencybusters.lbm.LBMReceiverBase.queueMessageRetrieve ( String  queue,
List< UMQMessageId messageIDs,
LBMAsyncOperationCallback  asyncOpCb,
Object  cbArg 
) throws LBMException
inherited

Retrieves the given list of UMQ messages (specified by UMQMessageId) and their associated status information from the specified queue.

Deprecated:
Parameters
queueName of the queue to retrieve the messages from.
messageIDsA list of the UMQ message IDs of the messages desired.
asyncOpCbObject implementing the LBMAsyncOperationCallback interface that will receive updates and results for the asynchronous operation.
cbArgUser-supplied callback object which will be passed back when asyncOpCb's onAsyncOperation method is called.
Exceptions
LBMExceptionif queue, asyncObCb, or messageIDs parameters are invalid, or if an error occurs.
int com.latencybusters.lbm.LBMReceiverBase.receiverCount ( )
inherited

Returns the number of receiver callbacks registered to this receiver

void com.latencybusters.lbm.LBMReceiverBase.removeReceiver ( LBMReceiverCallback  cb)
inherited

Deregister a receiver callback

Parameters
cbPreviously registered object implementing the LBMReceiverCallback interface
See also
LBMReceiverCallback
LBMReceiverBase::addReceiver(LBMReceiverCallback)
void com.latencybusters.lbm.LBMReceiverBase.removeReceiver ( LBMReceiverCallback  cb,
Object  cbArg 
)
inherited

Deregister a receiver callback (and callback token)

Parameters
cbPreviously registered object implementing the LBMReceiverCallback interface
cbArgCallback token for previously registered object
See also
LBMReceiverCallback
LBMReceiverBase::addReceiver(LBMReceiverCallback)
void com.latencybusters.lbm.LBMReceiver.resetStatistics ( String  source) throws LBMException

Reset the receiver transport statistics for a particular source.

Parameters
sourceThe string version of the source to reset statistics for.
Exceptions
LBMExceptionif any error occurred resetting statistics.
void com.latencybusters.lbm.LBMReceiver.resetStatistics ( ) throws LBMException

Reset the receiver transport statistics for all sources.

Exceptions
LBMExceptionif any error occurred resetting statistics.
void com.latencybusters.lbm.LBMReceiver.setAttributeValue ( String  attributeName,
String  attributeValue 
) throws LBMException

Set the value of a receiver-related attribute for this receiver. 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.LBMReceiver.setProperty().

Object com.latencybusters.lbm.LBMReceiver.setProperty ( String  attributeName,
String  attributeValue 
)

Set the value of a receiver-related attribute for this receiver.

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

Referenced by com.latencybusters.lbm.LBMReceiver.load().

void com.latencybusters.lbm.LBMReceiverBase.setSourceClientObject ( String  source,
Object  newClientObject 
) throws LBMEInvalException
inherited

Set (or change) this receiver's per-source client object for the source with source string matching "source".

Parameters
sourceSource string of source to look for.
newClientObjectThe new per-source client object to use with this source.
Exceptions
LBMEInvalExceptionif the source was not found.
void com.latencybusters.lbm.LBMReceiver.subscribeChannel ( long  channelNumber,
LBMReceiverCallback  cb,
Object  cbArg 
) throws LBMException

Subscribe to a given channel

void com.latencybusters.lbm.LBMReceiverBase.umederegister ( ) throws LBMException
inherited

Deregister from all UME Store.

Exceptions
LBMEOPExceptionif an error occurs while attempting to deregister.
void com.latencybusters.lbm.LBMReceiverBase.umewrcvderegister ( ) throws LBMException
inherited

Deregister Wildcard receiver from all UME Store.

Exceptions
LBMEOPExceptionif an error occurs while attempting to deregister.
void com.latencybusters.lbm.LBMReceiver.unsubscribeChannel ( long  channelNumber) throws LBMException

Cancel an existing subscription


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