com.latencybusters.lbm
Class LBMContext

java.lang.Object
  extended by java.util.Dictionary<K,V>
      extended by java.util.Hashtable<java.lang.Object,java.lang.Object>
          extended by java.util.Properties
              extended by com.latencybusters.lbm.LBMContext
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.util.Map<java.lang.Object,java.lang.Object>

public class LBMContext
extends java.util.Properties

Creates an LBM context. This creates an instance of the LBM main processing element, an LBM context. Sources and Receivers are created from an LBM context and work within that context. For the Embedded operational mode, a thread is spawned to handle message processing.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class java.util.Properties
defaults
 
Constructor Summary
LBMContext()
          Instantiate an LBMContext object using default attributes.
LBMContext(LBMContextAttributes lbmcattr)
          Instantiate an LBMContext object using given attributes.
 
Method Summary
 void addImmediateMessageReceiver(LBMImmediateMessageCallback cb)
          Register a callback for handling of non-topic immediate messages
 void addImmediateMessageReceiver(LBMImmediateMessageCallback cb, java.lang.Object cbArg)
          Register a callback (and callback token) for handling of non-topic immediate messages
 void addSourceNotifyCallback(LBMSourceNotification cb)
          Register a callback interface (and a callback handle argument) to be called when a new source is seen for any topic.
 void addSourceNotifyCallback(LBMSourceNotification cb, java.lang.Object cbArg)
          Register a callback interface (and a callback handle argument) to be called when a new source is seen for any topic.
 LBMTopic allocTopic(java.lang.String symbol)
          Create an LBMTopic object (useable for an LBM source) for given topic name and attributes.
 LBMTopic allocTopic(java.lang.String symbol, LBMSourceAttributes lbmsattr)
          Create an LBMTopic object (useable for an LBM source) for given topic name and attributes.
 void close()
          Close this context.
 LBMHotFailoverReceiver createHotFailoverReceiver(LBMTopic lbmtopic)
          Deprecated. After LBM 4.0, use createHotFailoverReceiver(LBMTopic,LBMReceiverCallback,Object)
 LBMHotFailoverReceiver createHotFailoverReceiver(LBMTopic lbmtopic, LBMEventQueue lbmevq)
          Deprecated. After LBM 4.0, use createHotFailoverReceiver(LBMTopic,LBMReceiverCallback,Object,LBMEventQueue)
 LBMHotFailoverReceiver createHotFailoverReceiver(LBMTopic lbmtopic, LBMReceiverCallback cb, java.lang.Object cbArg)
          Create an LBM Hot-Failover Receiver object associated with this context and a given topic.
 LBMHotFailoverReceiver createHotFailoverReceiver(LBMTopic lbmtopic, LBMReceiverCallback cb, java.lang.Object cbArg, LBMEventQueue lbmevq)
          Create an LBM Hot-Failover Receiver object associated with this context and a given topic and event queue.
 LBMHotFailoverSource createHotFailoverSource(LBMTopic lbmtopic)
          Create an LBM Hot-Failover Source object associated with this context and a given topic.
 LBMHotFailoverSource createHotFailoverSource(LBMTopic lbmtopic, LBMEventQueue lbmevq)
          Create an LBM Hot-Failover Source object associated with this context and a given topic and event queue.
 LBMHotFailoverSource createHotFailoverSource(LBMTopic lbmtopic, LBMSourceEventCallback cb, java.lang.Object cbArg)
          Create an LBM Hot-Failover Source object associated with this context and a given topic.
 LBMHotFailoverSource createHotFailoverSource(LBMTopic lbmtopic, LBMSourceEventCallback cb, java.lang.Object cbArg, LBMEventQueue lbmevq)
          Create an LBM Hot-Failover Source object associated with this context and a given topic and event queue.
 LBMReceiver createReceiver(LBMTopic lbmtopic)
          Deprecated. After LBM 4.0, use createReceiver(LBMTopic,LBMReceiverCallback,Object)
 LBMReceiver createReceiver(LBMTopic lbmtopic, LBMEventQueue lbmevq)
          Deprecated. After LBM 4.0, use createReceiver(LBMTopic,LBMReceiverCallback,Object,LBMEventQueue)
 LBMReceiver createReceiver(LBMTopic lbmtopic, LBMReceiverCallback cb, java.lang.Object cbArg)
          Create an LBM Receiver object associated with this context and a given topic.
 LBMReceiver createReceiver(LBMTopic lbmtopic, LBMReceiverCallback cb, java.lang.Object cbArg, LBMEventQueue lbmevq)
          Create an LBM Receiver object associated with this context and a given topic and event queue.
 LBMSource createSource(LBMTopic lbmtopic)
          Create an LBM Source object associated with this context and a given topic.
 LBMSource createSource(LBMTopic lbmtopic, LBMEventQueue lbmevq)
          Create an LBM Source object associated with this context and a given topic and event queue.
 LBMSource createSource(LBMTopic lbmtopic, LBMSourceEventCallback cb, java.lang.Object cbArg)
          Create an LBM Source object associated with this context and a given topic.
 LBMSource createSource(LBMTopic lbmtopic, LBMSourceEventCallback cb, java.lang.Object cbArg, LBMEventQueue lbmevq)
          Create an LBM Source object associated with this context and a given topic and event queue.
 LBMTimer createTimer(long milliseconds)
          Create an LBM Timer object
 LBMTimer createTimer(long milliseconds, LBMEventQueue lbmevq)
          Creates a timer associated with this context and a specified event queue that expires with a specified delay.
 LBMTimer createTimer(long milliseconds, LBMTimerCallback cb, java.lang.Object cbArg)
          Creates a timer associated with this context that expires with a specified delay.
 LBMTimer createTimer(long milliseconds, LBMTimerCallback cb, java.lang.Object cbArg, LBMEventQueue lbmevq)
          Creates a timer associated with this context and a specified event queue that expires with a specified delay.
 LBMConfigOption[] dumpAttributeList()
          Returns an array of LBMConfigOptions.
 void enableImmediateMessageReceiver()
          Enable LBM to receive non-topic immediate messages.
 void enableImmediateMessageReceiver(LBMEventQueue lbmevq)
          Enable LBM to receive non-topic immediate messages (using an event queue).
protected  void finalize()
           
 java.lang.String getAttributeValue(java.lang.String attributeName)
          Returns the value of a context-related attribute for this context.
 LBMImmediateMessageReceiverStatistics getImmediateMessageReceiverStatistics(int maxStats)
          Return the immediate message receiver transport statistics for this context.
 LBMImmediateMessageSourceStatistics getImmediateMessageSourceStatistics(int maxStats)
          Return the immediate message source transport statistics for this context.
 LBMReceiverStatistics getReceiverStatistics(int maxStats)
          Return the aggregate set of receiver transport statistics for this context.
 LBMSourceStatistics getSourceStatistics(int maxStats)
          Return the aggregate set of source transport statistics for this context.
 LBMContextStatistics getStatistics()
          Return the current set of statistics for this context.
 int getUMQInflight(java.lang.String queue)
          Get the current UMQ inflight value for this context
 void load(java.io.InputStream inStream)
          Reads a property (attribute) list (key and element pairs) from the input stream.
 LBMTopic lookupTopic(java.lang.String symbol)
          Create an LBMTopic object (useable for an LBM receiver) for a given topic name.
 LBMTopic lookupTopic(java.lang.String symbol, LBMReceiverAttributes lbmrattr)
          Create an LBMTopic object (useable for an LBM receiver) for given topic name and attributes.
 void processEvents(long msec)
          Process internal events in the given LBM context object.
 void queueTopicList(java.lang.String queue, LBMAsyncOperationCallback asyncOpCb)
          Retrieves a list of currently available topics from a queue (asynchronous operation)
 void queueTopicList(java.lang.String queue, LBMAsyncOperationCallback asyncOpCb, java.lang.Object cbArg)
          Retrieves a list of currently available topics from a queue (asynchronous operation)
 void removeImmediateMessageReceiver(LBMImmediateMessageCallback cb)
          Deregister a non-topic, immediate message callback
 void removeImmediateMessageReceiver(LBMImmediateMessageCallback cb, java.lang.Object cbArg)
          Deregister a non-topic immediate message callback (and callback token)
 void removeSourceNotifyCallback(LBMSourceNotification cb)
          Deregister a source notification callback
 void removeSourceNotifyCallback(LBMSourceNotification cb, java.lang.Object cbArg)
          Deregister a source notification callback
 void requestTopicResolution(short flags, long interval_msec, long duration_sec)
          Request Topic Advertisements (sources), Topic Queries (receivers), and/or Wildcard Topic Queries (wildcard receivers) in the configured topic resolution address domain.
 void resetImmediateMessageReceiverStatistics()
          Reset the immediate message receiver transport statistics for this context.
 void resetImmediateMessageSourceStatistics()
          Reset the immediate message source transport statistics for this context.
 void resetReceiverStatistics()
          Reset the transport statistics for all receivers in this context.
 void resetSourceStatistics()
          Reset the transport statistics for all sources in this context.
 void resetStatistics()
          Reset the context statistics for this instance.
 LBMTimer scheduleTimer(long milliseconds)
          Creates a timer associated with this context that expires with the specified delay, and maintains a reference to it within the context.
 LBMTimer scheduleTimer(long milliseconds, LBMEventQueue lbmevq)
          Creates a timer associated with this context that expires with the specified delay, associated with the specified event queue, and maintains a reference to it within the context.
 LBMTimer scheduleTimer(long milliseconds, LBMTimerCallback cb, java.lang.Object cbArg)
          Creates a timer associated with this context that expires with a specified delay, and maintains a reference to it within the context.
 LBMTimer scheduleTimer(long milliseconds, LBMTimerCallback cb, java.lang.Object cbArg, LBMEventQueue lbmevq)
          Creates a timer associated with this context and a specified event queue that expires with a specified delay, and maintains a reference to it within the context.
 void send(java.lang.String topic, byte[] data, int dataLength, int flags)
          Send a multicast immediate message to a specific topic.
 LBMRequest send(java.lang.String topic, byte[] data, int dataLength, LBMResponseCallback cb, java.lang.Object cbArg, int flags)
          Send a multicast immediate request to a specific topic
 LBMRequest send(java.lang.String topic, byte[] data, int dataLength, LBMResponseCallback cb, java.lang.Object cbArg, LBMEventQueue lbmevq, int flags)
          Send a multicast immediate request to a specific topic (specifying an Event Queue for processing of the response(s))
 void send(java.lang.String topic, LBMRequest lbmreq, int flags)
          Send a multicast immediate request to a specific topic.
 void send(java.lang.String topic, LBMRequest lbmreq, LBMEventQueue lbmevq, int flags)
          Send a multicast immediate request to a specific topic (specifying an Event Queue for processing of the response(s)).
 void send(java.lang.String target, java.lang.String topic, byte[] data, int dataLength, int flags)
          Send a unicast immediate message to a specific topic
 void send(java.lang.String queue, java.lang.String topic, byte[] data, int datalength, int flags, LBMSourceSendExInfo exinfo)
          Send an immediate message on a specific topic to a queue (UMQ only).
 LBMRequest send(java.lang.String target, java.lang.String topic, byte[] data, int dataLength, LBMResponseCallback cb, java.lang.Object cbArg, int flags)
          Send a unicast immediate request to a specific topic
 LBMRequest send(java.lang.String target, java.lang.String topic, byte[] data, int dataLength, LBMResponseCallback cb, java.lang.Object cbArg, LBMEventQueue lbmevq, int flags)
          Send a unicast immediate request to a specific topic (specifying an Event Queue for processing of the response(s))
 void send(java.lang.String target, java.lang.String topic, LBMRequest lbmreq, int flags)
          Send a unicast immediate request to a specific topic.
 void send(java.lang.String target, java.lang.String topic, LBMRequest lbmreq, LBMEventQueue lbmevq, int flags)
          Send a unicast immediate request to a specific topic (specifying an Event Queue for processing of the response(s)).
 void sendc(char[] topic, byte[] data, int dataLength, int flags)
          Send a multicast immediate message to a specific topic.
 void sendc(char[] target, char[] topic, byte[] data, int dataLength, int flags)
          Send a unicast immediate message to a specific topic
 void sendTopicless(byte[] data, int dataLength, int flags)
          Send a topicless multicast immediate message.
 void sendTopicless(char[] target, byte[] data, int dataLength, int flags)
          Send a topicless unicast immediate message.
 void sendTopicless(java.lang.String target, byte[] data, int dataLength, int flags)
          Send a topicless unicast immediate message.
 void setAttributeValue(java.lang.String attributeName, java.lang.String attributeValue)
          Set the value of a context-related attribute for this context.
 void setAuthCredentials(LBMAuthUserInfo userInfo, LBMAuthCredentialsCallback authCallback, java.lang.Object cbArg)
          Sets the initial authentication credentials for this context as well as a callback to call if for new credentials if authentication fails.
 java.lang.Object setProperty(java.lang.String attributeName, java.lang.String attributeValue)
          Set the current value of an attribute in this set of context attributes.
 int setUMQInflight(java.lang.String queue, LBMSetInflightCallback setInflightCb, java.lang.Object clientd)
          Set the current UMQ inflight value for this context.
 void setUMQMessageStable(java.lang.String queue, UMQMessageId msg_id)
          Mark a specific msg_id as stable, triggering an event if configured to do so, and adjusting the inflight if necessary.
protected  int sourceNotification(java.lang.String topic, java.lang.String source)
          Default source notification callback.
 void unblockProcessEvents()
          Unblock processEvents call.
 
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

LBMContext

public LBMContext()
           throws LBMException
Instantiate an LBMContext object using default attributes.

Throws:
LBMException - if any error occurs creating the context.

LBMContext

public LBMContext(LBMContextAttributes lbmcattr)
           throws LBMException
Instantiate an LBMContext object using given attributes.

Parameters:
lbmcattr - LBMContextAttributes used to initialize the context
Throws:
LBMException - if any error occurs creating the context.
Method Detail

finalize

protected void finalize()
Overrides:
finalize in class java.lang.Object

setAuthCredentials

public void setAuthCredentials(LBMAuthUserInfo userInfo,
                               LBMAuthCredentialsCallback authCallback,
                               java.lang.Object cbArg)
                        throws LBMException
Sets the initial authentication credentials for this context as well as a callback to call if for new credentials if authentication fails.

Parameters:
userInfo - Initial user credentials.
authCallback - Callback that will be called to obtain different user credentials if authentication fails. Can be null, in which case the same credentials as originally given will be tried each time.
cbArg - User-supplied callback object.
Throws:
LBMException - if setting credentials or the callback fails.

close

public void close()
Close this context.

Warning: It is not safe to close() from a context thread callback.


dumpAttributeList

public LBMConfigOption[] dumpAttributeList()
Returns an array of LBMConfigOptions.

Returns:
Array of LBMConfigOption

getAttributeValue

public java.lang.String getAttributeValue(java.lang.String attributeName)
                                   throws LBMException
Returns the value of a context-related attribute for this context.

Parameters:
attributeName - Name of the attribute to retrieve
Returns:
Value corresponding to the specified attribute name
Throws:
LBMException - if attributeName is not a valid attribute.

setAttributeValue

public void setAttributeValue(java.lang.String attributeName,
                              java.lang.String attributeValue)
                       throws LBMException
Set the value of a context-related attribute for this context. 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
Throws:
LBMException - if attributeName is not a valid attribute, or attributeValue is not a valid value for attributeName.
See Also:
setProperty(java.lang.String, java.lang.String)

setProperty

public java.lang.Object setProperty(java.lang.String attributeName,
                                    java.lang.String attributeValue)
Set the current value of an attribute in this set of context attributes.

Overrides:
setProperty in class java.util.Properties
Parameters:
attributeName - Name of the attribute to set
attributeValue - New attribute value
Returns:
an Object.
Throws:
LBMRuntimeException - if attributeName is not a valid attribute, or attributeValue is not a valid value for attributeName.

load

public void load(java.io.InputStream inStream)
          throws java.io.IOException
Reads a property (attribute) list (key and element pairs) from the input stream.

Overrides:
load in class java.util.Properties
Parameters:
inStream - Input stream of bytes
Throws:
java.io.IOException - if any I/O error occurs.
LBMRuntimeException - if any invalid attribute is detected in inStream.

processEvents

public void processEvents(long msec)
                   throws LBMException
Process internal events in the given LBM context object. When the operational mode is set to "sequential", it is the responsibility of the application to explicitly process events for the LBM context. This method will process timers and file descriptor/socket events for internal processing as well as API timer and file descriptor/socket events.

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

Parameters:
msec - Continue event processing loop for at least msec milliseconds before returning.
Throws:
LBMException - if any error occurs.

unblockProcessEvents

public void unblockProcessEvents()
                          throws LBMException
Unblock processEvents call. When the operational mode is set to "sequential", this API forces a call to processEvents to return immediately after completing the current set of I/O operations instead of waiting.

Throws:
LBMException - if any error occurs.

lookupTopic

public LBMTopic lookupTopic(java.lang.String symbol)
                     throws LBMException
Create an LBMTopic object (useable for an LBM receiver) for a given topic name.

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

Parameters:
symbol - Topic name string. Topic strings should be limited in length to 246 characters (not including the final null).
Returns:
LBMTopic object for specified topic name
Throws:
LBMException - if any error occurs looking up the topic.

lookupTopic

public LBMTopic lookupTopic(java.lang.String symbol,
                            LBMReceiverAttributes lbmrattr)
                     throws LBMException
Create an LBMTopic object (useable for an LBM receiver) for given topic name and attributes.

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

Parameters:
symbol - Topic name string. Topic strings should be limited in length to 246 characters (not including the final null).
lbmrattr - LBMReceiverAttributes object
Returns:
LBMTopic object for specified topic name and attributes
Throws:
LBMException - if any error occurs looking up the topic.

allocTopic

public LBMTopic allocTopic(java.lang.String symbol)
                    throws LBMException
Create an LBMTopic object (useable for an LBM source) for given topic name and attributes.

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

Parameters:
symbol - Topic name string. Topic strings should be limited in length to 246 characters (not including the final null).
Returns:
LBMTopic object for specified topic name and attributes
Throws:
LBMException - if any error occurs allocating up the topic.

allocTopic

public LBMTopic allocTopic(java.lang.String symbol,
                           LBMSourceAttributes lbmsattr)
                    throws LBMException
Create an LBMTopic object (useable for an LBM source) for given topic name and attributes.

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

Parameters:
symbol - Topic name string. Topic strings should be limited in length to 246 characters (not including the final null).
lbmsattr - LBMSourceAttributes object
Returns:
LBMTopic object for specified topic name and attributes
Throws:
LBMException - if any error occurs allocating up the topic.

enableImmediateMessageReceiver

public void enableImmediateMessageReceiver()
                                    throws LBMException
Enable LBM to receive non-topic immediate messages. This method does not establish a callback handler.

Throws:
LBMException - if any error occurs enabling an immediate message receiver.
See Also:
addImmediateMessageReceiver(com.latencybusters.lbm.LBMImmediateMessageCallback)

enableImmediateMessageReceiver

public void enableImmediateMessageReceiver(LBMEventQueue lbmevq)
                                    throws LBMException
Enable LBM to receive non-topic immediate messages (using an event queue). This method does not establish a callback handler.

Parameters:
lbmevq - LBMEventQueue on which to process responses (may be null if not using an event queue)
Throws:
LBMException - if any error occurs enabling an immediate message receiver.
See Also:
addImmediateMessageReceiver(com.latencybusters.lbm.LBMImmediateMessageCallback)

addImmediateMessageReceiver

public void addImmediateMessageReceiver(LBMImmediateMessageCallback cb)
Register a callback for handling of non-topic immediate messages

Parameters:
cb - Object implementing the LBMImmediateMessageCallback interface
See Also:
enableImmediateMessageReceiver(), removeImmediateMessageReceiver(com.latencybusters.lbm.LBMImmediateMessageCallback), LBMImmediateMessageCallback

addImmediateMessageReceiver

public void addImmediateMessageReceiver(LBMImmediateMessageCallback cb,
                                        java.lang.Object cbArg)
Register a callback (and callback token) for handling of non-topic immediate messages

Parameters:
cb - Object implementing the LBMImmediateMessageCallback interface
cbArg - Callback token object
See Also:
enableImmediateMessageReceiver(), removeImmediateMessageReceiver(com.latencybusters.lbm.LBMImmediateMessageCallback), LBMImmediateMessageCallback

removeImmediateMessageReceiver

public void removeImmediateMessageReceiver(LBMImmediateMessageCallback cb)
Deregister a non-topic, immediate message callback

Parameters:
cb - Object implementing the LBMImmediateMessageCallback interface
See Also:
enableImmediateMessageReceiver(), addImmediateMessageReceiver(com.latencybusters.lbm.LBMImmediateMessageCallback), LBMImmediateMessageCallback

removeImmediateMessageReceiver

public void removeImmediateMessageReceiver(LBMImmediateMessageCallback cb,
                                           java.lang.Object cbArg)
Deregister a non-topic immediate message callback (and callback token)

Parameters:
cb - Previously registered object implementing the LBMImmediateMessageCallback interface
cbArg - Callback token for previously registered object
See Also:
enableImmediateMessageReceiver(), addImmediateMessageReceiver(com.latencybusters.lbm.LBMImmediateMessageCallback), LBMImmediateMessageCallback

send

public void send(java.lang.String target,
                 java.lang.String topic,
                 byte[] data,
                 int dataLength,
                 int flags)
          throws LBMException
Send a unicast immediate message to a specific topic

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

Parameters:
target - Target address of the receiver of the form "TCP:ip:port"
topic - Topic name to send message to or null for non-topic
data - Data to send in this message
dataLength - Length (in bytes) of the data to send in this message
flags - Flags indicating various conditions. See next section for possible OR'd set of values.
Throws:
LBMException - if any error occurs sending the immediate message.
See Also:
LBM.SRC_NONBLOCK, LBM.SRC_BLOCK

sendTopicless

public void sendTopicless(java.lang.String target,
                          byte[] data,
                          int dataLength,
                          int flags)
                   throws LBMException
Send a topicless unicast immediate message.

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

Parameters:
target - Target address of the receiver of the form "TCP:ip:port"
data - Data to send in this message
dataLength - Length (in bytes) of the data to send in this message
flags - Flags indicating various conditions. See next section for possible OR'd set of values.
Throws:
LBMException - if any error occurs sending the immediate message.
See Also:
LBM.SRC_NONBLOCK, LBM.SRC_BLOCK

sendc

public void sendc(char[] target,
                  char[] topic,
                  byte[] data,
                  int dataLength,
                  int flags)
           throws LBMException
Send a unicast immediate message to a specific topic

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

Parameters:
target - Target address of the receiver of the form "TCP:ip:port"
topic - Topic name to send message to or null for non-topic
data - Data to send in this message
dataLength - Length (in bytes) of the data to send in this message
flags - Flags indicating various conditions. See next section for possible OR'd set of values.
Throws:
LBMException - if any error occurs sending the immediate message.
See Also:
LBM.SRC_NONBLOCK, LBM.SRC_BLOCK

sendTopicless

public void sendTopicless(char[] target,
                          byte[] data,
                          int dataLength,
                          int flags)
                   throws LBMException
Send a topicless unicast immediate message.

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

Parameters:
target - Target address of the receiver of the form "TCP:ip:port"
data - Data to send in this message
dataLength - Length (in bytes) of the data to send in this message
flags - Flags indicating various conditions. See next section for possible OR'd set of values.
Throws:
LBMException - if any error occurs sending the immediate message.
See Also:
LBM.SRC_NONBLOCK, LBM.SRC_BLOCK

send

public LBMRequest send(java.lang.String target,
                       java.lang.String topic,
                       byte[] data,
                       int dataLength,
                       LBMResponseCallback cb,
                       java.lang.Object cbArg,
                       LBMEventQueue lbmevq,
                       int flags)
                throws LBMException
Send a unicast immediate request to a specific topic (specifying an Event Queue for processing of the response(s))

Parameters:
target - Target address of the receiver of the form "TCP:ip:port"
topic - Topic name to send message to or null for non-topic
data - Data to send in this request
dataLength - Length (in bytes) of the data to send in this request
cb - LBMResponseCallback interface to handle response callback
cbArg - Callback token object
lbmevq - LBMEventQueue on which to process responses (may be null if not using an event queue)
flags - Flags indicating various conditions. See next section for possible OR'd set of values.
Returns:
an LBMRequest object.
Throws:
LBMException - if any error occurs sending the immediate request.
See Also:
LBM.SRC_NONBLOCK, LBM.SRC_BLOCK

send

public LBMRequest send(java.lang.String target,
                       java.lang.String topic,
                       byte[] data,
                       int dataLength,
                       LBMResponseCallback cb,
                       java.lang.Object cbArg,
                       int flags)
                throws LBMException
Send a unicast immediate request to a specific topic

Parameters:
target - Target address of the receiver of the form "TCP:ip:port"
topic - Topic name to send message to or null for non-topic
data - Data to send in this request
dataLength - Length (in bytes) of the data to send in this request
cb - LBMResponseCallback interface to handle response callback
cbArg - Callback token object
flags - Flags indicating various conditions. See next section for possible OR'd set of values.
Returns:
an LBMRequest object.
Throws:
LBMException - if any error occurs sending the immediate request.
See Also:
LBM.SRC_NONBLOCK, LBM.SRC_BLOCK

send

public void send(java.lang.String target,
                 java.lang.String topic,
                 LBMRequest lbmreq,
                 LBMEventQueue lbmevq,
                 int flags)
          throws LBMException
Send a unicast immediate request to a specific topic (specifying an Event Queue for processing of the response(s)).

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

Parameters:
target - Target address of the receiver of the form "TCP:ip:port"
topic - Topic name to send message to or null for non-topic
lbmreq - LBMRequest object
lbmevq - LBMEventQueue on which to process responses (may be null if not using an event queue)
flags - Flags indicating various conditions. See next section for possible OR'd set of values.
Throws:
LBMException - if any error occurs sending the immediate request.
See Also:
LBM.SRC_NONBLOCK, LBM.SRC_BLOCK

send

public void send(java.lang.String target,
                 java.lang.String topic,
                 LBMRequest lbmreq,
                 int flags)
          throws LBMException
Send a unicast immediate request to a specific topic.

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

Parameters:
target - Target address of the receiver of the form "TCP:ip:port"
topic - Topic name to send message to or null for non-topic
lbmreq - LBMRequest object
flags - Flags indicating various conditions. See next section for possible OR'd set of values.
Throws:
LBMException - if any error occurs sending the immediate request.
See Also:
LBM.SRC_NONBLOCK, LBM.SRC_BLOCK

send

public void send(java.lang.String topic,
                 byte[] data,
                 int dataLength,
                 int flags)
          throws LBMException
Send a multicast immediate message to a specific topic.

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

Parameters:
topic - Topic name to send message to or null for non-topic
data - Data to send in this message
dataLength - Length (in bytes) of the data to send in this message
flags - Flags indicating various conditions. See next section for possible OR'd set of values.
Throws:
LBMException - if any error occurs sending the immediate message.
See Also:
LBM.SRC_NONBLOCK, LBM.SRC_BLOCK, LBM.MSG_FLUSH

sendc

public void sendc(char[] topic,
                  byte[] data,
                  int dataLength,
                  int flags)
           throws LBMException
Send a multicast immediate message to a specific topic.

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

Parameters:
topic - Topic name to send message to or null for non-topic
data - Data to send in this message
dataLength - Length (in bytes) of the data to send in this message
flags - Flags indicating various conditions. See next section for possible OR'd set of values.
Throws:
LBMException - if any error occurs sending the immediate message.
See Also:
LBM.SRC_NONBLOCK, LBM.SRC_BLOCK, LBM.MSG_FLUSH

sendTopicless

public void sendTopicless(byte[] data,
                          int dataLength,
                          int flags)
                   throws LBMException
Send a topicless multicast immediate message.

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

Parameters:
data - Data to send in this message
dataLength - Length (in bytes) of the data to send in this message
flags - Flags indicating various conditions. See next section for possible OR'd set of values.
Throws:
LBMException - if any error occurs sending the immediate message.
See Also:
LBM.SRC_NONBLOCK, LBM.SRC_BLOCK, LBM.MSG_FLUSH

send

public LBMRequest send(java.lang.String topic,
                       byte[] data,
                       int dataLength,
                       LBMResponseCallback cb,
                       java.lang.Object cbArg,
                       LBMEventQueue lbmevq,
                       int flags)
                throws LBMException
Send a multicast immediate request to a specific topic (specifying an Event Queue for processing of the response(s))

Parameters:
topic - Topic name to send message to or null for non-topic
data - Data to send in this request
dataLength - Length (in bytes) of the data to send in this request
cb - LBMResponseCallback interface to handle response callback
cbArg - Callback token object
lbmevq - LBMEventQueue on which to process responses (may be null if not using an event queue)
flags - Flags indicating various conditions. See next section for possible OR'd set of values.
Returns:
an LBMRequest object.
Throws:
LBMException - if any error occurs sending the immediate request.
See Also:
LBM.SRC_NONBLOCK, LBM.SRC_BLOCK, LBM.MSG_FLUSH

send

public LBMRequest send(java.lang.String topic,
                       byte[] data,
                       int dataLength,
                       LBMResponseCallback cb,
                       java.lang.Object cbArg,
                       int flags)
                throws LBMException
Send a multicast immediate request to a specific topic

Parameters:
topic - Topic name to send message to or null for non-topic
data - Data to send in this request
dataLength - Length (in bytes) of the data to send in this request
cb - LBMResponseCallback interface to handle response callback
cbArg - Callback token object
flags - Flags indicating various conditions. See next section for possible OR'd set of values.
Returns:
an LBMRequest object.
Throws:
LBMException - if any error occurs sending the immediate request.
See Also:
LBM.SRC_NONBLOCK, LBM.SRC_BLOCK, LBM.MSG_FLUSH

send

public void send(java.lang.String topic,
                 LBMRequest lbmreq,
                 LBMEventQueue lbmevq,
                 int flags)
          throws LBMException
Send a multicast immediate request to a specific topic (specifying an Event Queue for processing of the response(s)).

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

Parameters:
topic - Topic name to send message to or null for non-topic
lbmreq - LBMRequest object
lbmevq - LBMEventQueue on which to process responses (may be null if not using an event queue)
flags - Flags indicating various conditions. See next section for possible OR'd set of values.
Throws:
LBMException - if any error occurs sending the immediate request.
See Also:
LBM.SRC_NONBLOCK, LBM.SRC_BLOCK, LBM.MSG_FLUSH

send

public void send(java.lang.String topic,
                 LBMRequest lbmreq,
                 int flags)
          throws LBMException
Send a multicast immediate request to a specific topic.

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

Parameters:
topic - Topic name to send message to or null for non-topic
lbmreq - LBMRequest object
flags - Flags indicating various conditions. See next section for possible OR'd set of values.
Throws:
LBMException - if any error occurs sending the immediate request.
See Also:
LBM.SRC_NONBLOCK, LBM.SRC_BLOCK, LBM.MSG_FLUSH

send

public void send(java.lang.String queue,
                 java.lang.String topic,
                 byte[] data,
                 int datalength,
                 int flags,
                 LBMSourceSendExInfo exinfo)
          throws LBMException
Send an immediate message on a specific topic to a queue (UMQ only).

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

Parameters:
queue - Queue to submit message to
topic - Topic name to send message to or null for non-topic
data - Data to send in this message.
dataLength - Length (in bytes) of the data to send in this message.
flags - Flags indicating various conditions. See next section for possible OR'd set of values.
exinfo - LBMSourceSendExInfo object; used to set callback behavior flags and pass back a user-supplied object.
Throws:
LBMException - if any error occurs sending the immediate request.
Since:
UME 3.0
See Also:
LBM.SRC_NONBLOCK, LBM.SRC_BLOCK, LBM.MSG_FLUSH, LBMSourceSendExInfo

getStatistics

public LBMContextStatistics getStatistics()
                                   throws LBMException
Return the current set of statistics for this context.

Returns:
LBMContextStatistics object containing the statistics corresponding to this context.
Throws:
LBMException - if any error occurred retrieving context statistics.

resetStatistics

public void resetStatistics()
                     throws LBMException
Reset the context statistics for this instance.

Throws:
LBMException - if any error occurred during resetting of statistics.

getSourceStatistics

public LBMSourceStatistics getSourceStatistics(int maxStats)
                                        throws LBMException
Return the aggregate set of source transport statistics for this context.

Parameters:
maxStats - Maximum number of sources.
Returns:
LBMSourceStatistics object containing the statistics corresponding to the specified number of sources.
Throws:
LBMException - if any error occurred retrieving source transport statistics.

resetSourceStatistics

public void resetSourceStatistics()
                           throws LBMException
Reset the transport statistics for all sources in this context.

Throws:
LBMException - if any error occurred resetting source transport statistics.

getReceiverStatistics

public LBMReceiverStatistics getReceiverStatistics(int maxStats)
                                            throws LBMException
Return the aggregate set of receiver transport statistics for this context.

Parameters:
maxStats - Maximum number of receivers.
Returns:
LBMReceiverStatistics object containing the statistics corresponding to the specified number of receivers.
Throws:
LBMException - if any error occurred retrieving receiver transport statistics.

