|
|||||||||
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.LBMReceiver
public class LBMReceiver
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.
Field Summary |
---|
Fields inherited from class java.util.Properties |
---|
defaults |
Constructor Summary | |
---|---|
protected |
LBMReceiver(LBMContext lbmctx,
LBMTopic lbmtopic)
Instantiate an LBM Receiver object associated with a given context and topic. |
protected |
LBMReceiver(LBMContext lbmctx,
LBMTopic lbmtopic,
LBMEventQueue lbmevq)
Instantiate an LBM Receiver object associated with a given context, topic, and event queue. |
|
LBMReceiver(LBMContext lbmctx,
LBMTopic lbmtopic,
LBMReceiverCallback cb,
java.lang.Object cbArg)
Instantiate an LBM Receiver object associated with a given context and topic. |
|
LBMReceiver(LBMContext lbmctx,
LBMTopic lbmtopic,
LBMReceiverCallback cb,
java.lang.Object cbArg,
LBMEventQueue lbmevq)
Instantiate an LBM Receiver object associated with a given context, topic, and event queue. |
Method Summary | |
---|---|
void |
addReceiver(LBMReceiverCallback cb)
Register a receiver callback |
void |
addReceiver(LBMReceiverCallback cb,
java.lang.Object cbArg)
Register a receiver callback (and callback token) |
java.util.List<LBMMessage> |
browseQueueMessages(java.lang.String queue,
int max,
long timeoutMS)
Not currently supported. |
void |
close()
Close this receiver. |
void |
deregister()
Deregister from all UMQ queues. |
void |
deregister(java.lang.String queue)
Deregister from a queue. |
LBMConfigOption[] |
dumpAttributeList()
Returns an array of LBMConfigOptions |
protected void |
finalize()
|
java.lang.String |
getAttributeValue(java.lang.String attributeName)
Returns the value of a receiver-related attribute for this receiver. |
LBMReceiverStatistics |
getStatistics(int maxStats)
Return the current set of receiver transport statistics for all sources. |
LBMReceiverStatistics |
getStatistics(java.lang.String source)
Return the current set of receiver transport statistics for a particular source. |
void |
indexRelease(java.lang.String queue,
UMQIndexInfo index)
Instruct the given UMQ queue(s) to release the given UMQ index that is assigned to the given receiver. |
void |
indexStartAssignment(java.lang.String queue)
Starts this receiver's eligibility for new index assignments from a queue. |
void |
indexStopAssignment(java.lang.String queue)
Stops this receiver's eligibility for new index assignments from a queue. |
void |
load(java.io.InputStream inStream)
Reads a property (attribute) list (key and element pairs) from the input stream. |
protected int |
onChannelReceive(LBMMessage lbmmsg,
LBMReceiverCallback cb,
java.lang.Object cbArg)
|
protected int |
onReceive(LBMMessage lbmmsg)
Default received message callback. |
void |
queueMessageList(java.lang.String queue,
LBMAsyncOperationCallback asyncOpCb)
Returns a list of currently-enqueued messages from the specified queue (which the receiver must be registered with). |
void |
queueMessageList(java.lang.String queue,
LBMAsyncOperationCallback asyncOpCb,
java.lang.Object cbArg)
Returns a list of currently-enqueued messages from the specified queue (which the receiver must be registered with). |
void |
queueMessageList(java.lang.String queue,
LBMAsyncOperationCallback asyncOpCb,
java.lang.Object cbArg,
java.lang.String msgSelector)
Returns a list of currently-enqueued messages from the specified queue (which the receiver must be registered with). |
void |
queueMessageRetrieve(java.lang.String queue,
java.util.List<UMQMessageId> messageIDs,
LBMAsyncOperationCallback asyncOpCb)
Retrieves the given list of UMQ messages (specified by UMQMessageId) and their associated status information from the specified queue. |
void |
queueMessageRetrieve(java.lang.String queue,
java.util.List<UMQMessageId> messageIDs,
LBMAsyncOperationCallback asyncOpCb,
java.lang.Object cbArg)
Retrieves the given list of UMQ messages (specified by UMQMessageId) and their associated status information from the specified queue. |
int |
receiverCount()
Returns the number of receiver callbacks registered to this receiver |
void |
removeReceiver(LBMReceiverCallback cb)
Deregister a receiver callback |
void |
removeReceiver(LBMReceiverCallback cb,
java.lang.Object cbArg)
Deregister a receiver callback (and callback token) |
void |
resetStatistics()
Reset the receiver transport statistics for all sources. |
void |
resetStatistics(java.lang.String source)
Reset the receiver transport statistics for a particular source. |
void |
setAttributeValue(java.lang.String attributeName,
java.lang.String attributeValue)
Set the value of a receiver-related attribute for this receiver. |
java.lang.Object |
setProperty(java.lang.String attributeName,
java.lang.String attributeValue)
Set the value of a receiver-related attribute for this receiver. |
void |
setSourceClientObject(java.lang.String source,
java.lang.Object newClientObject)
Set (or change) this receiver's per-source client object for the source with source string matching "source". |
void |
subscribeChannel(long channelNumber,
LBMReceiverCallback cb,
java.lang.Object cbArg)
Subscribe to a given channel |
void |
umederegister()
Deregister from all UME Store. |
void |
umewrcvderegister()
Deregister Wildcard receiver from all UME Store. |
void |
unsubscribeChannel(long channelNumber)
Cancel an existing subscription |
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 |
Constructor Detail |
---|
protected LBMReceiver(LBMContext lbmctx, LBMTopic lbmtopic) throws LBMException
Warning: It is not safe to call this constructor from a context thread callback.
lbmctx
- Context with which to associate the receiver.lbmtopic
- LBMTopic used to initialize the receiver.
LBMException
- if an error occurs creating the receiver.protected LBMReceiver(LBMContext lbmctx, LBMTopic lbmtopic, LBMEventQueue lbmevq) throws LBMException
Warning: It is not safe to call this constructor from a context thread callback.
lbmctx
- Context with which to associate the receiver.lbmtopic
- LBMTopic used to initialize the receiver.lbmevq
- Event queue with which to associate the receiver
(all receiver events will be posted to this event queue).
LBMException
- if an error occurs creating the receiver.public LBMReceiver(LBMContext lbmctx, LBMTopic lbmtopic, LBMReceiverCallback cb, java.lang.Object cbArg) throws LBMException
Warning: It is not safe to call this constructor from a context thread callback.
lbmctx
- Context with which to associate the receiver.lbmtopic
- LBMTopic used to initialize the receiver.cb
- An object implementing the LBMReceiverCallback interfacecbArg
- Callback object passed as token to callback interface
LBMException
- if an error occurs creating the receiver.public LBMReceiver(LBMContext lbmctx, LBMTopic lbmtopic, LBMReceiverCallback cb, java.lang.Object cbArg, LBMEventQueue lbmevq) throws LBMException
Warning: It is not safe to call this constructor from a context thread callback.
lbmctx
- Context with which to associate the receiver.lbmtopic
- LBMTopic used to initialize the receiver.cb
- An object implementing the LBMReceiverCallback interfacecbArg
- Callback object passed as token to callback interfacelbmevq
- Event queue with which to associate the receiver
(all receiver events will be posted to this event queue).
LBMException
- if an error occurs creating the receiver.Method Detail |
---|
protected void finalize() throws LBMException
LBMException
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 LBMReceiverStatistics getStatistics(java.lang.String source) throws LBMException
source
- Source string (as returned by LBMMesage source())
that specifies the set of statistics to return.
LBMException
- if any error occurred retrieving receiver statistics.public void resetStatistics(java.lang.String source) throws LBMException
source
- The string version of the source to reset statistics for.
LBMException
- if any error occurred resetting statistics.public LBMReceiverStatistics getStatistics(int maxStats) throws LBMException
maxStats
- Maximum number of sources
LBMException
- if any error occurred retrieving receiver statistics.public void resetStatistics() throws LBMException
LBMException
- if any error occurred resetting statistics.public void subscribeChannel(long channelNumber, LBMReceiverCallback cb, java.lang.Object cbArg) throws LBMException
LBMException
public void unsubscribeChannel(long channelNumber) throws LBMException
LBMException
public final void close() throws LBMException
Warning: It is not safe to call this method from a context thread callback.
LBMException
public int receiverCount()
public void addReceiver(LBMReceiverCallback cb)
cb
- Object implementing the LBMReceiverCallback interfaceLBMReceiverCallback
,
removeReceiver(com.latencybusters.lbm.LBMReceiverCallback)
public void addReceiver(LBMReceiverCallback cb, java.lang.Object cbArg)
cb
- Object implementing the LBMReceiverCallback interfacecbArg
- Callback token objectLBMReceiverCallback
,
removeReceiver(com.latencybusters.lbm.LBMReceiverCallback)
public void removeReceiver(LBMReceiverCallback cb)
cb
- Previously registered object implementing the
LBMReceiverCallback interfaceLBMReceiverCallback
,
addReceiver(com.latencybusters.lbm.LBMReceiverCallback)
public void removeReceiver(LBMReceiverCallback cb, java.lang.Object cbArg)
cb
- Previously registered object implementing the
LBMReceiverCallback interfacecbArg
- Callback token for previously registered objectLBMReceiverCallback
,
addReceiver(com.latencybusters.lbm.LBMReceiverCallback)
protected int onReceive(LBMMessage lbmmsg)
lbmmsg
- LBMMessage object containing the received dataaddReceiver(com.latencybusters.lbm.LBMReceiverCallback)
,
removeReceiver(com.latencybusters.lbm.LBMReceiverCallback)
protected int onChannelReceive(LBMMessage lbmmsg, LBMReceiverCallback cb, java.lang.Object cbArg)
public void setSourceClientObject(java.lang.String source, java.lang.Object newClientObject) throws LBMEInvalException
source
- Source string of source to look for.newClientObject
- The new per-source client object to use with this source.
LBMEInvalException
- if the source was not found.public void umederegister() throws LBMException
LBMEOPException
- if an error occurs while attempting to deregister.
LBMException
public void umewrcvderegister() throws LBMException
LBMEOPException
- if an error occurs while attempting to deregister.
LBMException
public void deregister() throws LBMException
LBMEOPException
- if an error occurs while attempting to deregister.
LBMException
public void deregister(java.lang.String queue) throws LBMException
queue
- The name of the queue to deregister from.
LBMEOPException
- if an error occurs while attempting to deregister.
LBMException
public void indexStopAssignment(java.lang.String queue) throws LBMException
queue
- The name of the queue to stop new index assignment from, or null for all queues.
LBMException
- if an error occurs while attempting to stop index assignment.public void indexStartAssignment(java.lang.String queue) throws LBMException
queue
- The name of the queue to start new index assignment from, or null for all queues.
LBMException
- if an error occurs while attempting to start index assignment.public void indexRelease(java.lang.String queue, UMQIndexInfo index) throws LBMException
queue
- Name of the queue at which to release the index, or null for all queues.index
- The index to release, or null for all indices.
LBMException
- if any error occurs.public java.util.List<LBMMessage> browseQueueMessages(java.lang.String queue, int max, long timeoutMS) throws LBMException
queue
- Name of the queue at which to browse.max
- The max number of messages to return
LBMException
- if any error occurs.public void queueMessageList(java.lang.String queue, LBMAsyncOperationCallback asyncOpCb) throws LBMException
queue
- Name of the queue to retrieve the list of messages from.asyncOpCb
- Object implementing the LBMAsyncOperationCallback interface that will receive updates and results for the asynchronous operation.
LBMException
- if queue or asyncObCb parameters are invalid, or if an error occurs.public void queueMessageList(java.lang.String queue, LBMAsyncOperationCallback asyncOpCb, java.lang.Object cbArg) throws LBMException
queue
- Name of the queue to retrieve the list of messages from.asyncOpCb
- Object implementing the LBMAsyncOperationCallback interface that will receive updates and results for the asynchronous operation.cbArg
- User-supplied callback object which will be passed back when asyncOpCb's onAsyncOperation method is called.
LBMException
- if queue or asyncObCb parameters are invalid, or if an error occurs.public void queueMessageList(java.lang.String queue, LBMAsyncOperationCallback asyncOpCb, java.lang.Object cbArg, java.lang.String msgSelector) throws LBMException
queue
- Name of the queue to retrieve the list of messages from.asyncOpCb
- Object implementing the LBMAsyncOperationCallback interface that will receive updates and results for the asynchronous operation.cbArg
- User-supplied callback object which will be passed back when asyncOpCb's onAsyncOperation method is called.msgSelector
- User-supplied message selector string.
LBMException
- if queue or asyncObCb parameters are invalid, or if an error occurs.public void queueMessageRetrieve(java.lang.String queue, java.util.List<UMQMessageId> messageIDs, LBMAsyncOperationCallback asyncOpCb) throws LBMException
queue
- Name of the queue to retrieve the messages from.messageIDs
- A list of the UMQ message IDs of the messages desired.asyncOpCb
- Object implementing the LBMAsyncOperationCallback interface that will receive updates and results for the asynchronous operation.
LBMException
- if queue, asyncObCb, or messageIDs parameters are invalid, or if an error occurs.public void queueMessageRetrieve(java.lang.String queue, java.util.List<UMQMessageId> messageIDs, LBMAsyncOperationCallback asyncOpCb, java.lang.Object cbArg) throws LBMException
queue
- Name of the queue to retrieve the messages from.messageIDs
- A list of the UMQ message IDs of the messages desired.asyncOpCb
- Object implementing the LBMAsyncOperationCallback interface that will receive updates and results for the asynchronous operation.cbArg
- User-supplied callback object which will be passed back when asyncOpCb's onAsyncOperation method is called.
LBMException
- if queue, asyncObCb, or messageIDs parameters are invalid, or if an error occurs.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |