UM Java API  6.16.1
com.latencybusters.lbm.LBMSSource Class Reference
Inheritance diagram for com.latencybusters.lbm.LBMSSource:

Public Member Functions

 LBMSSource (LBMContext lbmctx, LBMTopic lbmtopic) throws LBMException
 
 LBMSSource (LBMContext lbmctx, LBMTopic lbmtopic, LBMSourceEventCallback cb, Object cbArg) throws LBMException
 
 LBMSSource (LBMContext lbmctx, LBMTopic lbmtopic, LBMEventQueue lbmevq) throws LBMException
 
 LBMSSource (LBMContext lbmctx, LBMTopic lbmtopic, LBMSourceEventCallback cb, Object cbArg, LBMEventQueue lbmevq) throws LBMException
 
void umederegister () throws LBMException
 
void close () throws LBMException
 
boolean isClosed ()
 
LBMConfigOption[] dumpAttributeList ()
 
void addSSourceCallback (LBMSourceEventCallback cb)
 
void addSSourceCallback (LBMSourceEventCallback cb, Object cbArg)
 
void removeSSourceCallback (LBMSourceEventCallback cb)
 
void removeSSourceCallback (LBMSourceEventCallback cb, Object cbArg)
 
String getAttributeValue (String attributeName) throws LBMException
 
void setAttributeValue (String attributeName, String attributeValue) throws LBMException
 
LBMSourceStatistics getStatistics () throws LBMException
 
void resetStatistics () throws LBMException
 
void send (ByteBuffer message, int messageLength, int flags) throws LBMException
 
void send (ByteBuffer message, int startPosition, int messageLength, int flags) throws LBMException
 
void send (ByteBuffer message, int messageLength, int flags, LBMSSourceSendExInfo exinfo) throws LBMException
 
void send (ByteBuffer message, int startPosition, int messageLength, int flags, LBMSSourceSendExInfo exinfo) throws LBMException
 
ByteBuffer buffGet () throws LBMException
 
int getSSrcInflight (int type) throws LBMException
 
LBMFlightSizeInflightInfo getSSrcInflightEx (int type) throws LBMException
 
int setSSrcInflight (int type, LBMSetInflightCallback setInflightCb, Object clientd) throws LBMException
 
LBMFlightSizeInflightInfo setSSrcInflightEx (int type, LBMSetInflightCallback setInflightCb, Object clientd) throws LBMException
 
void buffPut (ByteBuffer userBuff) throws LBMException
 
int getAvailableDataSpace ()
 

Protected Member Functions

void finalize ()
 
int onSourceEvent (LBMSourceEvent ssourceEvent)
 

Detailed Description

LBM SmartSource class.

See Smart Sources for more information on Smart Sources. See also Smart Source Options for configuration information.

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

Constructor & Destructor Documentation

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

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

In addition to creating the Smart Source object, this function also creates message buffers associated with the source and transport session.

See Smart Sources for more information. See also Smart Source Options for configuration information.

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

Parameters
lbmctxContext with which to associate the source.
lbmtopicLBMTopic used to initialize the source.
Exceptions
LBMExceptionif any error occurred during source creation.
com.latencybusters.lbm.LBMSSource.LBMSSource ( LBMContext  lbmctx,
LBMTopic  lbmtopic,
LBMSourceEventCallback  cb,
Object  cbArg 
) throws LBMException

Instantiate an LBM SmartSource object associated with a given context and topic and initialize source event callback.

In addition to creating the Smart Source object, this function also creates message buffers associated with the source and transport session.

See Smart Sources for more information. See also Smart Source Options for configuration information.

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

Parameters
lbmctxContext with which to associate the source.
lbmtopicLBMTopic used to initialize the source.
cbAn object implementing the LBMSourceEventCallback interface
cbArgCallback token object
Exceptions
LBMExceptionif any error occurred during source creation.
com.latencybusters.lbm.LBMSSource.LBMSSource ( LBMContext  lbmctx,
LBMTopic  lbmtopic,
LBMEventQueue  lbmevq 
) throws LBMException

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

In addition to creating the Smart Source object, this function also creates message buffers associated with the source and transport session.

See Smart Sources for more information. See also Smart Source Options for configuration information.

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

Parameters
lbmctxContext with which to associate the source.
lbmtopicLBMTopic used to initialize the source.
lbmevqEvent queue with which to associate the source (all source events will be posted to this event queue).
Exceptions
LBMExceptionif any error occurred during source creation.
com.latencybusters.lbm.LBMSSource.LBMSSource ( LBMContext  lbmctx,
LBMTopic  lbmtopic,
LBMSourceEventCallback  cb,
Object  cbArg,
LBMEventQueue  lbmevq 
) throws LBMException

Instantiate an LBM SmartSource object associated with a given context, topic, and event queue and initialize source event callback.

In addition to creating the Smart Source object, this function also creates message buffers associated with the source and transport session.

See Smart Sources for more information. See also Smart Source Options for configuration information.

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

Parameters
lbmctxContext with which to associate the source.
lbmtopicLBMTopic used to initialize the source.
cbAn object implementing the LBMSourceEventCallback interface
cbArgCallback token object
lbmevqEvent Queues not supported at this time
Exceptions
LBMExceptionif any error occurred during source creation.

References com.latencybusters.lbm.LBMSSource.addSSourceCallback(), and com.latencybusters.lbm.LBM.EINVAL.

Member Function Documentation

void com.latencybusters.lbm.LBMSSource.addSSourceCallback ( LBMSourceEventCallback  cb)

Register a source event callback

Parameters
cbObject implementing the LBMSourceEventCallback interface
See also
LBMSourceEventCallback
removeSSourceCallback

Referenced by com.latencybusters.lbm.LBMSSource.LBMSSource().

void com.latencybusters.lbm.LBMSSource.addSSourceCallback ( LBMSourceEventCallback  cb,
Object  cbArg 
)

Register a source event callback (and callback token)

Parameters
cbObject implementing the LBMSourceEventCallback interface
cbArgCallback token object
See also
LBMSourceEventCallback
removeSSourceCallback
ByteBuffer com.latencybusters.lbm.LBMSSource.buffGet ( ) throws LBMException

Return a ByteBuffer that has a SmartSource pre-allocated buffer associated with it.

See Smart Sources for more information on Smart Sources. See also Smart Source Options for configuration information.

Returns
ByteBuffer object that can be filled in with the message to be sent.
Exceptions
LBMExceptionif any error occurred retrieving a buffer.
void com.latencybusters.lbm.LBMSSource.buffPut ( ByteBuffer  userBuff) throws LBMException

Return a ByteBuffer to the pool of SmartSource pre-allocated buffers for use later.

See Smart Sources for more information on Smart Sources. See also Smart Source Options for configuration information.

Parameters
userBuffA ByteBuffer previously retrieved with a call to buffGet().
Exceptions
LBMExceptionif any error occurred returning the buffer.

References com.latencybusters.lbm.LBM.EOS.

void com.latencybusters.lbm.LBMSSource.close ( ) throws LBMException

Close this source.

Note that this function can return while the source callback may still be executing if source events are being delivered via an event queue.

See Smart Sources for more information on Smart Sources. See also Smart Source Options for configuration information.

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

Exceptions
LBMExceptionif any error occurred during source deletion.

Referenced by com.latencybusters.lbm.LBMSSource.finalize().

LBMConfigOption [] com.latencybusters.lbm.LBMSSource.dumpAttributeList ( )

Returns an array of LBMConfigOptions

Returns
Array of LBMConfigOption
void com.latencybusters.lbm.LBMSSource.finalize ( )
protected

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

References com.latencybusters.lbm.LBMSSource.close().

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

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

Parameters
attributeNameName of the attribute to retrieve
Returns
Value corresponding to the specified attribute name
Exceptions
LBMExceptionif attributeName is not a valid attribute.
int com.latencybusters.lbm.LBMSSource.getAvailableDataSpace ( )

Return the maximum allowable message size (data space) that the configured SmartSource will allow.

See Smart Sources for more information on Smart Sources. See also Smart Source Options for configuration information.

Returns
The maximum allowable message size for this SmartSource.
int com.latencybusters.lbm.LBMSSource.getSSrcInflight ( int  type) throws LBMException

Get the current inflight value for this smart source

Parameters
typeThe type of flight size
See also
LBM::FLIGHT_SIZE_TYPE_UME
Returns
the inflight value
Exceptions
LBMExceptionif an error occurs while retrieving the inflight value

References com.latencybusters.lbm.LBMSSource.setSSrcInflight().

LBMFlightSizeInflightInfo com.latencybusters.lbm.LBMSSource.getSSrcInflightEx ( int  type) throws LBMException

Get the current inflight values of messages and bytes for this smart source

Parameters
typeThe type of flight size
See also
LBM::FLIGHT_SIZE_TYPE_UME
Returns
the inflight value
Exceptions
LBMExceptionif an error occurs while retrieving the inflight value

References com.latencybusters.lbm.LBMSSource.setSSrcInflightEx().

LBMSourceStatistics com.latencybusters.lbm.LBMSSource.getStatistics ( ) throws LBMException

Return the current set of source transport statistics for this source.

Returns
LBMSourceStatistics object containing the statistics corresponding to this source.
Exceptions
LBMExceptionif any error occurred retrieving source statistics.

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

boolean com.latencybusters.lbm.LBMSSource.isClosed ( )

Returns boolean describing whether this instance has a reference to a valid C source

Returns
boolean describing whether this instance has a reference to a valid C source
int com.latencybusters.lbm.LBMSSource.onSourceEvent ( LBMSourceEvent  ssourceEvent)
protected

Default smart source event callback. Although possible, it is not recommended that this function be overridden by subclassing the LBMSSource class. Instead, the source may be initialized using a constructor that specifies an LBMSourceEventCallback interface or by registering (deregistering) the callback using addSSourceCallback() (removeSSourceCallback()).

Parameters
ssourceEventLBMSourceEvent object containing information about the posted source-related event.
Returns
an int, which is always 0.
See also
LBMSourceEvent
addSSourceCallback
removeSSourceCallback

References com.latencybusters.lbm.LBMSourceEventCallback.onSourceEvent(), and com.latencybusters.lbm.LBMSourceEvent.promote().

void com.latencybusters.lbm.LBMSSource.removeSSourceCallback ( LBMSourceEventCallback  cb)

Deregister a source event callback

Parameters
cbPreviously registered object implementing the LBMSourceEventCallback interface
See also
LBMSourceEventCallback
addSSourceCallback
void com.latencybusters.lbm.LBMSSource.removeSSourceCallback ( LBMSourceEventCallback  cb,
Object  cbArg 
)

Deregister a source event callback (and callback token)

Parameters
cbPreviously registered object implementing the LBMSourceEventCallback interface
cbArgCallback token object
See also
LBMSourceEventCallback
addSSourceCallback
void com.latencybusters.lbm.LBMSSource.resetStatistics ( ) throws LBMException

Reset the transport statistics for this source.

Exceptions
LBMExceptionif any error occurred resetting source statistics.
void com.latencybusters.lbm.LBMSSource.send ( ByteBuffer  message,
int  messageLength,
int  flags 
) throws LBMException

Send a message using a pre-allocated buffer to the topic associated with the LBM Smart Source.

See Smart Sources for more information. See also Smart Source Options for configuration information.

Parameters
messageData to send in this message. This must be a buffer retrieved via the buffGet() method from this SmartSource.
messageLengthNumber of bytes of data to send in this message
flagsFlags indicating various conditions. NOT USED AT THIS TIME. Pass in zero (0).
Exceptions
LBMExceptionif any error occurred during sending.

Referenced by com.latencybusters.lbm.LBMSSource.send().

void com.latencybusters.lbm.LBMSSource.send ( ByteBuffer  message,
int  startPosition,
int  messageLength,
int  flags 
) throws LBMException

Send a message using a pre-allocated buffer to the topic associated with the LBM Smart Source.

See Smart Sources for more information. See also Smart Source Options for configuration information.

Parameters
messageData to send in this message. This must be a buffer retrieved via the buffGet() method from this SmartSource.
startPositionMust be set to 0
messageLengthNumber of bytes of data to send in this message
flagsFlags indicating various conditions. NOT USED AT THIS TIME. Pass in zero (0).
Exceptions
LBMExceptionif any error occurred during sending.

References com.latencybusters.lbm.LBMSSource.send().

void com.latencybusters.lbm.LBMSSource.send ( ByteBuffer  message,
int  messageLength,
int  flags,
LBMSSourceSendExInfo  exinfo 
) throws LBMException

Send a message using a pre-allocated buffer to the topic associated with the LBM Smart Source.

See Smart Sources for more information. See also Smart Source Options for configuration information.

Parameters
messageData to send in this message. This must be a buffer retrieved via the buffGet() method from this SmartSource.
messageLengthNumber of bytes of data to send in this message
flagsFlags indicating various conditions. NOT USED AT THIS TIME. Pass in zero (0).
exinfoLBMSSourceSendExInfo object
Exceptions
LBMExceptionif any error occurred during sending.
See also
LBMSSourceSendExInfo
void com.latencybusters.lbm.LBMSSource.send ( ByteBuffer  message,
int  startPosition,
int  messageLength,
int  flags,
LBMSSourceSendExInfo  exinfo 
) throws LBMException

Send a message using a pre-allocated buffer to the topic associated with the LBM Smart Source.

See Smart Sources for more information. See also Smart Source Options for configuration information.

Parameters
messageData to send in this message. This must be a buffer retrieved via the buffGet() method from this SmartSource.
startPositionMust be set to 0
messageLengthNumber of bytes of data to send in this message
flagsFlags indicating various conditions. NOT USED AT THIS TIME. Pass in zero (0).
exinfoLBMSSourceSendExInfo object; used to set callback behavior flags and to pass back a user-supplied object. (UME only)
Exceptions
LBMExceptionif any error occurred during sending.
See also
LBMSSourceSendExInfo

References com.latencybusters.lbm.LBMSSource.send().

void com.latencybusters.lbm.LBMSSource.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.

Parameters
attributeNameName of the attribute to set
attributeValueNew attribute value
Exceptions
LBMExceptionif attributeName is not a valid attribute, or attributeValue is not a valid value for attributeName.
int com.latencybusters.lbm.LBMSSource.setSSrcInflight ( int  type,
LBMSetInflightCallback  setInflightCb,
Object  clientd 
) throws LBMException

Set the current inflight value for this smart source.

Parameters
typeThe type of flight size
See also
LBM::FLIGHT_SIZE_TYPE_UME
Parameters
setInflightCbObject that implements the LBMSetInflightCallback interface
clientdClientd object passed into the setInflight callback
Returns
the new inflight value
Exceptions
LBMExceptionif an error occurs while setting the inflight value

Referenced by com.latencybusters.lbm.LBMSSource.getSSrcInflight().

LBMFlightSizeInflightInfo com.latencybusters.lbm.LBMSSource.setSSrcInflightEx ( int  type,
LBMSetInflightCallback  setInflightCb,
Object  clientd 
) throws LBMException

Set the current inflight messages and bytes value for this smart source. The values are set from within the provided set inflight callback with appropriate locking held.

Parameters
typeThe type of flight size
See also
LBM::FLIGHT_SIZE_TYPE_UME
Parameters
setInflightCbObject that implements the LBMSetInflightCallback interface
clientdClientd object passed into the setInflight callback
Returns
the new inflight values
Exceptions
LBMExceptionif an error occurs while setting the inflight value

Referenced by com.latencybusters.lbm.LBMSSource.getSSrcInflightEx().

void com.latencybusters.lbm.LBMSSource.umederegister ( ) throws LBMException

Deregister this smart source

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

Exceptions
LBMExceptionif any error occurred during source deletion.

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