resetReceiverStatistics

public void resetReceiverStatistics()
                             throws LBMException
Reset the transport statistics for all receivers in this context.

Throws:
LBMException - if any error occurred resetting receiver transport statistics.

getImmediateMessageSourceStatistics

public LBMImmediateMessageSourceStatistics getImmediateMessageSourceStatistics(int maxStats)
                                                                        throws LBMException
Return the immediate message source transport statistics for this context.

Parameters:
maxStats - Maximum number of sources.
Returns:
LBMImmediateMessageSourceStatistics object containing the statistics corresponding to this context.
Throws:
LBMException - if any error occurred retrieving source transport statistics.

resetImmediateMessageSourceStatistics

public void resetImmediateMessageSourceStatistics()
                                           throws LBMException
Reset the immediate message source transport statistics for this context.

Throws:
LBMException - if any error occurred resetting source transport statistics.

getImmediateMessageReceiverStatistics

public LBMImmediateMessageReceiverStatistics getImmediateMessageReceiverStatistics(int maxStats)
                                                                            throws LBMException
Return the immediate message receiver transport statistics for this context.

Parameters:
maxStats - Maximum number of receivers.
Returns:
LBMImmediateMessageReceiverStatistics object containing the statistics corresponding to this context.
Throws:
LBMException - if any error occurred retrieving receiver transport statistics.

resetImmediateMessageReceiverStatistics

public void resetImmediateMessageReceiverStatistics()
                                             throws LBMException
Reset the immediate message receiver transport statistics for this context.

Throws:
LBMException - if any error occurred resetting receiver transport statistics.

createTimer

public LBMTimer createTimer(long milliseconds)
                     throws LBMException
Create an LBM Timer object

Parameters:
milliseconds - Number of milliseconds until the timer expires
Returns:
LBMTimer object
Throws:
LBMException - if any error occurs creating the timer.

createTimer

public LBMTimer createTimer(long milliseconds,
                            LBMEventQueue lbmevq)
                     throws LBMException
Creates a timer associated with this context and a specified event queue that expires with a specified delay.

Parameters:
milliseconds - Number of milliseconds until the timer expires
lbmevq - Event queue with with which to associate this timer (the timer events will be posted to this event queue)
Returns:
LBMTimer object
Throws:
LBMException - if any error occurs creating the timer.

createTimer

public LBMTimer createTimer(long milliseconds,
                            LBMTimerCallback cb,
                            java.lang.Object cbArg)
                     throws LBMException
Creates a timer associated with this context that expires with a specified delay.

Parameters:
milliseconds - Number of milliseconds until the timer expires
cb - An object implementing the LBMTimerCallback interface
cbArg - Callback object passed as token to callback interface
Returns:
LBMTimer object
Throws:
LBMException - if any error occurs creating the timer.

createTimer

public LBMTimer createTimer(long milliseconds,
                            LBMTimerCallback cb,
                            java.lang.Object cbArg,
                            LBMEventQueue lbmevq)
                     throws LBMException
Creates a timer associated with this context and a specified event queue that expires with a specified delay.

Parameters:
milliseconds - Number of milliseconds until the timer expires
lbmevq - Event queue with which to associate this timer
cb - An object implementing the LBMTimerCallback interface
cbArg - Callback object passed as token to callback interface (the timer events will be posted to this event queue)
Returns:
LBMTimer object
Throws:
LBMException - if any error occurs creating the timer.

scheduleTimer

public LBMTimer scheduleTimer(long milliseconds)
                       throws LBMException
Creates a timer associated with this context that expires with the specified delay, and maintains a reference to it within the context.

Parameters:
milliseconds - Number of milliseconds until the timer expires
Returns:
LBMTimer object
Throws:
LBMException - if any error occurs creating the timer.

scheduleTimer

public LBMTimer scheduleTimer(long milliseconds,
                              LBMEventQueue lbmevq)
                       throws LBMException
Creates a timer associated with this context that expires with the specified delay, associated with the specified event queue, and maintains a reference to it within the context.

Parameters:
milliseconds - Number of milliseconds until the timer expires
lbmevq - Event queue with with which to associate this timer (the timer events will be posted to this event queue)
Returns:
LBMTimer object
Throws:
LBMException - if any error occurs creating the timer.

scheduleTimer

public LBMTimer scheduleTimer(long milliseconds,
                              LBMTimerCallback cb,
                              java.lang.Object cbArg)
                       throws LBMException
Creates a timer associated with this context that expires with a specified delay, and maintains a reference to it within the context.

Parameters:
milliseconds - Number of milliseconds until the timer expires
cb - An object implementing the LBMTimerCallback interface
cbArg - Callback object passed as token to callback interface
Returns:
LBMTimer object
Throws:
LBMException - if any error occurs creating the timer.

scheduleTimer

public LBMTimer scheduleTimer(long milliseconds,
                              LBMTimerCallback cb,
                              java.lang.Object cbArg,
                              LBMEventQueue lbmevq)
                       throws LBMException
Creates a timer associated with this context and a specified event queue that expires with a specified delay, and maintains a reference to it within the context.

Parameters:
milliseconds - Number of milliseconds until the timer expires
lbmevq - Event queue with which to associate this timer
cb - An object implementing the LBMTimerCallback interface
cbArg - Callback object passed as token to callback interface (the timer events will be posted to this event queue)
Returns:
LBMTimer object
Throws:
LBMException - if any error occurs creating the timer.

createSource

public LBMSource createSource(LBMTopic lbmtopic)
                       throws LBMException
Create an LBM Source object associated with this context and a given topic.

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

Parameters:
lbmtopic - LBMTopic used to initialize the source.
Returns:
LBMSource object
Throws:
LBMException - if any error occurs creating the source.

createSource

public LBMSource createSource(LBMTopic lbmtopic,
                              LBMSourceEventCallback cb,
                              java.lang.Object cbArg)
                       throws LBMException
Create an LBM Source object associated with this context and a given topic.

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

Parameters:
lbmtopic - LBMTopic used to initialize the source.
cb - An object implementing the LBMSourceEventCallback interface
cbArg - Callback token object
Returns:
LBMSource object
Throws:
LBMException - if any error occurs creating the source.

createSource

public LBMSource createSource(LBMTopic lbmtopic,
                              LBMEventQueue lbmevq)
                       throws LBMException
Create an LBM Source object associated with this context and a given topic and event queue.

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

Parameters:
lbmtopic - LBMTopic used to initialize the source.
lbmevq - Event queue with which to associate the source (all source events will be posted to this event queue).
Returns:
LBMSource object
Throws:
LBMException - if any error occurs creating the source.

createSource

public LBMSource createSource(LBMTopic lbmtopic,
                              LBMSourceEventCallback cb,
                              java.lang.Object cbArg,
                              LBMEventQueue lbmevq)
                       throws LBMException
Create an LBM Source object associated with this context and a given topic and event queue.

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

Parameters:
lbmtopic - LBMTopic used to initialize the source.
cb - An object implementing the LBMSourceEventCallback interface
cbArg - Callback token object
lbmevq - Event queue with which to associate the source (all source events will be posted to this event queue).
Returns:
LBMSource object
Throws:
LBMException - if any error occurs creating the source.

createHotFailoverSource

public LBMHotFailoverSource createHotFailoverSource(LBMTopic lbmtopic)
                                             throws LBMException
Create an LBM Hot-Failover Source object associated with this context and a given topic.

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

Parameters:
lbmtopic - LBMTopic used to initialize the source.
Returns:
LBMHotFailoverSource object
Throws:
LBMException - if any error occurs creating the hot failover source.

createHotFailoverSource

public LBMHotFailoverSource createHotFailoverSource(LBMTopic lbmtopic,
                                                    LBMSourceEventCallback cb,
                                                    java.lang.Object cbArg)
                                             throws LBMException
Create an LBM Hot-Failover Source object associated with this context and a given topic.

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

Parameters:
lbmtopic - LBMTopic used to initialize the source.
cb - An object implementing the LBMSourceEventCallback interface
cbArg - Callback token object
Returns:
LBMHotFailoverSource object
Throws:
LBMException - if any error occurs creating the hot failover source.

createHotFailoverSource

public LBMHotFailoverSource createHotFailoverSource(LBMTopic lbmtopic,
                                                    LBMEventQueue lbmevq)
                                             throws LBMException
Create an LBM Hot-Failover Source object associated with this context and a given topic and event queue.

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

Parameters:
lbmtopic - LBMTopic used to initialize the source.
lbmevq - Event queue with which to associate the source (all source events will be posted to this event queue).
Returns:
LBMHotFailoverSource object
Throws:
LBMException - if any error occurs creating the hot failover source.

createHotFailoverSource

public LBMHotFailoverSource createHotFailoverSource(LBMTopic lbmtopic,
                                                    LBMSourceEventCallback cb,
                                                    java.lang.Object cbArg,
                                                    LBMEventQueue lbmevq)
                                             throws LBMException
Create an LBM Hot-Failover Source object associated with this context and a given topic and event queue.

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

Parameters:
lbmtopic - LBMTopic used to initialize the source.
cb - An object implementing the LBMSourceEventCallback interface
cbArg - Callback token object
lbmevq - Event queue with which to associate the source (all source events will be posted to this event queue).
Returns:
LBMHotFailoverSource object
Throws:
LBMException - if any error occurs creating the hot failover source.

createReceiver

public LBMReceiver createReceiver(LBMTopic lbmtopic)
                           throws LBMException
Deprecated. After LBM 4.0, use createReceiver(LBMTopic,LBMReceiverCallback,Object)

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

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

Parameters:
lbmtopic - LBMTopic used to initialize the receiver.
Returns:
LBMReceiver object
Throws:
LBMException - if any error occurs creating the receiver.

createReceiver

public LBMReceiver createReceiver(LBMTopic lbmtopic,
                                  LBMEventQueue lbmevq)
                           throws LBMException
Deprecated. After LBM 4.0, use createReceiver(LBMTopic,LBMReceiverCallback,Object,LBMEventQueue)

Create an LBM Receiver object associated with this context and a given topic and event queue.

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

Parameters:
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).
Returns:
LBMReceiver object
Throws:
LBMException - if any error occurs creating the receiver.

createReceiver

public LBMReceiver createReceiver(LBMTopic lbmtopic,
                                  LBMReceiverCallback cb,
                                  java.lang.Object cbArg)
                           throws LBMException
Create an LBM Receiver object associated with this context and a given topic.

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

Parameters:
lbmtopic - LBMTopic used to initialize the receiver.
cb - An object implementing the LBMReceiverCallback interface
cbArg - Callback object passed as token to callback interface
Returns:
LBMReceiver object
Throws:
LBMException - if any error occurs creating the receiver.

createReceiver

public LBMReceiver createReceiver(LBMTopic lbmtopic,
                                  LBMReceiverCallback cb,
                                  java.lang.Object cbArg,
                                  LBMEventQueue lbmevq)
                           throws LBMException
Create an LBM Receiver object associated with this context and a given topic and event queue.

Parameters:
lbmtopic - LBMTopic used to initialize the receiver.
cb - An object implementing the LBMReceiverCallback interface
cbArg - Callback object passed as token to callback interface
lbmevq - Event queue with which to associate the receiver (all receiver events will be posted to this event queue).
Returns:
LBMReceiver object
Throws:
LBMException - if any error occurs creating the receiver.

createHotFailoverReceiver

public LBMHotFailoverReceiver createHotFailoverReceiver(LBMTopic lbmtopic)
                                                 throws LBMException
Deprecated. After LBM 4.0, use createHotFailoverReceiver(LBMTopic,LBMReceiverCallback,Object)

Create an LBM Hot-Failover Receiver object associated with this context and a given topic.

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

Parameters:
lbmtopic - LBMTopic used to initialize the receiver.
Returns:
LBMHotFailoverReceiver object
Throws:
LBMException - if any error occurs creating the hot failover receiver.

createHotFailoverReceiver

public LBMHotFailoverReceiver createHotFailoverReceiver(LBMTopic lbmtopic,
                                                        LBMEventQueue lbmevq)
                                                 throws LBMException
Deprecated. After LBM 4.0, use createHotFailoverReceiver(LBMTopic,LBMReceiverCallback,Object,LBMEventQueue)

Create an LBM Hot-Failover Receiver object associated with this context and a given topic and event queue.

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

Parameters:
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).
Returns:
LBMHotFailoverReceiver object
Throws:
LBMException - if any error occurs creating the hot failover receiver.

createHotFailoverReceiver

public LBMHotFailoverReceiver createHotFailoverReceiver(LBMTopic lbmtopic,
                                                        LBMReceiverCallback cb,
                                                        java.lang.Object cbArg)
                                                 throws LBMException
Create an LBM Hot-Failover Receiver object associated with this context and a given topic.

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

Parameters:
lbmtopic - LBMTopic used to initialize the receiver.
cb - An object implementing the LBMReceiverCallback interface
cbArg - Callback object passed as token to callback interface
Returns:
LBMHotFailoverReceiver object
Throws:
LBMException - if any error occurs creating the hot failover receiver.

createHotFailoverReceiver

public LBMHotFailoverReceiver createHotFailoverReceiver(LBMTopic lbmtopic,
                                                        LBMReceiverCallback cb,
                                                        java.lang.Object cbArg,
                                                        LBMEventQueue lbmevq)
                                                 throws LBMException
Create an LBM Hot-Failover Receiver object associated with this context and a given topic and event queue.

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

Parameters:
lbmtopic - LBMTopic used to initialize the receiver.
cb - An object implementing the LBMReceiverCallback interface
cbArg - Callback object passed as token to callback interface
lbmevq - Event queue with which to associate the receiver (all receiver events will be posted to this event queue).
Returns:
LBMHotFailoverReceiver object
Throws:
LBMException - if any error occurs creating the hot failover receiver.

addSourceNotifyCallback

public void addSourceNotifyCallback(LBMSourceNotification cb)
                             throws LBMException
Register a callback interface (and a callback handle argument) to be called when a new source is seen for any topic. This callback is called directly in line and does not use the event queue; therefore, the callback function used should not block or it will block the context thread processing. This facility is disabled by default and may be enabled by calling the LBMContextAttributes.enableSourceNotification() method prior to instantiation of LBMContext.

Parameters:
cb - An object implementing the LBMSourceNotification interface
Throws:
LBMException - if any error occurs.
See Also:
LBMSourceNotification, LBMContextAttributes.enableSourceNotification(), removeSourceNotifyCallback(com.latencybusters.lbm.LBMSourceNotification)

addSourceNotifyCallback

public void addSourceNotifyCallback(LBMSourceNotification cb,
                                    java.lang.Object cbArg)
                             throws LBMException
Register a callback interface (and a callback handle argument) to be called when a new source is seen for any topic. This callback is called directly in line and does not use the event queue; therefore, the callback function used should not block or it will block the context thread processing. This facility is disabled by default and may be enabled by calling the LBMContextAttributes.enableSourceNotification() method prior to instantiation of LBMContext.

Parameters:
cb - An object implementing the LBMSourceNotification interface
cbArg - Callback object passed as a token to the callback interface
Throws:
LBMException - if any error occurs.
See Also:
LBMSourceNotification, removeSourceNotifyCallback(com.latencybusters.lbm.LBMSourceNotification)

removeSourceNotifyCallback

public void removeSourceNotifyCallback(LBMSourceNotification cb)
Deregister a source notification callback

Parameters:
cb - Previously registered object implementing the LBMSourceNotification interface
See Also:
LBMSourceNotification, addSourceNotifyCallback(com.latencybusters.lbm.LBMSourceNotification)

removeSourceNotifyCallback

public void removeSourceNotifyCallback(LBMSourceNotification cb,
                                       java.lang.Object cbArg)
Deregister a source notification callback

Parameters:
cb - Previously registered object implementing the LBMSourceNotification interface
cbArg - Callback token for previously registered object
See Also:
LBMSourceNotification, addSourceNotifyCallback(com.latencybusters.lbm.LBMSourceNotification)

sourceNotification

protected int sourceNotification(java.lang.String topic,
                                 java.lang.String source)
Default source notification callback. This method is called when a new source is seen for any topic (when enabled). This callback is called directly in line and does not use an event queue; therefore, it should not block which would impact processing on the context processing thread.

Parameters:
topic - New topic string
source - String identifying the source for the new topic
Returns:
an int which is always 0.
See Also:
LBMContextAttributes.enableSourceNotification(), addSourceNotifyCallback(com.latencybusters.lbm.LBMSourceNotification), removeSourceNotifyCallback(com.latencybusters.lbm.LBMSourceNotification)

getUMQInflight

public int getUMQInflight(java.lang.String queue)
                   throws LBMException
Get the current UMQ inflight value for this context

Parameters:
queue - Name of the queue
Returns:
the inflight value
Throws:
LBMException - if an error occurs while retrieving the inflight value

setUMQInflight

public int setUMQInflight(java.lang.String queue,
                          LBMSetInflightCallback setInflightCb,
                          java.lang.Object clientd)
                   throws LBMException
Set the current UMQ inflight value for this context.

Parameters:
queue - Name of the queue
setInflightCb - Object that implements the LBMSetInflightCallback interface
clientd - Clientd object passed into the setInflight callback
Returns:
the new inflight value
Throws:
LBMException - if an error occurs while setting the inflight value

setUMQMessageStable

public void setUMQMessageStable(java.lang.String queue,
                                UMQMessageId msg_id)
                         throws LBMException
Mark a specific msg_id as stable, triggering an event if configured to do so, and adjusting the inflight if necessary.

Parameters:
queue - Name of the queue
msg_id - MessageId of the message to mark stable
Throws:
LBMException - if an error occurs while marking the message stable

requestTopicResolution

public void requestTopicResolution(short flags,
                                   long interval_msec,
                                   long duration_sec)
                            throws LBMException
Request Topic Advertisements (sources), Topic Queries (receivers), and/or Wildcard Topic Queries (wildcard receivers) in the configured topic resolution address domain. Since Advertisements and Queries can become quiescent after a period defined by the Topic Resolution configuration attributes, this function will schedule Topic Resolution Requests at the given interval and duration. Contexts that receive these requests will respond with one advertisement per source and/or one query per receiver as appropriate. These requests will be ignored for topics that are not quiescent. Note that requests are only sent on the outgoing address and are only received on the incoming address. Responses to the request will similarly be sent only on the outgoing address.

Parameters:
flags - Flags indicating desired requests. ORed set of values.
interval_msec - Interval between requests in milliseconds. Less than 10 should be used with caution. Less than 5 is not recommended.
duration_sec - Minimum duration of requests in seconds. Actual duration can be longer depending on the interval. A value of zero will result in 1 request and the interval will be meaningless.
Throws:
LBMException
See Also:
- Request advertisements from quiescent sources., - Request queries from quiescent receivers., - Request queries from quiescent wildcard receivers.

queueTopicList

public void queueTopicList(java.lang.String queue,
                           LBMAsyncOperationCallback asyncOpCb)
                    throws LBMException
Retrieves a list of currently available topics from a queue (asynchronous operation)

Parameters:
queue - Name of the queue to retrieve topic list from.
asyncOpCb - Object implementing the LBMAsyncOperationCallback interface that will receive updates and results for the asynchronous operation.
Throws:
LBMException - if queue or asyncObCb parameters are invalid, or if an error occurs.

queueTopicList

public void queueTopicList(java.lang.String queue,
                           LBMAsyncOperationCallback asyncOpCb,
                           java.lang.Object cbArg)
                    throws LBMException
Retrieves a list of currently available topics from a queue (asynchronous operation)

Parameters:
queue - Name of the queue to retrieve topic list 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.
Throws:
LBMException - if queue or asyncObCb parameters are invalid, or if an error occurs.


All of the documentation and software included in this and any other Informatica Inc "Ultra Messaging" Release is Copyright (C) 2004-2014, Informatica Corporation. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted only as covered by the terms of a valid software license agreement with 29West Inc. Copyright © 2004-2014, Informatica, Inc. All Rights Reserved.