|
|||||||||
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.LBMSource
public class LBMSource
LBM Source class.
Warning: It is not safe to instantiate this object from a context thread callback.
Field Summary |
---|
Fields inherited from class java.util.Properties |
---|
defaults |
Constructor Summary | |
---|---|
LBMSource(LBMContext lbmctx,
LBMTopic lbmtopic)
Instantiate an LBM Source object associated with a given context and topic. |
|
LBMSource(LBMContext lbmctx,
LBMTopic lbmtopic,
LBMEventQueue lbmevq)
Instantiate an LBM Source object associated with a given context, topic, and event queue. |
|
LBMSource(LBMContext lbmctx,
LBMTopic lbmtopic,
LBMSourceEventCallback cb,
java.lang.Object cbArg)
Instantiate an LBM Source object associated with a given context and topic and initialize source event callback. |
|
LBMSource(LBMContext lbmctx,
LBMTopic lbmtopic,
LBMSourceEventCallback cb,
java.lang.Object cbArg,
LBMEventQueue lbmevq)
Instantiate an LBM Source object associated with a given context, topic, and event queue and initialize source event callback. |
Method Summary | |
---|---|
void |
addSourceCallback(LBMSourceEventCallback cb)
Register a source event callback |
void |
addSourceCallback(LBMSourceEventCallback cb,
java.lang.Object cbArg)
Register a source event callback (and callback token) |
void |
close()
Close this source |
LBMSourceChannelInfo |
createChannel(long channelNumber)
Create a channel object to send messages with the given channel number. |
void |
deleteChannel(LBMSourceChannelInfo channelInfo)
Delete a channel object |
LBMConfigOption[] |
dumpAttributeList()
Returns an array of LBMConfigOptions |
protected void |
finalize()
|
void |
flush()
Send messages from both the explicit and implicit batches ASAP. |
java.lang.String |
getAttributeValue(java.lang.String attributeName)
Returns the value of a source-related attribute for this source. |
int |
getInflight(int type)
Get the current inflight value for this source |
LBMFlightSizeInflightInfo |
getInflightEx(int type)
Get the current inflight values of messages and bytes for this source |
LBMSourceStatistics |
getStatistics()
Return the current set of source transport statistics for this source. |
boolean |
isClosed()
Returns boolean describing whether this instance has a reference to a valid C source |
void |
load(java.io.InputStream inStream)
Reads a property (attribute) list (key and element pairs) from the input stream. |
protected int |
onResponse(LBMRequest lbmreq,
LBMMessage lbmmsg)
Default response message callback, which calls the interface specified when the request was sent. |
protected int |
onSourceEvent(LBMSourceEvent sourceEvent)
Default source event callback. |
void |
removeSourceCallback(LBMSourceEventCallback cb)
Deregister a source event callback |
void |
removeSourceCallback(LBMSourceEventCallback cb,
java.lang.Object cbArg)
Deregister a source event callback (and callback token) |
void |
resetStatistics()
Reset the transport statistics for this source. |
void |
send(byte[] message,
int messageLength,
int flags)
Send a message to the topic associated with the LBM source. |
void |
send(byte[] message,
int messageLength,
int flags,
LBMSourceSendExInfo exinfo)
Send a message to the topic associated with the LBM source. |
void |
send(byte[] message,
int messageLength,
int flags,
java.lang.Object cbArg)
Send a message to the topic associated with the LBM source. |
void |
send(java.nio.ByteBuffer message,
int startPosition,
int messageLength,
int flags)
Send a message to the topic associated with the LBM source. |
void |
send(java.nio.ByteBuffer message,
int startPosition,
int messageLength,
int flags,
LBMSourceSendExInfo exinfo)
Send a message to the topic associated with the LBM source. |
void |
send(java.nio.ByteBuffer message,
int startPosition,
int messageLength,
int flags,
java.lang.Object cbArg)
Send a message to the topic associated with the LBM source. |
void |
send(LBMRequest lbmreq,
int flags)
Send a request message to the topic associated with the LBM source. |
void |
send(LBMRequest lbmreq,
int flags,
LBMSourceSendExInfo exinfo)
Send a request message to the topic associated with the LBM source using an designated event queue for responses. |
void |
send(LBMRequest lbmreq,
LBMEventQueue lbmevq,
int flags)
Send a request message to the topic associated with the LBM source using an designated event queue for responses. |
void |
send(LBMRequest lbmreq,
LBMEventQueue lbmevq,
int flags,
LBMSourceSendExInfo exinfo)
Send a request message to the topic associated with the LBM source using an designated event queue for responses. |
void |
setAttributeValue(java.lang.String attributeName,
java.lang.String attributeValue)
Set the value of a source-related attribute for this source. |
int |
setInflight(int type,
LBMSetInflightCallback setInflightCb,
java.lang.Object clientd)
Set the current inflight value for this source. |
LBMFlightSizeInflightInfo |
setInflightEx(int type,
LBMSetInflightCallback setInflightCb,
java.lang.Object clientd)
Set the current inflight messages and bytes value for this source. |
java.lang.Object |
setProperty(java.lang.String attributeName,
java.lang.String attributeValue)
Set the value of a source-related attribute for this source. |
void |
setUMEMessageStable(long sqn)
Mark a specific sqn as stable, triggering an event if configured to do so, and adjusting the inflight if necessary. |
void |
umederegister()
Deregister this source |
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 |
---|
public LBMSource(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 source.lbmtopic
- LBMTopic used to initialize the source.
LBMException
- if any error occurred during source creation.public LBMSource(LBMContext lbmctx, LBMTopic lbmtopic, LBMSourceEventCallback 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 source.lbmtopic
- LBMTopic used to initialize the source.cb
- An object implementing the LBMSourceEventCallback interfacecbArg
- Callback token object
LBMException
- if any error occurred during source creation.public LBMSource(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 source.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).
LBMException
- if any error occurred during source creation.public LBMSource(LBMContext lbmctx, LBMTopic lbmtopic, LBMSourceEventCallback 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 source.lbmtopic
- LBMTopic used to initialize the source.cb
- An object implementing the LBMSourceEventCallback interfacecbArg
- Callback token objectlbmevq
- Event queue with which to associate the source
(all source events will be posted to this event queue).
LBMException
- if any error occurred during source creation.Method Detail |
---|
protected void finalize() throws LBMException
finalize
in class java.lang.Object
LBMException
public void umederegister() throws LBMException
Warning: It is not safe to call this method from a context thread callback.
LBMException
- if any error occurred during source deletion.public void close() throws LBMException
Warning: It is not safe to call this method from a context thread callback.
LBMException
- if any error occurred during source deletion.public boolean isClosed()
public LBMConfigOption[] dumpAttributeList()
public LBMSourceChannelInfo createChannel(long channelNumber) throws LBMException
channelNumber
- Channel number in the range 0-4294967295
LBMException
LBMSourceChannelInfo
,
deleteChannel(com.latencybusters.lbm.LBMSourceChannelInfo)
public void deleteChannel(LBMSourceChannelInfo channelInfo) throws LBMException
channelInfo
- A channelInfo object
LBMException
LBMSourceChannelInfo
,
createChannel(long)
public void addSourceCallback(LBMSourceEventCallback cb)
cb
- Object implementing the LBMSourceEventCallback interfaceLBMSourceEventCallback
,
removeSourceCallback(com.latencybusters.lbm.LBMSourceEventCallback)
public void addSourceCallback(LBMSourceEventCallback cb, java.lang.Object cbArg)
cb
- Object implementing the LBMSourceEventCallback interfacecbArg
- Callback token objectLBMSourceEventCallback
,
removeSourceCallback(com.latencybusters.lbm.LBMSourceEventCallback)
public void removeSourceCallback(LBMSourceEventCallback cb)
cb
- Previously registered object implementing the
LBMSourceEventCallback interfaceLBMSourceEventCallback
,
addSourceCallback(com.latencybusters.lbm.LBMSourceEventCallback)
public void removeSourceCallback(LBMSourceEventCallback cb, java.lang.Object cbArg)
cb
- Previously registered object implementing the
LBMSourceEventCallback interfacecbArg
- Callback token objectLBMSourceEventCallback
,
addSourceCallback(com.latencybusters.lbm.LBMSourceEventCallback)
protected int onSourceEvent(LBMSourceEvent sourceEvent)
sourceEvent
- LBMSourceEvent object containing information about
the posted source-related event.
LBMSourceEvent
,
addSourceCallback(com.latencybusters.lbm.LBMSourceEventCallback)
,
removeSourceCallback(com.latencybusters.lbm.LBMSourceEventCallback)
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 LBMSourceStatistics getStatistics() throws LBMException
LBMException
- if any error occurred retrieving source statistics.public void resetStatistics() throws LBMException
LBMException
- if any error occurred resetting source statistics.public void send(byte[] message, int messageLength, int flags) throws LBMException
Caution: It is not recommended to call this method from a context thread callback.
Warning (UME only): Calling this method from a context thread callback for stability and confirmation events could cause a deadlock.
message
- Data to send in this messagemessageLength
- Number of bytes of data to send in this messageflags
- Flags indicating various conditions.
See next section for possible OR'd set of values.
LBMException
- if any error occurred during sending.LBM.MSG_START_BATCH
,
LBM.MSG_END_BATCH
,
LBM.MSG_COMPLETE_BATCH
,
LBM.MSG_FLUSH
,
LBM.SRC_NONBLOCK
,
LBM.SRC_BLOCK
,
LBM.SRC_EVENT_UME_MESSAGE_STABLE
,
LBM.SRC_EVENT_UME_DELIVERY_CONFIRMATION
public void send(byte[] message, int messageLength, int flags, java.lang.Object cbArg) throws LBMException
Caution: It is not recommended to call this method from a context thread callback.
Warning (UME only): Calling this method from a context thread callback for stability and confirmation events could cause a deadlock.
message
- Data to send in this messagemessageLength
- Number of bytes of data to send in this messageflags
- Flags indicating various conditions.
See next section for possible OR'd set of values.cbArg
- Client object to be passed back in stability or confirmation
events related to this message (UME only)
LBMException
- if any error occurred during sending.LBM.MSG_START_BATCH
,
LBM.MSG_END_BATCH
,
LBM.MSG_COMPLETE_BATCH
,
LBM.MSG_FLUSH
,
LBM.SRC_NONBLOCK
,
LBM.SRC_BLOCK
,
LBM.SRC_EVENT_UME_MESSAGE_STABLE
,
LBM.SRC_EVENT_UME_DELIVERY_CONFIRMATION
public void send(byte[] message, int messageLength, int flags, LBMSourceSendExInfo exinfo) throws LBMException
Caution: It is not recommended to call this method from a context thread callback.
Warning (UME only): Calling this method from a context thread callback for stability and confirmation events could cause a deadlock.
message
- Data to send in this messagemessageLength
- Number of bytes of data to send in this messageflags
- Flags indicating various conditions.
See next section for possible OR'd set of values.exinfo
- LBMSourceSendExInfo object; used to set callback behavior
flags and to pass back a user-supplied object.
LBMException
- if any error occurred during sending.LBM.MSG_START_BATCH
,
LBM.MSG_END_BATCH
,
LBM.MSG_COMPLETE_BATCH
,
LBM.MSG_FLUSH
,
LBM.SRC_NONBLOCK
,
LBM.SRC_BLOCK
,
LBM.SRC_EVENT_UME_MESSAGE_STABLE
,
LBM.SRC_EVENT_UME_DELIVERY_CONFIRMATION
,
LBMSourceSendExInfo
public void send(java.nio.ByteBuffer message, int startPosition, int messageLength, int flags) throws LBMException
Caution: It is not recommended to call this method from a context thread callback.
Warning (UME only): Calling this method from a context thread callback for stability and confirmation events could cause a deadlock.
message
- Data to send in this messagestartPosition
- Starting position within the buffer to send frommessageLength
- Number of bytes of data to send in this messageflags
- Flags indicating various conditions.
See next section for possible OR'd set of values.
LBMException
- if any error occurred during sending.LBM.MSG_START_BATCH
,
LBM.MSG_END_BATCH
,
LBM.MSG_COMPLETE_BATCH
,
LBM.MSG_FLUSH
,
LBM.SRC_NONBLOCK
,
LBM.SRC_BLOCK
,
LBM.SRC_EVENT_UME_MESSAGE_STABLE
,
LBM.SRC_EVENT_UME_DELIVERY_CONFIRMATION
public void send(java.nio.ByteBuffer message, int startPosition, int messageLength, int flags, java.lang.Object cbArg) throws LBMException
Caution: It is not recommended to call this method from a context thread callback.
Warning (UME only): Calling this method from a context thread callback for stability and confirmation events could cause a deadlock.
message
- Data to send in this messagestartPosition
- Starting position within the buffer to send frommessageLength
- Number of bytes of data to send in this messageflags
- Flags indicating various conditions.
See next section for possible OR'd set of values.cbArg
- Client object to be passed back in stability or confirmation
events related to this message (UME only)
LBMException
- if any error occurred during sending.LBM.MSG_START_BATCH
,
LBM.MSG_END_BATCH
,
LBM.MSG_COMPLETE_BATCH
,
LBM.MSG_FLUSH
,
LBM.SRC_NONBLOCK
,
LBM.SRC_BLOCK
,
LBM.SRC_EVENT_UME_MESSAGE_STABLE
,
LBM.SRC_EVENT_UME_DELIVERY_CONFIRMATION
public void send(java.nio.ByteBuffer message, int startPosition, int messageLength, int flags, LBMSourceSendExInfo exinfo) throws LBMException
Caution: It is not recommended to call this method from a context thread callback.
Warning (UME only): Calling this method from a context thread callback for stability and confirmation events could cause a deadlock.
message
- Data to send in this messagestartPosition
- Starting position within the buffer to send frommessageLength
- Number of bytes of data to send in this messageflags
- Flags indicating various conditions.
See next section for possible OR'd set of values.exinfo
- LBMSourceSendExInfo object; used to set callback behavior
flags and to pass back a user-supplied object. (UME only)
LBMException
- if any error occurred during sending.LBM.MSG_START_BATCH
,
LBM.MSG_END_BATCH
,
LBM.MSG_COMPLETE_BATCH
,
LBM.MSG_FLUSH
,
LBM.SRC_NONBLOCK
,
LBM.SRC_BLOCK
,
LBM.SRC_EVENT_UME_MESSAGE_STABLE
,
LBM.SRC_EVENT_UME_DELIVERY_CONFIRMATION
,
LBMSourceSendExInfo
public void send(LBMRequest lbmreq, int flags) throws LBMException
Caution: It is not recommended to call this method from a context thread callback.
lbmreq
- LBMRequest objectflags
- Flags indicating various conditions.
See next section for possible OR'd set of values.
LBMException
- if any error occurred during sending.LBM.MSG_START_BATCH
,
LBM.MSG_END_BATCH
,
LBM.MSG_COMPLETE_BATCH
,
LBM.MSG_FLUSH
,
LBM.SRC_NONBLOCK
,
LBM.SRC_BLOCK
public void send(LBMRequest lbmreq, LBMEventQueue lbmevq, int flags) throws LBMException
Caution: It is not recommended to call this method from a context thread callback.
lbmreq
- LBMRequest objectlbmevq
- LBMEventQueue used to handle response messagesflags
- Flags indicating various conditions.
See next section for possible OR'd set of values.
LBMException
- if any error occurred during sending.LBM.MSG_START_BATCH
,
LBM.MSG_END_BATCH
,
LBM.MSG_COMPLETE_BATCH
,
LBM.MSG_FLUSH
,
LBM.SRC_NONBLOCK
,
LBM.SRC_BLOCK
public void send(LBMRequest lbmreq, LBMEventQueue lbmevq, int flags, LBMSourceSendExInfo exinfo) throws LBMException
Caution: It is not recommended to call this method from a context thread callback.
lbmreq
- LBMRequest objectlbmevq
- LBMEventQueue used to handle response messagesflags
- Flags indicating various conditions.
See next section for possible OR'd set of values.exinfo
- LBMSourceSendExInfo object; used to set callback behavior
flags and to pass back a user-supplied object. (UME only)
LBMException
- if any error occurred during sending.LBM.MSG_START_BATCH
,
LBM.MSG_END_BATCH
,
LBM.MSG_COMPLETE_BATCH
,
LBM.MSG_FLUSH
,
LBM.SRC_NONBLOCK
,
LBM.SRC_BLOCK
public void send(LBMRequest lbmreq, int flags, LBMSourceSendExInfo exinfo) throws LBMException
Caution: It is not recommended to call this method from a context thread callback.
lbmreq
- LBMRequest objectflags
- Flags indicating various conditions.
See next section for possible OR'd set of values.exinfo
- LBMSourceSendExInfo object; used to set callback behavior
flags and to pass back a user-supplied object. (UME only)
LBMException
- if any error occurred during sending.LBM.MSG_START_BATCH
,
LBM.MSG_END_BATCH
,
LBM.MSG_COMPLETE_BATCH
,
LBM.MSG_FLUSH
,
LBM.SRC_NONBLOCK
,
LBM.SRC_BLOCK
public void flush() throws LBMException
Warning (UME only): Calling this method from a context thread callback for stability and confirmation events could cause a deadlock.
LBMException
- if any error occurred during sending.protected int onResponse(LBMRequest lbmreq, LBMMessage lbmmsg)
lbmreq
- LBMRequest object returned by corresponding send calllbmmsg
- LBMMessage object containing the response data
send(LBMRequest, int)
,
send(LBMRequest, LBMEventQueue, int)
public int getInflight(int type) throws LBMException
type
- The type of flight size
LBMException
- if an error occurs while retrieving the inflight valueLBM.FLIGHT_SIZE_TYPE_UME
,
LBM.FLIGHT_SIZE_TYPE_ULB
,
LBM.FLIGHT_SIZE_TYPE_UMQ
public LBMFlightSizeInflightInfo getInflightEx(int type) throws LBMException
type
- The type of flight size
LBMException
- if an error occurs while retrieving the inflight valueLBM.FLIGHT_SIZE_TYPE_UME
,
LBM.FLIGHT_SIZE_TYPE_ULB
,
LBM.FLIGHT_SIZE_TYPE_UMQ
public int setInflight(int type, LBMSetInflightCallback setInflightCb, java.lang.Object clientd) throws LBMException
type
- The type of flight sizesetInflightCb
- Object that implements the LBMSetInflightCallback interfaceclientd
- Clientd object passed into the setInflight callback
LBMException
- if an error occurs while setting the inflight valueLBM.FLIGHT_SIZE_TYPE_UME
,
LBM.FLIGHT_SIZE_TYPE_ULB
,
LBM.FLIGHT_SIZE_TYPE_UMQ
public LBMFlightSizeInflightInfo setInflightEx(int type, LBMSetInflightCallback setInflightCb, java.lang.Object clientd) throws LBMException
type
- The type of flight sizesetInflightCb
- Object that implements the LBMSetInflightCallback interfaceclientd
- Clientd object passed into the setInflight callback
LBMException
- if an error occurs while setting the inflight valueLBM.FLIGHT_SIZE_TYPE_UME
,
LBM.FLIGHT_SIZE_TYPE_ULB
,
LBM.FLIGHT_SIZE_TYPE_UMQ
public void setUMEMessageStable(long sqn) throws LBMException
sqn
- Sqn of the fragment to mark stable
LBMException
- if an error occurs while marking the fragment stable
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |