This is an abstract base class, and should be subclassed to override any appropriate non-functional methods, such as doneWith... or retrieve... (whose default implementation in the base class is to always return null). LBMObjectRecycler is provided as a basic general implementation of this class.
After being set in any of the UM attribute classes with the setObjectRecycler() method, UM uses the LBMObjectRecyclerBase internally, instead of automatically creating a new Object of the different supported types.
UM calls the appropriate retrieve method expecting either an object that it can use, or null. In the latter case UM creates the new object as if there were no recycler available. Once finished with an object, calling the appropriate doneWith method makes it available for future retrieve calls.
When implementing your own recycler from this parent class, note that the retrieve methods (below) are called from within the context thread as part of the callbacks. Hence, do not perform any unsafe API calls from within a retrieve method.

C# |
public abstract class LBMObjectRecyclerBase

All Members | Constructors | Methods | |||
Icon | Member | Description |
---|---|---|
![]() | LBMObjectRecyclerBase()()() | Initializes a new instance of the LBMObjectRecyclerBase class |
![]() | close()()() |
A method that should be overridden by derived classes, if needed, to provide a way to clean up objects
referenced by the recycler (like stats objects).
|
![]() | doneWithContextSourceEvent(LBMContextSourceEvent) |
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.
|
![]() | doneWithContextStatistics(LBMContextStatistics) |
Once the application is finished with the stats object, it should NOT call dispose but rather
should pass it to this method to make the object instance available for reuse, instead of letting
it be garbage collected.
|
![]() | doneWithEventQueueStatistics(LBMEventQueueStatistics) |
Once the application is finished with the stats object, it should NOT call dispose but rather
should pass it to this method to make the object instance available for reuse, instead of letting
it be garbage collected.
|
![]() | doneWithImmediateMessageReceiverStatistics(LBMImmediateMessageReceiverStatistics) |
Once the application is finished with the stats object, it should NOT call dispose but rather
should pass it to this method to make the object instance available for reuse, instead of letting
it be garbage collected.
|
![]() | doneWithImmediateMessageSourceStatistics(LBMImmediateMessageSourceStatistics) |
Once the application is finished with the stats object, it should NOT call dispose but rather
should pass it to this method to make the object instance available for reuse, instead of letting
it be garbage collected.
|
![]() | doneWithMessage(LBMMessage) |
If dispose is not called on an LBMMessage in the callback, it is retained for use in the application.
Once the application is finished with the LBMMessage, it should call dispose and then
pass it to this method to make it available for reuse, instead of letting it be garbage collected.
|
![]() | doneWithReceiverStatistics(LBMReceiverStatistics) |
Once the application is finished with the stats object, it should NOT call dispose but rather
should pass it to this method to make the object instance available for reuse, instead of letting
it be garbage collected.
|
![]() | doneWithSourceEvent(LBMSourceEvent) |
If dispose is not called on an LBMSourceEvent in the callback, it is retained for use in the application.
Once the application is finished with the LBMSourceEvent, it should call dispose and then
pass it to this method to make it available for reuse, instead of letting it be garbage collected.
|
![]() | doneWithSourceStatistics(LBMSourceStatistics) |
Once the application is finished with the stats object, it should NOT call dispose but rather
should pass it to this method to make the object instance available for reuse, instead of letting
it be garbage collected.
|
![]() | retrieveContextSourceEvent(Object) |
LBM will call this method to attempt to retrieve an LBMContextSourceEvent object instance that it can use
instead of creating a new instance to reduce garbage collection. It will reset the state of
the LBMContextSourceEvent once it is retrieved and then use it as if it were a new instance. Returning null
causes LBM to create a new instance as if there were no recycler.
|
![]() | retrieveContextStatistics(Object) |
LBM will call this method to attempt to retrieve a stats object instance that it can use instead of
creating a new instance to reduce garbage collection. It will refresh the stats object and then use it
as if it were a new instance. Returning null causes LBM to create a new instance as if there were
no recycler.
|
![]() | retrieveEventQueueStatistics(Object) |
LBM will call this method to attempt to retrieve a stats object instance that it can use instead of
creating a new instance to reduce garbage collection. It will refresh the stats object and then use it
as if it were a new instance. Returning null causes LBM to create a new instance as if there were
no recycler.
|
![]() | retrieveImmediateMessageReceiverStatistics(Object) |
LBM will call this method to attempt to retrieve a stats object instance that it can use instead of
creating a new instance to reduce garbage collection. It will refresh the stats object and then use it
as if it were a new instance. Returning null causes LBM to create a new instance as if there were
no recycler.
|
![]() | retrieveImmediateMessageSourceStatistics(Object) |
LBM will call this method to attempt to retrieve a stats object instance that it can use instead of
creating a new instance to reduce garbage collection. It will refresh the stats object and then use it
as if it were a new instance. Returning null causes LBM to create a new instance as if there were
no recycler.
|
![]() | retrieveMessage(Object) |
LBM will call this method to attempt to retrieve a LBMMessage object instance that it can use
instead of creating a new instance to reduce garbage collection. It will reset the state of
the LBMMessage once it is retrieved and then use it as if it were a new instance. Returning null
causes LBM to create a new instance as if there were no recycler.
|
![]() | retrieveReceiverStatistics(Object) |
LBM will call this method to attempt to retrieve a stats object instance that it can use instead of
creating a new instance to reduce garbage collection. It will refresh the stats object and then use it
as if it were a new instance. Returning null causes LBM to create a new instance as if there were
no recycler.
|
![]() | retrieveSourceEvent(Object) |
LBM will call this method to attempt to retrieve an LBMSourceEvent object instance that it can use
instead of creating a new instance to reduce garbage collection. It will reset the state of
the LBMSourceEvent once it is retrieved and then use it as if it were a new instance. Returning null
causes LBM to create a new instance as if there were no recycler.
|
![]() | retrieveSourceStatistics(Object) |
LBM will call this method to attempt to retrieve a stats object instance that it can use instead of
creating a new instance to reduce garbage collection. It will refresh the stats object and then use it
as if it were a new instance. Returning null causes LBM to create a new instance as if there were
no recycler.
|

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