UM Java API  6.16
com.latencybusters.lbm.LBMObjectRecycler Class Reference
Inheritance diagram for com.latencybusters.lbm.LBMObjectRecycler:
com.latencybusters.lbm.LBMObjectRecyclerBase

Public Member Functions

void setLocalMsgPoolSize (int size)
 
void setSharedMsgPoolSize (int size)
 
void doneWithMessage (LBMMessage obj)
 
LBMMessage retrieveMessage (Object cbObj)
 
int getLocalPoolMessageCount ()
 
int returnAllMessagesToSharedPool ()
 
void setLocalRcvStatsPoolSize (int size)
 
void setSharedRcvStatsPoolSize (int size)
 
void doneWithReceiverStatistics (LBMReceiverStatistics obj)
 
LBMReceiverStatistics retrieveReceiverStatistics (Object cbObj)
 
int getLocalPoolReceiverStatisticsCount ()
 
int returnAllReceiverStatisticsToSharedPool ()
 
void setLocalSrcStatsPoolSize (int size)
 
void setSharedSrcStatsPoolSize (int size)
 
void doneWithSourceStatistics (LBMSourceStatistics obj)
 
LBMSourceStatistics retrieveSourceStatistics (Object cbObj)
 
int getLocalPoolSourceStatisticsCount ()
 
int returnAllSourceStatisticsToSharedPool ()
 
void setLocalCtxStatsPoolSize (int size)
 
void setSharedCtxStatsPoolSize (int size)
 
void doneWithContextStatistics (LBMContextStatistics obj)
 
LBMContextStatistics retrieveContextStatistics (Object cbObj)
 
int getLocalPoolContextStatisticsCount ()
 
int returnAllContextStatisticsToSharedPool ()
 
void setLocalIMRcvStatsPoolSize (int size)
 
void setSharedIMRcvStatsPoolSize (int size)
 
void doneWithImmediateMessageReceiverStatistics (LBMImmediateMessageReceiverStatistics obj)
 
LBMImmediateMessageReceiverStatistics retrieveImmediateMessageReceiverStatistics (Object cbObj)
 
int getLocalPoolImmediateMessageReceiverStatisticsCount ()
 
int returnAllImmediateMessageReceiverStatisticsToSharedPool ()
 
void setLocalIMSrcStatsPoolSize (int size)
 
void setSharedIMSrcStatsPoolSize (int size)
 
void doneWithImmediateMessageSourceStatistics (LBMImmediateMessageSourceStatistics obj)
 
LBMImmediateMessageSourceStatistics retrieveImmediateMessageSourceStatistics (Object cbObj)
 
int getLocalPoolImmediateMessageSourceStatisticsCount ()
 
int returnAllImmediateMessageSourceStatisticsToSharedPool ()
 
void setLocalEvqStatsPoolSize (int size)
 
void setSharedEvqStatsPoolSize (int size)
 
void doneWithEventQueueStatistics (LBMEventQueueStatistics obj)
 
LBMEventQueueStatistics retrieveEventQueueStatistics (Object cbObj)
 
int getLocalPoolEventQueueStatisticsCount ()
 
int returnAllEventQueueStatisticsToSharedPool ()
 
void setLocalSrcEvPoolSize (int size)
 
void setSharedSrcEvPoolSize (int size)
 
void doneWithSourceEvent (LBMSourceEvent obj)
 
LBMSourceEvent retrieveSourceEvent (Object cbObj)
 
int getLocalPoolSourceEventCount ()
 
int returnAllSourceEventsToSharedPool ()
 
void setLocalCtxSrcEvPoolSize (int size)
 
void setSharedCtxSrcEvPoolSize (int size)
 
void doneWithContextSourceEvent (LBMContextSourceEvent obj)
 
LBMContextSourceEvent retrieveContextSourceEvent (Object cbObj)
 
int getLocalPoolContextSourceEventCount ()
 
int returnAllContextSourceEventsToSharedPool ()
 
void setLocalAsyncOpInfosPoolSize (int size)
 
void setSharedAsyncOpInfosPoolSize (int size)
 
void doneWithAsyncOperationInfo (LBMAsyncOperationInfo obj)
 
LBMAsyncOperationInfo retrieveAsyncOperationInfo (Object cbObj)
 
int getLocalPoolAsyncOperationInfoCount ()
 
int returnAllAsyncOperationInfosToSharedPool ()
 
void disposeThreadLocals ()
 
void close ()
 
void doneWithContextSourceEvent (LBMSourceEvent obj)
 

Detailed Description

Basic implementation of an object recycler that implements all supported LBM object types. The size limits for the object pools for each object type can be tuned and should be set immediately after instantiating the class and before using any instance of the class. This implementation is synchronized on a per object type basis(doneWithMessage/retrieveMessage, doneWithReceiverStatistics/retrieveReceiverStatistics, etc) via a thread local pool of objects and a synchronized shared pool of objects.

Member Function Documentation

void com.latencybusters.lbm.LBMObjectRecycler.close ( )
void com.latencybusters.lbm.LBMObjectRecycler.disposeThreadLocals ( )

A convenience method to clean up thread local variables if needed.

void com.latencybusters.lbm.LBMObjectRecycler.doneWithAsyncOperationInfo ( LBMAsyncOperationInfo  obj)

Call when finished with a LBMAsyncOperationInfo object. Do not call dispose on the async info object before passing to this method. If the local and shared object limit is reached, it will simply ignore the passed object which will result in it being garbage collected.

Parameters
objThe async info object
void com.latencybusters.lbm.LBMObjectRecyclerBase.doneWithContextSourceEvent ( LBMSourceEvent  obj)
inherited

If dispose is not called on an LBMContextSourceEvent in the callback, it is retained for use in the application. Once the application is finished with the LBMContextSourceEvent, it should call dispose and then pass it to this method to make it available for reuse, instead of letting it be garbage collected.

Parameters
objThe LBMContextSourceEvent object that the application is done with and is ready for reuse
void com.latencybusters.lbm.LBMObjectRecycler.doneWithContextSourceEvent ( LBMContextSourceEvent  obj)

Call when finished with a LBMContextSourceEvent object. Call dispose on the source event object before passing to this method. If the local and shared object size is reached, it will simply ignore the passed object which will result in it being garbage collected.

Parameters
objThe message object
void com.latencybusters.lbm.LBMObjectRecycler.doneWithContextStatistics ( LBMContextStatistics  obj)

Call when finished with a LBMContextStatistics object. Do not call dispose on the stats object before passing to this method. If the local and shared object size is reached, it will simply ignore the passed object which will result in it being garbage collected.

Parameters
objThe stats object
void com.latencybusters.lbm.LBMObjectRecycler.doneWithEventQueueStatistics ( LBMEventQueueStatistics  obj)

Call when finished with a LBMEventQueueStatistics object. Do not call dispose on the stats object before passing to this method. If the local and shared object limit is reached, it will simply ignore the passed object which will result in it being garbage collected.

Parameters
objThe stats object
void com.latencybusters.lbm.LBMObjectRecycler.doneWithImmediateMessageReceiverStatistics ( LBMImmediateMessageReceiverStatistics  obj)

Call when finished with a LBMImmediateMessageReceiverStatistics object. Do not call dispose on the stats object before passing to this method. If the local and shared object limit is reached, it will simply ignore the passed object which will result in it being garbage collected.

Parameters
objThe stats object
void com.latencybusters.lbm.LBMObjectRecycler.doneWithImmediateMessageSourceStatistics ( LBMImmediateMessageSourceStatistics  obj)

Call when finished with a LBMImmediateMessageSourceStatistics object. Do not call dispose on the stats object before passing to this method. If the local and shared object limit is reached, it will simply ignore the passed object which will result in it being garbage collected.

Parameters
objThe stats object
void com.latencybusters.lbm.LBMObjectRecycler.doneWithMessage ( LBMMessage  obj)

Call when finished with a LBMMessage object. Call dispose on the message object before passing to this method. If the local and shared object size is reached, it will simply ignore the passed object which will result in it being garbage collected.

Parameters
objThe message object
void com.latencybusters.lbm.LBMObjectRecycler.doneWithReceiverStatistics ( LBMReceiverStatistics  obj)

Call when finished with a LBMReceiverStatistics object. Do not call dispose on the stats object before passing to this method. If the local and shared object limit is reached, it will simply ignore the passed object which will result in it being garbage collected.

Parameters
objThe stats object
void com.latencybusters.lbm.LBMObjectRecycler.doneWithSourceEvent ( LBMSourceEvent  obj)

Call when finished with a LBMSourceEvent object. Call dispose on the source event object before passing to this method. If the local and shared object size is reached, it will simply ignore the passed object which will result in it being garbage collected.

Parameters
objThe message object
void com.latencybusters.lbm.LBMObjectRecycler.doneWithSourceStatistics ( LBMSourceStatistics  obj)

Call when finished with a LBMSourceStatistics object. Do not call dispose on the stats object before passing to this method. If the local and shared object limit is reached, it will simply ignore the passed object which will result in it being garbage collected.

Parameters
objThe stats object
int com.latencybusters.lbm.LBMObjectRecycler.getLocalPoolAsyncOperationInfoCount ( )

Gets the current number of objects in the local pool.

Returns
The number of objects
int com.latencybusters.lbm.LBMObjectRecycler.getLocalPoolContextSourceEventCount ( )

Gets the current number of objects in the local pool.

Returns
The number of objects
int com.latencybusters.lbm.LBMObjectRecycler.getLocalPoolContextStatisticsCount ( )

Gets the current number of objects in the local pool.

Returns
The number of objects
int com.latencybusters.lbm.LBMObjectRecycler.getLocalPoolEventQueueStatisticsCount ( )

Gets the current number of objects in the local pool.

Returns
The number of objects
int com.latencybusters.lbm.LBMObjectRecycler.getLocalPoolImmediateMessageReceiverStatisticsCount ( )

Gets the current number of objects in the local pool.

Returns
The number of objects
int com.latencybusters.lbm.LBMObjectRecycler.getLocalPoolImmediateMessageSourceStatisticsCount ( )

Gets the current number of objects in the local pool.

Returns
The number of objects
int com.latencybusters.lbm.LBMObjectRecycler.getLocalPoolMessageCount ( )

Gets the current number of objects in the local pool.

Returns
The number of objects
int com.latencybusters.lbm.LBMObjectRecycler.getLocalPoolReceiverStatisticsCount ( )

Gets the current number of objects in the local pool.

Returns
The number of objects
int com.latencybusters.lbm.LBMObjectRecycler.getLocalPoolSourceEventCount ( )

Gets the current number of objects in the local pool.

Returns
The number of objects
int com.latencybusters.lbm.LBMObjectRecycler.getLocalPoolSourceStatisticsCount ( )

Gets the current number of objects in the local pool.

Returns
The number of objects
LBMAsyncOperationInfo com.latencybusters.lbm.LBMObjectRecycler.retrieveAsyncOperationInfo ( Object  cbObj)

LBM will call this method to attempt to retrieve an object that it can reuse. It will transfer a batch of objects from the shared pool when the local pool gets low or will create the objects if the shared pool is empty.

Parameters
cbObjThe callback object token that was stored when setting LBMObjectRecycler in the attributes
Returns
A valid async info object will be returned
LBMContextSourceEvent com.latencybusters.lbm.LBMObjectRecycler.retrieveContextSourceEvent ( Object  cbObj)

LBM will call this method to attempt to retrieve an object that it can reuse. It will transfer a batch of objects from the shared pool when the local pool gets low or will create the objects if the shared pool is empty.

Parameters
cbObjThe callback object token that was stored when setting LBMObjectRecycler in the attributes
Returns
A valid object will be returned
LBMContextStatistics com.latencybusters.lbm.LBMObjectRecycler.retrieveContextStatistics ( Object  cbObj)

LBM will call this method to attempt to retrieve an object that it can reuse. It will transfer a batch of objects from the shared pool when the local pool gets low or will create the objects if the shared pool is empty.

Parameters
cbObjThe callback object token that was stored when setting LBMObjectRecycler in the attributes
Returns
A valid stats object will be returned
LBMEventQueueStatistics com.latencybusters.lbm.LBMObjectRecycler.retrieveEventQueueStatistics ( Object  cbObj)

LBM will call this method to attempt to retrieve an object that it can reuse. It will transfer a batch of objects from the shared pool when the local pool gets low or will create the objects if the shared pool is empty.

Parameters
cbObjThe callback object token that was stored when setting LBMObjectRecycler in the attributes
Returns
A valid stats object will be returned
LBMImmediateMessageReceiverStatistics com.latencybusters.lbm.LBMObjectRecycler.retrieveImmediateMessageReceiverStatistics ( Object  cbObj)

LBM will call this method to attempt to retrieve an object that it can reuse. It will transfer a batch of objects from the shared pool when the local pool gets low or will create the objects if the shared pool is empty.

Parameters
cbObjThe callback object token that was stored when setting LBMObjectRecycler in the attributes
Returns
A valid stats object will be returned
LBMImmediateMessageSourceStatistics com.latencybusters.lbm.LBMObjectRecycler.retrieveImmediateMessageSourceStatistics ( Object  cbObj)

LBM will call this method to attempt to retrieve an object that it can reuse. It will transfer a batch of objects from the shared pool when the local pool gets low or will create the objects if the shared pool is empty.

Parameters
cbObjThe callback object token that was stored when setting LBMObjectRecycler in the attributes
Returns
A valid stats object will be returned
LBMMessage com.latencybusters.lbm.LBMObjectRecycler.retrieveMessage ( Object  cbObj)

LBM will call this method to attempt to retrieve an object that it can reuse. It will transfer a batch of objects from the shared pool when the local pool gets low or will create the objects if the shared pool is empty.

Parameters
cbObjThe callback object token that was stored when setting LBMObjectRecycler in the attributes
Returns
A valid stats object will be returned
LBMReceiverStatistics com.latencybusters.lbm.LBMObjectRecycler.retrieveReceiverStatistics ( Object  cbObj)

LBM will call this method to attempt to retrieve an object that it can reuse. It will transfer a batch of objects from the shared pool when the local pool gets low or will create the objects if the shared pool is empty.

Parameters
cbObjThe callback object token that was stored when setting LBMObjectRecycler in the attributes
Returns
A valid stats object will be returned
LBMSourceEvent com.latencybusters.lbm.LBMObjectRecycler.retrieveSourceEvent ( Object  cbObj)

LBM will call this method to attempt to retrieve an object that it can reuse. It will transfer a batch of objects from the shared pool when the local pool gets low or will create the objects if the shared pool is empty.

Parameters
cbObjThe callback object token that was stored when setting LBMObjectRecycler in the attributes
Returns
A valid object will be returned
LBMSourceStatistics com.latencybusters.lbm.LBMObjectRecycler.retrieveSourceStatistics ( Object  cbObj)

LBM will call this method to attempt to retrieve an object that it can reuse. It will transfer a batch of objects from the shared pool when the local pool gets low or will create the objects if the shared pool is empty.

Parameters
cbObjThe callback object token that was stored when setting LBMObjectRecycler in the attributes
Returns
A valid stats object will be returned
int com.latencybusters.lbm.LBMObjectRecycler.returnAllAsyncOperationInfosToSharedPool ( )

Returns all of the objects in the local pool back to the shared pool. If the shared pool is full, the objects are still removed from the local pool but they are discarded and will be garbage collected (and are not counted in the return value as objects that were actually returned).

Returns
The number of objects actually returned
int com.latencybusters.lbm.LBMObjectRecycler.returnAllContextSourceEventsToSharedPool ( )

Returns all of the objects in the local pool back to the shared pool. If the shared pool is full, the objects are still removed from the local pool but they are discarded and will be garbage collected (and are not counted in the return value as objects that were actually returned).

Returns
The number of objects actually returned
int com.latencybusters.lbm.LBMObjectRecycler.returnAllContextStatisticsToSharedPool ( )

Returns all of the objects in the local pool back to the shared pool. If the shared pool is full, the objects are still removed from the local pool but they are discarded and will be garbage collected (and are not counted in the return value as objects that were actually returned).

Returns
The number of objects actually returned
int com.latencybusters.lbm.LBMObjectRecycler.returnAllEventQueueStatisticsToSharedPool ( )

Returns all of the objects in the local pool back to the shared pool. If the shared pool is full, the objects are still removed from the local pool but they are discarded and will be garbage collected (and are not counted in the return value as objects that were actually returned).

Returns
The number of objects actually returned
int com.latencybusters.lbm.LBMObjectRecycler.returnAllImmediateMessageReceiverStatisticsToSharedPool ( )

Returns all of the objects in the local pool back to the shared pool. If the shared pool is full, the objects are still removed from the local pool but they are discarded and will be garbage collected (and are not counted in the return value as objects that were actually returned).

Returns
The number of objects actually returned
int com.latencybusters.lbm.LBMObjectRecycler.returnAllImmediateMessageSourceStatisticsToSharedPool ( )

Returns all of the objects in the local pool back to the shared pool. If the shared pool is full, the objects are still removed from the local pool but they are discarded and will be garbage collected (and are not counted in the return value as objects that were actually returned).

Returns
The number of objects actually returned
int com.latencybusters.lbm.LBMObjectRecycler.returnAllMessagesToSharedPool ( )

Returns all of the objects in the local pool back to the shared pool. If the shared pool is full, the objects are still removed from the local pool but they are discarded and will be garbage collected (and are not counted in the return value as objects that were actually returned).

Returns
The number of objects actually returned
int com.latencybusters.lbm.LBMObjectRecycler.returnAllReceiverStatisticsToSharedPool ( )

Returns all of the objects in the local pool back to the shared pool. If the shared pool is full, the objects are still removed from the local pool but they are discarded and will be garbage collected (and are not counted in the return value as objects that were actually returned).

Returns
The number of objects actually returned
int com.latencybusters.lbm.LBMObjectRecycler.returnAllSourceEventsToSharedPool ( )

Returns all of the objects in the local pool back to the shared pool. If the shared pool is full, the objects are still removed from the local pool but they are discarded and will be garbage collected (and are not counted in the return value as objects that were actually returned).

Returns
The number of objects actually returned
int com.latencybusters.lbm.LBMObjectRecycler.returnAllSourceStatisticsToSharedPool ( )

Returns all of the objects in the local pool back to the shared pool. If the shared pool is full, the objects are still removed from the local pool but they are discarded and will be garbage collected (and are not counted in the return value as objects that were actually returned).

Returns
The number of objects actually returned
void com.latencybusters.lbm.LBMObjectRecycler.setLocalAsyncOpInfosPoolSize ( int  size)

Sets the size of the thread local pool of LBMAsyncOperationInfo for all LBMObjectRecyclers (defaults to 10)

Parameters
sizethe size of the local pool
void com.latencybusters.lbm.LBMObjectRecycler.setLocalCtxSrcEvPoolSize ( int  size)

Sets the size of the thread local pool of LBMContextSourceEvents for all LBMObjectRecyclers (defaults to 10)

Parameters
sizethe size of the local pool
void com.latencybusters.lbm.LBMObjectRecycler.setLocalCtxStatsPoolSize ( int  size)

Sets the size of the thread local pool of LBMContextStatistics for all LBMObjectRecyclers (defaults to 10)

Parameters
sizethe size of the local pool
void com.latencybusters.lbm.LBMObjectRecycler.setLocalEvqStatsPoolSize ( int  size)

Sets the size of the thread local pool of LBMEventQueueStatistics for all LBMObjectRecyclers (defaults to 10)

Parameters
sizethe size of the local pool
void com.latencybusters.lbm.LBMObjectRecycler.setLocalIMRcvStatsPoolSize ( int  size)

Sets the size of the thread local pool of LBMImmediateMessageReceiverStatistics for all LBMObjectRecyclers (defaults to 10)

Parameters
sizethe size of the local pool
void com.latencybusters.lbm.LBMObjectRecycler.setLocalIMSrcStatsPoolSize ( int  size)

Sets the size of the thread local pool of LBMImmediateMessageSourceStatistics for all LBMObjectRecyclers (defaults to 10)

Parameters
sizethe size of the local pool
void com.latencybusters.lbm.LBMObjectRecycler.setLocalMsgPoolSize ( int  size)

Sets the size of the thread local pool of LBMMessages for all LBMObjectRecyclers (defaults to 1000)

Parameters
sizethe size of the local pool
void com.latencybusters.lbm.LBMObjectRecycler.setLocalRcvStatsPoolSize ( int  size)

Sets the size of the thread local pool of LBMReceiverStatistics for all LBMObjectRecyclers (defaults to 10)

Parameters
sizethe size of the local pool
void com.latencybusters.lbm.LBMObjectRecycler.setLocalSrcEvPoolSize ( int  size)

Sets the size of the thread local pool of LBMSourceEvents for all LBMObjectRecyclers (defaults to 10)

Parameters
sizethe size of the local pool
void com.latencybusters.lbm.LBMObjectRecycler.setLocalSrcStatsPoolSize ( int  size)

Sets the size of the thread local pool of LBMSourceStatistics for all LBMObjectRecyclers (defaults to 10)

Parameters
sizethe size of the local pool
void com.latencybusters.lbm.LBMObjectRecycler.setSharedAsyncOpInfosPoolSize ( int  size)

Sets the size of the shared pool of LBMAsyncOperationInfo for all LBMObjectRecyclers (defaults to 20)

Parameters
sizethe size of the shared pool
void com.latencybusters.lbm.LBMObjectRecycler.setSharedCtxSrcEvPoolSize ( int  size)

Sets the size of the shared pool of LBMContextSourceEvents for all LBMObjectRecyclers (defaults to 20)

Parameters
sizethe size of the shared pool
void com.latencybusters.lbm.LBMObjectRecycler.setSharedCtxStatsPoolSize ( int  size)

Sets the size of the shared pool of LBMContextStatistics for all LBMObjectRecyclers (defaults to 20)

Parameters
sizethe size of the shared pool
void com.latencybusters.lbm.LBMObjectRecycler.setSharedEvqStatsPoolSize ( int  size)

Sets the size of the shared pool of LBMEventQueueStatistics for all LBMObjectRecyclers (defaults to 20)

Parameters
sizethe size of the shared pool
void com.latencybusters.lbm.LBMObjectRecycler.setSharedIMRcvStatsPoolSize ( int  size)

Sets the size of the shared pool of LBMImmediateMessageReceiverStatistics for all LBMObjectRecyclers (defaults to 20)

Parameters
sizethe size of the shared pool
void com.latencybusters.lbm.LBMObjectRecycler.setSharedIMSrcStatsPoolSize ( int  size)

Sets the size of the shared pool of LBMImmediateMessageSourceStatistics for all LBMObjectRecyclers (defaults to 20)

Parameters
sizethe size of the shared pool
void com.latencybusters.lbm.LBMObjectRecycler.setSharedMsgPoolSize ( int  size)

Sets the size of the shared pool of LBMMessages for all LBMObjectRecyclers (defaults to 2000)

Parameters
sizethe size of the shared pool
void com.latencybusters.lbm.LBMObjectRecycler.setSharedRcvStatsPoolSize ( int  size)

Sets the size of the shared pool of LBMReceiverStatistics for all LBMObjectRecyclers (defaults to 20)

Parameters
sizethe size of the shared pool
void com.latencybusters.lbm.LBMObjectRecycler.setSharedSrcEvPoolSize ( int  size)

Sets the size of the shared pool of LBMSourceEvents for all LBMObjectRecyclers (defaults to 20)

Parameters
sizethe size of the shared pool
void com.latencybusters.lbm.LBMObjectRecycler.setSharedSrcStatsPoolSize ( int  size)

Sets the size of the shared pool of LBMSourceStatistics for all LBMObjectRecyclers (defaults to 20)

Parameters
sizethe size of the shared pool

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