com.latencybusters.lbm
Class LBMObjectRecyclerBase

java.lang.Object
  extended by com.latencybusters.lbm.LBMObjectRecyclerBase
Direct Known Subclasses:
LBMObjectRecycler

public abstract class LBMObjectRecyclerBase
extends java.lang.Object

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.

See Also:
LBMObjectRecycler

Constructor Summary
LBMObjectRecyclerBase()
           
 
Method Summary
 void 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).
 void doneWithAsyncOperationInfo(LBMAsyncOperationInfo obj)
          If dispose is not called on an LBMAsyncOperationInfo in the callback, it is retained for use in the application.
 void doneWithContextSourceEvent(LBMSourceEvent obj)
          If dispose is not called on an LBMContextSourceEvent in the callback, it is retained for use in the application.
 void doneWithContextStatistics(LBMContextStatistics obj)
          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.
 void doneWithEventQueueStatistics(LBMEventQueueStatistics obj)
          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.
 void doneWithImmediateMessageReceiverStatistics(LBMImmediateMessageReceiverStatistics obj)
          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.
 void doneWithImmediateMessageSourceStatistics(LBMImmediateMessageSourceStatistics obj)
          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.
 void doneWithMessage(LBMMessage obj)
          If dispose is not called on an LBMMessage in the callback, it is retained for use in the application.
 void doneWithReceiverStatistics(LBMReceiverStatistics obj)
          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.
 void doneWithSourceEvent(LBMSourceEvent obj)
          If dispose is not called on an LBMSourceEvent in the callback, it is retained for use in the application.
 void doneWithSourceStatistics(LBMSourceStatistics obj)
          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.
 LBMAsyncOperationInfo retrieveAsyncOperationInfo(java.lang.Object cbObj)
          LBM will call this method to attempt to retrieve an LBMAsyncOperationInfo object instance that it can use instead of creating a new instance to reduce garbage collection.
 LBMContextSourceEvent retrieveContextSourceEvent(java.lang.Object cbObj)
          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.
 LBMContextStatistics retrieveContextStatistics(java.lang.Object cbObj)
          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.
 LBMEventQueueStatistics retrieveEventQueueStatistics(java.lang.Object cbObj)
          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.
 LBMImmediateMessageReceiverStatistics retrieveImmediateMessageReceiverStatistics(java.lang.Object cbObj)
          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.
 LBMImmediateMessageSourceStatistics retrieveImmediateMessageSourceStatistics(java.lang.Object cbObj)
          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.
 LBMMessage retrieveMessage(java.lang.Object cbObj)
          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.
 LBMReceiverStatistics retrieveReceiverStatistics(java.lang.Object cbObj)
          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.
 LBMSourceEvent retrieveSourceEvent(java.lang.Object cbObj)
          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.
 LBMSourceStatistics retrieveSourceStatistics(java.lang.Object cbObj)
          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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LBMObjectRecyclerBase

public LBMObjectRecyclerBase()
Method Detail

doneWithMessage

public void doneWithMessage(LBMMessage obj)
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.

Parameters:
obj - The LBMMessage object that the application is done with and is ready for reuse

retrieveMessage

public LBMMessage retrieveMessage(java.lang.Object cbObj)
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.

Parameters:
cbObj - The callback object token that was stored when setting LBMObjectRecycler in the attributes
Returns:
Either null or a valid LBMMessage object will be returned

doneWithReceiverStatistics

public void doneWithReceiverStatistics(LBMReceiverStatistics obj)
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.

Parameters:
obj - The LBMReceiverStatistics object that the application is done with and is ready for reuse

retrieveReceiverStatistics

public LBMReceiverStatistics retrieveReceiverStatistics(java.lang.Object cbObj)
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.

Parameters:
cbObj - The callback object token that was stored when setting LBMObjectRecycler in the attributes
Returns:
Either null or a valid LBMReceiverStatistics object will be returned

doneWithSourceStatistics

public void doneWithSourceStatistics(LBMSourceStatistics obj)
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.

Parameters:
obj - The LBMSourceStatistics object that the application is done with and is ready for reuse

retrieveSourceStatistics

public LBMSourceStatistics retrieveSourceStatistics(java.lang.Object cbObj)
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.

Parameters:
cbObj - The callback object token that was stored when setting LBMObjectRecycler in the attributes
Returns:
Either null or a valid LBMSourceStatistics object will be returned

doneWithContextStatistics

public void doneWithContextStatistics(LBMContextStatistics obj)
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.

Parameters:
obj - The LBMContextStatistics object that the application is done with and is ready for reuse

retrieveContextStatistics

public LBMContextStatistics retrieveContextStatistics(java.lang.Object cbObj)
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.

Parameters:
cbObj - The callback object token that was stored when setting LBMObjectRecycler in the attributes
Returns:
Either null or a valid LBMContextStatistics object will be returned

doneWithImmediateMessageReceiverStatistics

public void doneWithImmediateMessageReceiverStatistics(LBMImmediateMessageReceiverStatistics obj)
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.

Parameters:
obj - The LBMImmediateMessageReceiverStatistics object that the application is done with and is ready for reuse

retrieveImmediateMessageReceiverStatistics

public LBMImmediateMessageReceiverStatistics retrieveImmediateMessageReceiverStatistics(java.lang.Object cbObj)
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.

Parameters:
cbObj - The callback object token that was stored when setting LBMObjectRecycler in the attributes
Returns:
Either null or a valid LBMImmediateMessageReceiverStatistics object will be returned

doneWithImmediateMessageSourceStatistics

public void doneWithImmediateMessageSourceStatistics(LBMImmediateMessageSourceStatistics obj)
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.

Parameters:
obj - The LBMImmediateMessageSourceStatistics object that the application is done with and is ready for reuse

retrieveImmediateMessageSourceStatistics

public LBMImmediateMessageSourceStatistics retrieveImmediateMessageSourceStatistics(java.lang.Object cbObj)
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.

Parameters:
cbObj - The callback object token that was stored when setting LBMObjectRecycler in the attributes
Returns:
Either null or a valid LBMImmediateMessageSourceStatistics object will be returned

doneWithEventQueueStatistics

public void doneWithEventQueueStatistics(LBMEventQueueStatistics obj)
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.

Parameters:
obj - The LBMEventQueueStatistics object that the application is done with and is ready for reuse

retrieveEventQueueStatistics

public LBMEventQueueStatistics retrieveEventQueueStatistics(java.lang.Object cbObj)
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.

Parameters:
cbObj - The callback object token that was stored when setting LBMObjectRecycler in the attributes
Returns:
Either null or a valid LBMEventQueueStatistics object will be returned

doneWithSourceEvent

public void doneWithSourceEvent(LBMSourceEvent obj)
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.

Parameters:
obj - The LBMSourceEvent object that the application is done with and is ready for reuse

retrieveSourceEvent

public LBMSourceEvent retrieveSourceEvent(java.lang.Object cbObj)
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.

Parameters:
cbObj - The callback object token that was stored when setting LBMObjectRecycler in the attributes
Returns:
Either null or a valid LBMSourceEvent object will be returned

retrieveAsyncOperationInfo

public LBMAsyncOperationInfo retrieveAsyncOperationInfo(java.lang.Object cbObj)
LBM will call this method to attempt to retrieve an LBMAsyncOperationInfo object instance that it can use instead of creating a new instance to reduce garbage collection. It will reset the state of the LBMAsyncOperationInfo 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.

Parameters:
cbObj - The callback object token that was stored when setting LBMObjectRecycler in the attributes
Returns:
Either null or a valid LBMAsyncOperationInfo object will be returned

doneWithAsyncOperationInfo

public void doneWithAsyncOperationInfo(LBMAsyncOperationInfo obj)
If dispose is not called on an LBMAsyncOperationInfo in the callback, it is retained for use in the application. Once the application is finished with the LBMAsyncOperationInfo, 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:
obj - The LBMAsyncOperationInfo object that the application is done with and is ready for reuse

doneWithContextSourceEvent

public void doneWithContextSourceEvent(LBMSourceEvent obj)
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:
obj - The LBMContextSourceEvent object that the application is done with and is ready for reuse

retrieveContextSourceEvent

public LBMContextSourceEvent retrieveContextSourceEvent(java.lang.Object cbObj)
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.

Parameters:
cbObj - The callback object token that was stored when setting LBMObjectRecycler in the attributes
Returns:
Either null or a valid LBMContextSourceEvent object will be returned

close

public void 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).



All of the documentation and software included in this and any other Informatica Inc "Ultra Messaging" Release is Copyright (C) 2004-2014, Informatica Corporation. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted only as covered by the terms of a valid software license agreement with 29West Inc. Copyright © 2004-2014, Informatica, Inc. All Rights Reserved.