UM Java API
6.16.1
|
Public Member Functions | |
LBMSource (LBMContext lbmctx, LBMTopic lbmtopic) throws LBMException | |
LBMSource (LBMContext lbmctx, LBMTopic lbmtopic, LBMSourceEventCallback cb, Object cbArg) throws LBMException | |
LBMSource (LBMContext lbmctx, LBMTopic lbmtopic, LBMEventQueue lbmevq) throws LBMException | |
LBMSource (LBMContext lbmctx, LBMTopic lbmtopic, LBMSourceEventCallback cb, Object cbArg, LBMEventQueue lbmevq) throws LBMException | |
void | umederegister () throws LBMException |
void | unblock () throws LBMException |
void | close () throws LBMException |
boolean | isClosed () |
LBMConfigOption[] | dumpAttributeList () |
LBMSourceChannelInfo | createChannel (long channelNumber) throws LBMException |
void | deleteChannel (LBMSourceChannelInfo channelInfo) throws LBMException |
void | addSourceCallback (LBMSourceEventCallback cb) |
void | addSourceCallback (LBMSourceEventCallback cb, Object cbArg) |
void | removeSourceCallback (LBMSourceEventCallback cb) |
void | removeSourceCallback (LBMSourceEventCallback cb, Object cbArg) |
String | getAttributeValue (String attributeName) throws LBMException |
void | setAttributeValue (String attributeName, String attributeValue) throws LBMException |
Object | setProperty (String attributeName, String attributeValue) |
void | load (InputStream inStream) throws IOException |
LBMSourceStatistics | getStatistics () throws LBMException |
void | resetStatistics () throws LBMException |
void | sendStatistics (ByteBuffer message, int messageLength, int statsType) throws LBMException |
void | send (byte[] message, int messageLength, int flags) throws LBMException |
void | send (byte[] message, int messageLength, int flags, Object cbArg) throws LBMException |
void | send (byte[] message, int messageLength, int flags, LBMSourceSendExInfo exinfo) throws LBMException |
void | send (ByteBuffer message, int startPosition, int messageLength, int flags) throws LBMException |
void | send (ByteBuffer message, int startPosition, int messageLength, int flags, Object cbArg) throws LBMException |
void | send (ByteBuffer message, int startPosition, int messageLength, int flags, LBMSourceSendExInfo exinfo) throws LBMException |
void | send (LBMRequest lbmreq, int flags) throws LBMException |
void | send (LBMRequest lbmreq, LBMEventQueue lbmevq, int flags) throws LBMException |
void | send (LBMRequest lbmreq, LBMEventQueue lbmevq, int flags, LBMSourceSendExInfo exinfo) throws LBMException |
void | send (LBMRequest lbmreq, int flags, LBMSourceSendExInfo exinfo) throws LBMException |
void | flush () throws LBMException |
int | getInflight (int type) throws LBMException |
LBMFlightSizeInflightInfo | getInflightEx (int type) throws LBMException |
int | setInflight (int type, LBMSetInflightCallback setInflightCb, Object clientd) throws LBMException |
LBMFlightSizeInflightInfo | setInflightEx (int type, LBMSetInflightCallback setInflightCb, Object clientd) throws LBMException |
void | setUMEMessageStable (long sqn) throws LBMException |
ByteBuffer | getMessagesBuffer () throws LBMException |
int | acquireMessageBufferPosition (final int messageLength, final int flags) throws LBMException |
void | messageBuffersComplete () throws LBMException |
int | messageBuffersCompleteAndAcquirePosition (final int messageLength, final int flags) throws LBMException |
void | messageBuffersCancel () throws LBMException |
Protected Member Functions | |
void | finalize () throws LBMException |
int | onSourceEvent (LBMSourceEvent sourceEvent) |
int | onResponse (LBMRequest lbmreq, LBMMessage lbmmsg) |
LBM Source class.
Warning: It is not safe to instantiate this object from a context thread callback.
com.latencybusters.lbm.LBMSource.LBMSource | ( | LBMContext | lbmctx, |
LBMTopic | lbmtopic | ||
) | throws LBMException |
Instantiate an LBM Source object associated with a given context and topic.
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. |
References com.latencybusters.lbm.LBM.EINVAL.
com.latencybusters.lbm.LBMSource.LBMSource | ( | LBMContext | lbmctx, |
LBMTopic | lbmtopic, | ||
LBMSourceEventCallback | cb, | ||
Object | cbArg | ||
) | throws LBMException |
Instantiate an LBM Source object associated with a given context and topic and initialize source event callback.
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 interface |
cbArg | Callback token object |
LBMException | if any error occurred during source creation. |
References com.latencybusters.lbm.LBMSource.addSourceCallback(), and com.latencybusters.lbm.LBM.EINVAL.
com.latencybusters.lbm.LBMSource.LBMSource | ( | LBMContext | lbmctx, |
LBMTopic | lbmtopic, | ||
LBMEventQueue | lbmevq | ||
) | throws LBMException |
Instantiate an LBM Source object associated with a given context, topic, and event queue.
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. |
References com.latencybusters.lbm.LBM.EINVAL.
com.latencybusters.lbm.LBMSource.LBMSource | ( | LBMContext | lbmctx, |
LBMTopic | lbmtopic, | ||
LBMSourceEventCallback | cb, | ||
Object | cbArg, | ||
LBMEventQueue | lbmevq | ||
) | throws LBMException |
Instantiate an LBM Source object associated with a given context, topic, and event queue and initialize source event callback.
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 interface |
cbArg | Callback token object |
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. |
References com.latencybusters.lbm.LBMSource.addSourceCallback(), and com.latencybusters.lbm.LBM.EINVAL.
int com.latencybusters.lbm.LBMSource.acquireMessageBufferPosition | ( | final int | messageLength, |
final int | flags | ||
) | throws LBMException |
Reserve space in this source's messages buffer. When this method returns, we have guaranteed that there is sufficient space in the message buffer to safely write up to messageLength bytes starting at the returned position. The application must ensure that this contract is not broken. When message data has been written, call messageBuffersComplete() to make them available to receivers.
If non-blocking send, and the source would have to wait for recievers to catch up, a value of -1 is returned. This is in contrast to send methods that throw a new LBMEWouldBlockException and is done for performance reasons.
Only LBT-SMX transports currently support this method.
Warning Not thread safe among sources sharing the same transport.
messageLength | Length in bytes to reserve in the messages buffer |
flags | Source send flags |
LBMException | If an error occurs |
Referenced by com.latencybusters.lbm.LBMSource.getMessagesBuffer(), and com.latencybusters.lbm.LBMSource.messageBuffersCompleteAndAcquirePosition().
void com.latencybusters.lbm.LBMSource.addSourceCallback | ( | LBMSourceEventCallback | cb | ) |
Register a source event callback
cb | Object implementing the LBMSourceEventCallback interface |
Referenced by com.latencybusters.lbm.LBMHotFailoverSource.LBMHotFailoverSource(), and com.latencybusters.lbm.LBMSource.LBMSource().
void com.latencybusters.lbm.LBMSource.addSourceCallback | ( | LBMSourceEventCallback | cb, |
Object | cbArg | ||
) |
Register a source event callback (and callback token)
cb | Object implementing the LBMSourceEventCallback interface |
cbArg | Callback token object |
void com.latencybusters.lbm.LBMSource.close | ( | ) | throws LBMException |
Close this source
Warning: It is not safe to call this method from a context thread callback.
LBMException | if any error occurred during source deletion. |
Referenced by com.latencybusters.lbm.LBMSource.finalize().
LBMSourceChannelInfo com.latencybusters.lbm.LBMSource.createChannel | ( | long | channelNumber | ) | throws LBMException |
Create a channel object to send messages with the given channel number. The application is responsible for calling close() or LBMSource.deleteChannel() on any LBMSourceChannelInfo object allocated via the LBMSourceChannelInfo constructor or the LBMSource.createChannel method once it is no longer being used. Failure to do so will result in unmanaged resources not being reclaimed.
channelNumber | Channel number in the range 0-4294967295 |
void com.latencybusters.lbm.LBMSource.deleteChannel | ( | LBMSourceChannelInfo | channelInfo | ) | throws LBMException |
Delete a channel object
channelInfo | A channelInfo object |
LBMConfigOption [] com.latencybusters.lbm.LBMSource.dumpAttributeList | ( | ) |
Returns an array of LBMConfigOptions
|
protected |
This method is for internal use only, and is not supported for customer applications.
References com.latencybusters.lbm.LBMSource.close().
void com.latencybusters.lbm.LBMSource.flush | ( | ) | throws LBMException |
Send messages from both the explicit and implicit batches ASAP.
LBMException | if any error occurred during sending. |
References com.latencybusters.lbm.LBMSource.messageBuffersComplete(), and com.latencybusters.lbm.LBMSource.onResponse().
String com.latencybusters.lbm.LBMSource.getAttributeValue | ( | String | attributeName | ) | throws LBMException |
Returns the value of a source-related attribute for this source.
attributeName | Name of the attribute to retrieve |
LBMException | if attributeName is not a valid attribute. |
int com.latencybusters.lbm.LBMSource.getInflight | ( | int | type | ) | throws LBMException |
Get the current inflight value for this source
type | The type of flight size |
LBMException | if an error occurs while retrieving the inflight value |
References com.latencybusters.lbm.LBMSource.setInflight().
LBMFlightSizeInflightInfo com.latencybusters.lbm.LBMSource.getInflightEx | ( | int | type | ) | throws LBMException |
Get the current inflight values of messages and bytes for this source
type | The type of flight size |
LBMException | if an error occurs while retrieving the inflight value |
References com.latencybusters.lbm.LBMSource.setInflightEx().
ByteBuffer com.latencybusters.lbm.LBMSource.getMessagesBuffer | ( | ) | throws LBMException |
Get the buffer for writing messages for an LBT-SMX source. This buffer will not change for the duration of this source. Messages are written into this buffer by using the return value of acquireMessageBufferPosition(final int, final int).
Only LBT-SMX transports currently support this method.
References com.latencybusters.lbm.LBMSource.acquireMessageBufferPosition(), and com.latencybusters.lbm.LBMSource.messageBuffersComplete().
LBMSourceStatistics com.latencybusters.lbm.LBMSource.getStatistics | ( | ) | throws LBMException |
Return the current set of source transport statistics for this source.
LBMException | if any error occurred retrieving source statistics. |
References com.latencybusters.lbm.LBMSourceStatistics.refresh().
boolean com.latencybusters.lbm.LBMSource.isClosed | ( | ) |
Returns boolean describing whether this instance has a reference to a valid C source
void com.latencybusters.lbm.LBMSource.load | ( | InputStream | inStream | ) | throws IOException |
Reads a property (attribute) list (key and element pairs) from the input stream.
inStream | Input stream of bytes |
IOException | if any I/O error occurs. |
LBMRuntimeException | if any invalid attribute is detected in inStream . |
References com.latencybusters.lbm.LBMSource.setProperty().
void com.latencybusters.lbm.LBMSource.messageBuffersCancel | ( | ) | throws LBMException |
For this source, declare all previously acquired, but not completed, buffers to be invalid. The messages will not be delivered to receiving applications and the reserved buffer space will be ignored.
Only LBT-SMX transports currently support this method.
Warning Not thread safe among sources sharing the same transport.
LBMException |
References com.latencybusters.lbm.LBM.EOS.
void com.latencybusters.lbm.LBMSource.messageBuffersComplete | ( | ) | throws LBMException |
Commits all previously acquired message buffers for this source's transport to be read by receivers. Call this when message data placed in the transport buffer is ready to be consumed by receivers. Calling this method with no new data has no effect.
Only LBT-SMX transports currently support this method.
Warning Not thread safe among sources sharing the same transport.
LBMException |
Referenced by com.latencybusters.lbm.LBMSource.flush(), and com.latencybusters.lbm.LBMSource.getMessagesBuffer().
int com.latencybusters.lbm.LBMSource.messageBuffersCompleteAndAcquirePosition | ( | final int | messageLength, |
final int | flags | ||
) | throws LBMException |
Convenience method that calls messageBuffersComplete() followed by acquireMessageBufferPosition(final int, final int). This is intended to reduce the number of calls per message.
Only LBT-SMX transports currently support this method.
Warning Not thread safe among sources sharing the same transport.
messageLength | - length in bytes to reserve in the messages buffer |
flags | - Source send flags |
LBMException |
References com.latencybusters.lbm.LBMSource.acquireMessageBufferPosition().
|
protected |
Default response message callback, which calls the interface specified when the request was sent. This method may be overridden by subclassing the LBMSource class.
lbmreq | LBMRequest object returned by corresponding send call |
lbmmsg | LBMMessage object containing the response data |
Referenced by com.latencybusters.lbm.LBMSource.flush().
|
protected |
Default source event callback. Although possible, it is not recommended that this function be overridden by subclassing the LBMSource class. Instead, the source may be initialized using a constructor that specifies an LBMSourceEventCallback interface or by registering (deregistering) the callback using addSourceCallback() (removeSourceCallback()).
sourceEvent | LBMSourceEvent object containing information about the posted source-related event. |
References com.latencybusters.lbm.LBMSourceEventCallback.onSourceEvent(), and com.latencybusters.lbm.LBMSourceEvent.promote().
void com.latencybusters.lbm.LBMSource.removeSourceCallback | ( | LBMSourceEventCallback | cb | ) |
Deregister a source event callback
cb | Previously registered object implementing the LBMSourceEventCallback interface |
void com.latencybusters.lbm.LBMSource.removeSourceCallback | ( | LBMSourceEventCallback | cb, |
Object | cbArg | ||
) |
Deregister a source event callback (and callback token)
cb | Previously registered object implementing the LBMSourceEventCallback interface |
cbArg | Callback token object |
void com.latencybusters.lbm.LBMSource.resetStatistics | ( | ) | throws LBMException |
Reset the transport statistics for this source.
LBMException | if any error occurred resetting source statistics. |
void com.latencybusters.lbm.LBMSource.send | ( | byte [] | message, |
int | messageLength, | ||
int | flags | ||
) | throws LBMException |
Send a message to the topic associated with the LBM source.
message | Data to send in this message |
messageLength | Number of bytes of data to send in this message |
flags | Flags indicating various conditions. See next section for possible OR'd set of values. |
LBMException | if any error occurred during sending. |
void com.latencybusters.lbm.LBMSource.send | ( | byte [] | message, |
int | messageLength, | ||
int | flags, | ||
Object | cbArg | ||
) | throws LBMException |
Send a message to the topic associated with the LBM source.
message | Data to send in this message |
messageLength | Number of bytes of data to send in this message |
flags | 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. |
void com.latencybusters.lbm.LBMSource.send | ( | byte [] | message, |
int | messageLength, | ||
int | flags, | ||
LBMSourceSendExInfo | exinfo | ||
) | throws LBMException |
Send a message to the topic associated with the LBM source.
message | Data to send in this message |
messageLength | Number of bytes of 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 to pass back a user-supplied object. |
LBMException | if any error occurred during sending. |
void com.latencybusters.lbm.LBMSource.send | ( | ByteBuffer | message, |
int | startPosition, | ||
int | messageLength, | ||
int | flags | ||
) | throws LBMException |
Send a message to the topic associated with the LBM source.
message | Data to send in this message |
startPosition | Starting position within the buffer to send from |
messageLength | Number of bytes of data to send in this message |
flags | Flags indicating various conditions. See next section for possible OR'd set of values. |
LBMException | if any error occurred during sending. |
void com.latencybusters.lbm.LBMSource.send | ( | ByteBuffer | message, |
int | startPosition, | ||
int | messageLength, | ||
int | flags, | ||
Object | cbArg | ||
) | throws LBMException |
Send a message to the topic associated with the LBM source.
message | Data to send in this message |
startPosition | Starting position within the buffer to send from |
messageLength | Number of bytes of data to send in this message |
flags | 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. |
void com.latencybusters.lbm.LBMSource.send | ( | ByteBuffer | message, |
int | startPosition, | ||
int | messageLength, | ||
int | flags, | ||
LBMSourceSendExInfo | exinfo | ||
) | throws LBMException |
Send a message to the topic associated with the LBM source.
message | Data to send in this message |
startPosition | Starting position within the buffer to send from |
messageLength | Number of bytes of 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 to pass back a user-supplied object. (UME only) |
LBMException | if any error occurred during sending. |
void com.latencybusters.lbm.LBMSource.send | ( | LBMRequest | lbmreq, |
int | flags | ||
) | throws LBMException |
Send a request message to the topic associated with the LBM source.
lbmreq | LBMRequest object |
flags | Flags indicating various conditions. See next section for possible OR'd set of values. |
LBMException | if any error occurred during sending. |
void com.latencybusters.lbm.LBMSource.send | ( | LBMRequest | lbmreq, |
LBMEventQueue | lbmevq, | ||
int | flags | ||
) | throws LBMException |
Send a request message to the topic associated with the LBM source using an designated event queue for responses.
lbmreq | LBMRequest object |
lbmevq | LBMEventQueue used to handle response messages |
flags | Flags indicating various conditions. See next section for possible OR'd set of values. |
LBMException | if any error occurred during sending. |
void com.latencybusters.lbm.LBMSource.send | ( | LBMRequest | lbmreq, |
LBMEventQueue | lbmevq, | ||
int | flags, | ||
LBMSourceSendExInfo | exinfo | ||
) | throws LBMException |
Send a request message to the topic associated with the LBM source using an designated event queue for responses.
lbmreq | LBMRequest object |
lbmevq | LBMEventQueue used to handle response messages |
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 to pass back a user-supplied object. (UME only) |
LBMException | if any error occurred during sending. |
void com.latencybusters.lbm.LBMSource.send | ( | LBMRequest | lbmreq, |
int | flags, | ||
LBMSourceSendExInfo | exinfo | ||
) | throws LBMException |
Send a request message to the topic associated with the LBM source using an designated event queue for responses.
lbmreq | LBMRequest object |
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 to pass back a user-supplied object. (UME only) |
LBMException | if any error occurred during sending. |
void com.latencybusters.lbm.LBMSource.sendStatistics | ( | ByteBuffer | message, |
int | messageLength, | ||
int | statsType | ||
) | throws LBMException |
Send a serialized PB message to the topic associated with the LBM source.
message | ByteBuffer that contains serialized PB stats to send. |
messageLength | Number of bytes in the ByteBuffer. |
statsType | Indicates the type of statistics being sent. See next section for set of possible values. |
LBMException | if any error occurred during sending. |
void com.latencybusters.lbm.LBMSource.setAttributeValue | ( | String | attributeName, |
String | attributeValue | ||
) | throws LBMException |
Set the value of a source-related attribute for this source. Note that this method bypasses the property list. As such no attributes configured using this method will appear in the property list.
attributeName | Name of the attribute to set |
attributeValue | New attribute value |
LBMException | if attributeName is not a valid attribute, or attributeValue is not a valid value for attributeName . |
Referenced by com.latencybusters.lbm.LBMSource.setProperty().
int com.latencybusters.lbm.LBMSource.setInflight | ( | int | type, |
LBMSetInflightCallback | setInflightCb, | ||
Object | clientd | ||
) | throws LBMException |
Set the current inflight value for this source.
type | The type of flight size |
setInflightCb | Object that implements the LBMSetInflightCallback interface |
clientd | Clientd object passed into the setInflight callback |
LBMException | if an error occurs while setting the inflight value |
Referenced by com.latencybusters.lbm.LBMSource.getInflight().
LBMFlightSizeInflightInfo com.latencybusters.lbm.LBMSource.setInflightEx | ( | int | type, |
LBMSetInflightCallback | setInflightCb, | ||
Object | clientd | ||
) | throws LBMException |
Set the current inflight messages and bytes value for this source. The values are set from within the provided set inflight callback with appropriate locking held.
type | The type of flight size |
setInflightCb | Object that implements the LBMSetInflightCallback interface |
clientd | Clientd object passed into the setInflight callback |
LBMException | if an error occurs while setting the inflight value |
Referenced by com.latencybusters.lbm.LBMSource.getInflightEx().
Object com.latencybusters.lbm.LBMSource.setProperty | ( | String | attributeName, |
String | attributeValue | ||
) |
Set the value of a source-related attribute for this source.
attributeName | Name of the attribute to set |
attributeValue | New attribute value |
LBMRuntimeException | if attributeName is not a valid attribute, or attributeValue is not a valid value for attributeName . |
References com.latencybusters.lbm.LBMSource.setAttributeValue().
Referenced by com.latencybusters.lbm.LBMSource.load().
void com.latencybusters.lbm.LBMSource.setUMEMessageStable | ( | long | sqn | ) | throws LBMException |
Mark a specific sqn as stable, triggering an event if configured to do so, and adjusting the inflight if necessary.
sqn | Sqn of the fragment to mark stable |
LBMException | if an error occurs while marking the fragment stable |
void com.latencybusters.lbm.LBMSource.umederegister | ( | ) | throws LBMException |
Deregister this source
Warning: It is not safe to call this method from a context thread callback.
LBMException | if any error occurred during source deletion. |
void com.latencybusters.lbm.LBMSource.unblock | ( | ) | throws LBMException |
This method is for internal use only, and is not supported for customer applications.