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.

C# |
public class LBMObjectRecycler : LBMObjectRecyclerBase

All Members | Constructors | Methods | |||
Icon | Member | Description |
---|---|---|
![]() | LBMObjectRecycler()()() | Initializes a new instance of the LBMObjectRecycler class |
![]() | 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).
(Overrides LBMObjectRecyclerBase.close()()().) |
![]() | doneWithContextSourceEvent(LBMContextSourceEvent) |
Call when finished with a LBMContextSourceEvent object. If the local and shared object limit is reached,
it will simply ignore the passed object which will result in it being garbage collected.
(Overrides LBMObjectRecyclerBase.doneWithContextSourceEvent(LBMContextSourceEvent).) |
![]() | doneWithContextStatistics(LBMContextStatistics) |
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 limit is reached,
it will simply ignore the passed object which will result in it being garbage collected.
(Overrides LBMObjectRecyclerBase.doneWithContextStatistics(LBMContextStatistics).) |
![]() | doneWithEventQueueStatistics(LBMEventQueueStatistics) |
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.
(Overrides LBMObjectRecyclerBase.doneWithEventQueueStatistics(LBMEventQueueStatistics).) |
![]() | doneWithImmediateMessageReceiverStatistics(LBMImmediateMessageReceiverStatistics) |
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.
(Overrides LBMObjectRecyclerBase.doneWithImmediateMessageReceiverStatistics(LBMImmediateMessageReceiverStatistics).) |
![]() | doneWithImmediateMessageSourceStatistics(LBMImmediateMessageSourceStatistics) |
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.
(Overrides LBMObjectRecyclerBase.doneWithImmediateMessageSourceStatistics(LBMImmediateMessageSourceStatistics).) |
![]() | doneWithMessage(LBMMessage) |
Call when finished with a LBMMessage object. Call dispose on the message 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.
(Overrides LBMObjectRecyclerBase.doneWithMessage(LBMMessage).) |
![]() | doneWithReceiverStatistics(LBMReceiverStatistics) |
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.
(Overrides LBMObjectRecyclerBase.doneWithReceiverStatistics(LBMReceiverStatistics).) |
![]() | doneWithSourceEvent(LBMSourceEvent) |
Call when finished with a LBMSourceEvent object. If the local and shared object limit is reached,
it will simply ignore the passed object which will result in it being garbage collected.
(Overrides LBMObjectRecyclerBase.doneWithSourceEvent(LBMSourceEvent).) |
![]() | doneWithSourceStatistics(LBMSourceStatistics) |
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.
(Overrides LBMObjectRecyclerBase.doneWithSourceStatistics(LBMSourceStatistics).) |
![]() | getLocalPoolContextSourceEventCount()()() |
Gets the current number of objects in the local pool.
|
![]() | getLocalPoolContextStatisticsCount()()() |
Gets the current number of objects in the local pool.
|
![]() | getLocalPoolEventQueueStatisticsCount()()() |
Gets the current number of objects in the local pool.
|
![]() | getLocalPoolImmediateMessageReceiverStatisticsCount()()() |
Gets the current number of objects in the local pool.
|
![]() | getLocalPoolImmediateMessageSourceStatisticsCount()()() |
Gets the current number of objects in the local pool.
|
![]() | getLocalPoolMessageCount()()() |
Gets the current number of objects in the local pool.
|
![]() | getLocalPoolReceiverStatisticsCount()()() |
Gets the current number of objects in the local pool.
|
![]() | getLocalPoolSourceEventCount()()() |
Gets the current number of objects in the local pool.
|
![]() | getLocalPoolSourceStatisticsCount()()() |
Gets the current number of objects in the local pool.
|
![]() | retrieveContextSourceEvent(Object) |
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.
(Overrides LBMObjectRecyclerBase.retrieveContextSourceEvent(Object).) |
![]() | retrieveContextStatistics(Object) |
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.
(Overrides LBMObjectRecyclerBase.retrieveContextStatistics(Object).) |
![]() | retrieveEventQueueStatistics(Object) |
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.
(Overrides LBMObjectRecyclerBase.retrieveEventQueueStatistics(Object).) |
![]() | retrieveImmediateMessageReceiverStatistics(Object) |
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.
(Overrides LBMObjectRecyclerBase.retrieveImmediateMessageReceiverStatistics(Object).) |
![]() | retrieveImmediateMessageSourceStatistics(Object) |
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.
(Overrides LBMObjectRecyclerBase.retrieveImmediateMessageSourceStatistics(Object).) |
![]() | retrieveMessage(Object) |
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.
(Overrides LBMObjectRecyclerBase.retrieveMessage(Object).) |
![]() | retrieveReceiverStatistics(Object) |
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.
(Overrides LBMObjectRecyclerBase.retrieveReceiverStatistics(Object).) |
![]() | retrieveSourceEvent(Object) |
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.
(Overrides LBMObjectRecyclerBase.retrieveSourceEvent(Object).) |
![]() | retrieveSourceStatistics(Object) |
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.
(Overrides LBMObjectRecyclerBase.retrieveSourceStatistics(Object).) |
![]() | 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).
|
![]() | 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).
|
![]() | 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).
|
![]() | 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).
|
![]() | 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).
|
![]() | 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).
|
![]() | 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).
|
![]() | 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).
|
![]() | 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).
|
![]() | setLocalCtxSrcEvsPoolSize(Int32) |
Sets the size of the thread local pool of LBMContextSourceEvents for all LBMObjectRecyclers
(defaults to 10)
|
![]() | setLocalCtxStatsPoolSize(Int32) |
Sets the size of the thread local pool of LBMContextStatistics for all LBMObjectRecyclers
(defaults to 10)
|
![]() | setLocalEvqStatsPoolSize(Int32) |
Sets the size of the thread local pool of LBMEventQueueStatistics for all LBMObjectRecyclers
(defaults to 10)
|
![]() | setLocalIMRcvStatsPoolSize(Int32) |
Sets the size of the thread local pool of LBMImmediateMessageReceiverStatistics for all LBMObjectRecyclers
(defaults to 10)
|
![]() | setLocalIMSrcStatsPoolSize(Int32) |
Sets the size of the thread local pool of LBMImmediateMessageSourceStatistics for all LBMObjectRecyclers
(defaults to 10)
|
![]() | setLocalMsgPoolSize(Int32) |
Sets the size of the thread local pool of LBMMessages for all LBMObjectRecyclers
(defaults to 1000)
|
![]() | setLocalRcvStatsPoolSize(Int32) |
Sets the size of the thread local pool of LBMReceiverStatistics for all LBMObjectRecyclers
(defaults to 10)
|
![]() | setLocalSrcEvsPoolSize(Int32) |
Sets the size of the thread local pool of LBMSourceEvents for all LBMObjectRecyclers
(defaults to 10)
|
![]() | setLocalSrcStatsPoolSize(Int32) |
Sets the size of the thread local pool of LBMSourceStatistics for all LBMObjectRecyclers
(defaults to 10)
|
![]() | setSharedCtxSrcEvsPoolSize(Int32) |
Sets the size of the shared pool of LBMContextSourceEvents for all LBMObjectRecyclers
(defaults to 20)
|
![]() | setSharedCtxStatsPoolSize(Int32) |
Sets the size of the shared pool of LBMContextStatistics for all LBMObjectRecyclers
(defaults to 20)
|
![]() | setSharedEvqStatsPoolSize(Int32) |
Sets the size of the shared pool of LBMEventQueueStatistics for all LBMObjectRecyclers
(defaults to 20)
|
![]() | setSharedIMRcvStatsPoolSize(Int32) |
Sets the size of the shared pool of LBMImmediateMessageReceiverStatistics for all LBMObjectRecyclers
(defaults to 20)
|
![]() | setSharedIMSrcStatsPoolSize(Int32) |
Sets the size of the shared pool of LBMImmediateMessageSourceStatistics for all LBMObjectRecyclers
(defaults to 20)
|
![]() | setSharedMsgPoolSize(Int32) |
Sets the size of the shared pool of LBMMessages for all LBMObjectRecyclers
(defaults to 2000)
|
![]() | setSharedRcvStatsPoolSize(Int32) |
Sets the size of the shared pool of LBMReceiverStatistics for all LBMObjectRecyclers
(defaults to 20)
|
![]() | setSharedSrcEvsPoolSize(Int32) |
Sets the size of the shared pool of LBMSourceEvents for all LBMObjectRecyclers
(defaults to 20)
|
![]() | setSharedSrcStatsPoolSize(Int32) |
Sets the size of the shared pool of LBMSourceStatistics for all LBMObjectRecyclers
(defaults to 20)
|

Object | ||
![]() | LBMObjectRecyclerBase | |
![]() | LBMObjectRecycler |