|
Enterprise Information Portal APIs |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.ibm.mm.beans.CMBObjectManagement
The CMBObjectManagement class can be used to efficiently allocate and free instances of CMBItem and CMBObject. Pools of free CMBItem and CMBObject objects are maintained. Using CMBObjectManagement to allocate CMBItem and CMBObject is more efficient than performing new's because the objects will be reused from the pools rather than freed to Java garbage collection.
Further optimizations are made in the case of CMBItem. If an instance of CMBItem already exists with the same pidstring as requested, that object will be returned rather than creating a new instance.
CMBObjectManagement is used internally by other non-visual beans. In particular, CMBSearchResults uses CMBObjectManagement to allocate CMBItems for items in the list of search results, and frees all items when the list of results is cleared. This means that the lifetime of CMBItems obtained from CMBSearchResults is only during the time the items are part of the list of results.
CMBObjectManagement is constructed by CMBConnection and is available using
CMBConnection.getObjectManagement()
. Object management is initially disabled. Use
CMBObjectManagement.setEnabled(true)
to enable object management.
Note that CMBObjectManagement has affinity to a CMBConnection. This means that, like CMBConnection, an instance of CMBObjectManagement can only be used by a single thread. If it is used by multiple threads, synchronization must be performed in the application to insure that only a single thread is using CMBObjectManagment at any point in time.
CMBConnection
,
CMBSearchResults
, Serialized FormMethod Summary | |
CMBItem |
createItem()
Creates an instance of CMBItem, or reuses a freed instance from the pool. |
CMBItem |
createItem(java.lang.String pidString)
Creates an instance of CMBItem for the specified pid string. |
CMBObject |
createObject()
Creates an instance of CMBObject, or reuses a freed instance from the pool. |
int |
getItemPoolSize()
Returns the maximum size of the CMBItem free pool. |
int |
getObjectPoolSize()
Returns the maximum size of the CMBObject free pool. |
boolean |
isEnabled()
Returns true if object management is enabled. |
void |
releaseItem(CMBItem item)
Release an instance of CMBItem tht is no longer being used. |
void |
releaseObject(CMBObject obj)
Release an instance of CMBObject that is no longer being used. |
void |
setEnabled(boolean managementEnabled)
Sets the enablement of object management. |
void |
setItemPoolSize(int itemPoolSize)
Sets the maximum size of the CMBItem free pool. |
void |
setObjectPoolSize(int objectPoolSize)
Sets the maximum size of the CMBObject free pool. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
public boolean isEnabled()
Initially, object management is disabled.
public void setEnabled(boolean managementEnabled)
public int getItemPoolSize()
public void setItemPoolSize(int itemPoolSize)
public int getObjectPoolSize()
public void setObjectPoolSize(int objectPoolSize)
public CMBObject createObject()
public CMBItem createItem()
public CMBItem createItem(java.lang.String pidString)
public void releaseObject(CMBObject obj)
public void releaseItem(CMBItem item)
|
EIP JavaBeans | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |