|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.latencybusters.lbm.LBMObjectRecyclerBase
com.latencybusters.lbm.LBMObjectRecycler
public class LBMObjectRecycler
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.
Constructor Summary | |
---|---|
LBMObjectRecycler()
|
Method Summary | |
---|---|
void |
close()
A method to clean up all objects referenced by the recycler when the application is closing (which will dispose all of the stats objects in the recycler). |
void |
disposeThreadLocals()
A convenience method to clean up thread local variables if needed. |
void |
doneWithAsyncOperationInfo(LBMAsyncOperationInfo obj)
Call when finished with a LBMAsyncOperationInfo object. |
void |
doneWithContextSourceEvent(LBMContextSourceEvent obj)
Call when finished with a LBMContextSourceEvent object. |
void |
doneWithContextStatistics(LBMContextStatistics obj)
Call when finished with a LBMContextStatistics object. |
void |
doneWithEventQueueStatistics(LBMEventQueueStatistics obj)
Call when finished with a LBMEventQueueStatistics object. |
void |
doneWithImmediateMessageReceiverStatistics(LBMImmediateMessageReceiverStatistics obj)
Call when finished with a LBMImmediateMessageReceiverStatistics object. |
void |
doneWithImmediateMessageSourceStatistics(LBMImmediateMessageSourceStatistics obj)
Call when finished with a LBMImmediateMessageSourceStatistics object. |
void |
doneWithMessage(LBMMessage obj)
Call when finished with a LBMMessage object. |
void |
doneWithReceiverStatistics(LBMReceiverStatistics obj)
Call when finished with a LBMReceiverStatistics object. |
void |
doneWithSourceEvent(LBMSourceEvent obj)
Call when finished with a LBMSourceEvent object. |
void |
doneWithSourceStatistics(LBMSourceStatistics obj)
Call when finished with a LBMSourceStatistics object. |
int |
getLocalPoolAsyncOperationInfoCount()
Gets the current number of objects in the local pool. |
int |
getLocalPoolContextSourceEventCount()
Gets the current number of objects in the local pool. |
int |
getLocalPoolContextStatisticsCount()
Gets the current number of objects in the local pool. |
int |
getLocalPoolEventQueueStatisticsCount()
Gets the current number of objects in the local pool. |
int |
getLocalPoolImmediateMessageReceiverStatisticsCount()
Gets the current number of objects in the local pool. |
int |
getLocalPoolImmediateMessageSourceStatisticsCount()
Gets the current number of objects in the local pool. |
int |
getLocalPoolMessageCount()
Gets the current number of objects in the local pool. |
int |
getLocalPoolReceiverStatisticsCount()
Gets the current number of objects in the local pool. |
int |
getLocalPoolSourceEventCount()
Gets the current number of objects in the local pool. |
int |
getLocalPoolSourceStatisticsCount()
Gets the current number of objects in the local pool. |
LBMAsyncOperationInfo |
retrieveAsyncOperationInfo(java.lang.Object cbObj)
LBM will call this method to attempt to retrieve an object that it can reuse. |
LBMContextSourceEvent |
retrieveContextSourceEvent(java.lang.Object cbObj)
LBM will call this method to attempt to retrieve an object that it can reuse. |
LBMContextStatistics |
retrieveContextStatistics(java.lang.Object cbObj)
LBM will call this method to attempt to retrieve an object that it can reuse. |
LBMEventQueueStatistics |
retrieveEventQueueStatistics(java.lang.Object cbObj)
LBM will call this method to attempt to retrieve an object that it can reuse. |
LBMImmediateMessageReceiverStatistics |
retrieveImmediateMessageReceiverStatistics(java.lang.Object cbObj)
LBM will call this method to attempt to retrieve an object that it can reuse. |
LBMImmediateMessageSourceStatistics |
retrieveImmediateMessageSourceStatistics(java.lang.Object cbObj)
LBM will call this method to attempt to retrieve an object that it can reuse. |
LBMMessage |
retrieveMessage(java.lang.Object cbObj)
LBM will call this method to attempt to retrieve an object that it can reuse. |
LBMReceiverStatistics |
retrieveReceiverStatistics(java.lang.Object cbObj)
LBM will call this method to attempt to retrieve an object that it can reuse. |
LBMSourceEvent |
retrieveSourceEvent(java.lang.Object cbObj)
LBM will call this method to attempt to retrieve an object that it can reuse. |
LBMSourceStatistics |
retrieveSourceStatistics(java.lang.Object cbObj)
LBM will call this method to attempt to retrieve an object that it can reuse. |
int |
returnAllAsyncOperationInfosToSharedPool()
Returns all of the objects in the local pool back to the shared pool. |
int |
returnAllContextSourceEventsToSharedPool()
Returns all of the objects in the local pool back to the shared pool. |
int |
returnAllContextStatisticsToSharedPool()
Returns all of the objects in the local pool back to the shared pool. |
int |
returnAllEventQueueStatisticsToSharedPool()
Returns all of the objects in the local pool back to the shared pool. |
int |
returnAllImmediateMessageReceiverStatisticsToSharedPool()
Returns all of the objects in the local pool back to the shared pool. |
int |
returnAllImmediateMessageSourceStatisticsToSharedPool()
Returns all of the objects in the local pool back to the shared pool. |
int |
returnAllMessagesToSharedPool()
Returns all of the objects in the local pool back to the shared pool. |
int |
returnAllReceiverStatisticsToSharedPool()
Returns all of the objects in the local pool back to the shared pool. |
int |
returnAllSourceEventsToSharedPool()
Returns all of the objects in the local pool back to the shared pool. |
int |
returnAllSourceStatisticsToSharedPool()
Returns all of the objects in the local pool back to the shared pool. |
void |
setLocalAsyncOpInfosPoolSize(int size)
Sets the size of the thread local pool of LBMAsyncOperationInfo for all LBMObjectRecyclers (defaults to 10) |
void |
setLocalCtxSrcEvPoolSize(int size)
Sets the size of the thread local pool of LBMContextSourceEvents for all LBMObjectRecyclers (defaults to 10) |
void |
setLocalCtxStatsPoolSize(int size)
Sets the size of the thread local pool of LBMContextStatistics for all LBMObjectRecyclers (defaults to 10) |
void |
setLocalEvqStatsPoolSize(int size)
Sets the size of the thread local pool of LBMEventQueueStatistics for all LBMObjectRecyclers (defaults to 10) |
void |
setLocalIMRcvStatsPoolSize(int size)
Sets the size of the thread local pool of LBMImmediateMessageReceiverStatistics for all LBMObjectRecyclers (defaults to 10) |
void |
setLocalIMSrcStatsPoolSize(int size)
Sets the size of the thread local pool of LBMImmediateMessageSourceStatistics for all LBMObjectRecyclers (defaults to 10) |
void |
setLocalMsgPoolSize(int size)
Sets the size of the thread local pool of LBMMessages for all LBMObjectRecyclers (defaults to 1000) |
void |
setLocalRcvStatsPoolSize(int size)
Sets the size of the thread local pool of LBMReceiverStatistics for all LBMObjectRecyclers (defaults to 10) |
void |
setLocalSrcEvPoolSize(int size)
Sets the size of the thread local pool of LBMSourceEvents for all LBMObjectRecyclers (defaults to 10) |
void |
setLocalSrcStatsPoolSize(int size)
Sets the size of the thread local pool of LBMSourceStatistics for all LBMObjectRecyclers (defaults to 10) |
void |
setSharedAsyncOpInfosPoolSize(int size)
Sets the size of the shared pool of LBMAsyncOperationInfo for all LBMObjectRecyclers (defaults to 20) |
void |
setSharedCtxSrcEvPoolSize(int size)
Sets the size of the shared pool of LBMContextSourceEvents for all LBMObjectRecyclers (defaults to 20) |
void |
setSharedCtxStatsPoolSize(int size)
Sets the size of the shared pool of LBMContextStatistics for all LBMObjectRecyclers (defaults to 20) |
void |
setSharedEvqStatsPoolSize(int size)
Sets the size of the shared pool of LBMEventQueueStatistics for all LBMObjectRecyclers (defaults to 20) |
void |
setSharedIMRcvStatsPoolSize(int size)
Sets the size of the shared pool of LBMImmediateMessageReceiverStatistics for all LBMObjectRecyclers (defaults to 20) |
void |
setSharedIMSrcStatsPoolSize(int size)
Sets the size of the shared pool of LBMImmediateMessageSourceStatistics for all LBMObjectRecyclers (defaults to 20) |
void |
setSharedMsgPoolSize(int size)
Sets the size of the shared pool of LBMMessages for all LBMObjectRecyclers (defaults to 2000) |
void |
setSharedRcvStatsPoolSize(int size)
Sets the size of the shared pool of LBMReceiverStatistics for all LBMObjectRecyclers (defaults to 20) |
void |
setSharedSrcEvPoolSize(int size)
Sets the size of the shared pool of LBMSourceEvents for all LBMObjectRecyclers (defaults to 20) |
void |
setSharedSrcStatsPoolSize(int size)
Sets the size of the shared pool of LBMSourceStatistics for all LBMObjectRecyclers (defaults to 20) |
Methods inherited from class com.latencybusters.lbm.LBMObjectRecyclerBase |
---|
doneWithContextSourceEvent |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public LBMObjectRecycler()
Method Detail |
---|
public void setLocalMsgPoolSize(int size)
size
- the size of the local poolpublic void setSharedMsgPoolSize(int size)
size
- the size of the shared poolpublic void doneWithMessage(LBMMessage obj)
doneWithMessage
in class LBMObjectRecyclerBase
obj
- The message objectpublic LBMMessage retrieveMessage(java.lang.Object cbObj)
retrieveMessage
in class LBMObjectRecyclerBase
cbObj
- The callback object token that was stored when setting LBMObjectRecycler in the attributes
public int getLocalPoolMessageCount()
public int returnAllMessagesToSharedPool()
public void setLocalRcvStatsPoolSize(int size)
size
- the size of the local poolpublic void setSharedRcvStatsPoolSize(int size)
size
- the size of the shared poolpublic void doneWithReceiverStatistics(LBMReceiverStatistics obj)
doneWithReceiverStatistics
in class LBMObjectRecyclerBase
obj
- The stats objectpublic LBMReceiverStatistics retrieveReceiverStatistics(java.lang.Object cbObj)
retrieveReceiverStatistics
in class LBMObjectRecyclerBase
cbObj
- The callback object token that was stored when setting LBMObjectRecycler in the attributes
public int getLocalPoolReceiverStatisticsCount()
public int returnAllReceiverStatisticsToSharedPool()
public void setLocalSrcStatsPoolSize(int size)
size
- the size of the local poolpublic void setSharedSrcStatsPoolSize(int size)
size
- the size of the shared poolpublic void doneWithSourceStatistics(LBMSourceStatistics obj)
doneWithSourceStatistics
in class LBMObjectRecyclerBase
obj
- The stats objectpublic LBMSourceStatistics retrieveSourceStatistics(java.lang.Object cbObj)
retrieveSourceStatistics
in class LBMObjectRecyclerBase
cbObj
- The callback object token that was stored when setting LBMObjectRecycler in the attributes
public int getLocalPoolSourceStatisticsCount()
public int returnAllSourceStatisticsToSharedPool()
public void setLocalCtxStatsPoolSize(int size)
size
- the size of the local poolpublic void setSharedCtxStatsPoolSize(int size)
size
- the size of the shared poolpublic void doneWithContextStatistics(LBMContextStatistics obj)
doneWithContextStatistics
in class LBMObjectRecyclerBase
obj
- The stats objectpublic LBMContextStatistics retrieveContextStatistics(java.lang.Object cbObj)
retrieveContextStatistics
in class LBMObjectRecyclerBase
cbObj
- The callback object token that was stored when setting LBMObjectRecycler in the attributes
public int getLocalPoolContextStatisticsCount()
public int returnAllContextStatisticsToSharedPool()
public void setLocalIMRcvStatsPoolSize(int size)
size
- the size of the local poolpublic void setSharedIMRcvStatsPoolSize(int size)
size
- the size of the shared poolpublic void doneWithImmediateMessageReceiverStatistics(LBMImmediateMessageReceiverStatistics obj)
doneWithImmediateMessageReceiverStatistics
in class LBMObjectRecyclerBase
obj
- The stats objectpublic LBMImmediateMessageReceiverStatistics retrieveImmediateMessageReceiverStatistics(java.lang.Object cbObj)
retrieveImmediateMessageReceiverStatistics
in class LBMObjectRecyclerBase
cbObj
- The callback object token that was stored when setting LBMObjectRecycler in the attributes
public int getLocalPoolImmediateMessageReceiverStatisticsCount()
public int returnAllImmediateMessageReceiverStatisticsToSharedPool()
public void setLocalIMSrcStatsPoolSize(int size)
size
- the size of the local poolpublic void setSharedIMSrcStatsPoolSize(int size)
size
- the size of the shared poolpublic void doneWithImmediateMessageSourceStatistics(LBMImmediateMessageSourceStatistics obj)
doneWithImmediateMessageSourceStatistics
in class LBMObjectRecyclerBase
obj
- The stats objectpublic LBMImmediateMessageSourceStatistics retrieveImmediateMessageSourceStatistics(java.lang.Object cbObj)
retrieveImmediateMessageSourceStatistics
in class LBMObjectRecyclerBase
cbObj
- The callback object token that was stored when setting LBMObjectRecycler in the attributes
public int getLocalPoolImmediateMessageSourceStatisticsCount()
public int returnAllImmediateMessageSourceStatisticsToSharedPool()
public void setLocalEvqStatsPoolSize(int size)
size
- the size of the local poolpublic void setSharedEvqStatsPoolSize(int size)
size
- the size of the shared poolpublic void doneWithEventQueueStatistics(LBMEventQueueStatistics obj)
doneWithEventQueueStatistics
in class LBMObjectRecyclerBase
obj
- The stats objectpublic LBMEventQueueStatistics retrieveEventQueueStatistics(java.lang.Object cbObj)
retrieveEventQueueStatistics
in class LBMObjectRecyclerBase
cbObj
- The callback object token that was stored when setting LBMObjectRecycler in the attributes
public int getLocalPoolEventQueueStatisticsCount()
public int returnAllEventQueueStatisticsToSharedPool()
public void setLocalSrcEvPoolSize(int size)
size
- the size of the local poolpublic void setSharedSrcEvPoolSize(int size)
size
- the size of the shared poolpublic void doneWithSourceEvent(LBMSourceEvent obj)
doneWithSourceEvent
in class LBMObjectRecyclerBase
obj
- The message objectpublic LBMSourceEvent retrieveSourceEvent(java.lang.Object cbObj)
retrieveSourceEvent
in class LBMObjectRecyclerBase
cbObj
- The callback object token that was stored when setting LBMObjectRecycler in the attributes
public int getLocalPoolSourceEventCount()
public int returnAllSourceEventsToSharedPool()
public void setLocalCtxSrcEvPoolSize(int size)
size
- the size of the local poolpublic void setSharedCtxSrcEvPoolSize(int size)
size
- the size of the shared poolpublic void doneWithContextSourceEvent(LBMContextSourceEvent obj)
obj
- The message objectpublic LBMContextSourceEvent retrieveContextSourceEvent(java.lang.Object cbObj)
retrieveContextSourceEvent
in class LBMObjectRecyclerBase
cbObj
- The callback object token that was stored when setting LBMObjectRecycler in the attributes
public int getLocalPoolContextSourceEventCount()
public int returnAllContextSourceEventsToSharedPool()
public void setLocalAsyncOpInfosPoolSize(int size)
size
- the size of the local poolpublic void setSharedAsyncOpInfosPoolSize(int size)
size
- the size of the shared poolpublic void doneWithAsyncOperationInfo(LBMAsyncOperationInfo obj)
doneWithAsyncOperationInfo
in class LBMObjectRecyclerBase
obj
- The async info objectpublic LBMAsyncOperationInfo retrieveAsyncOperationInfo(java.lang.Object cbObj)
retrieveAsyncOperationInfo
in class LBMObjectRecyclerBase
cbObj
- The callback object token that was stored when setting LBMObjectRecycler in the attributes
public int getLocalPoolAsyncOperationInfoCount()
public int returnAllAsyncOperationInfosToSharedPool()
public void disposeThreadLocals()
public void close()
close
in class LBMObjectRecyclerBase
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |