com.objectwave.persist.broker
Class ObjectPool
java.lang.Object
|
+--java.util.AbstractMap
|
+--java.util.HashMap
|
+--com.objectwave.persist.broker.ObjectPool
- All Implemented Interfaces:
- java.lang.Cloneable, java.util.Map, java.io.Serializable
- public class ObjectPool
- extends java.util.HashMap
- implements java.io.Serializable
Provides some basic object pooling support.
- Version:
- $Id: ObjectPool.java,v 2.0 2001/06/11 16:00:03 dave_hoag Exp $
- Author:
- Dave Hoag
- See Also:
- Serialized Form
Methods inherited from class java.util.HashMap |
clear, clone, containsKey, containsValue, entrySet, get, isEmpty, keySet, put, putAll, remove, size, values |
Methods inherited from class java.util.AbstractMap |
equals, hashCode, toString |
Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.util.Map |
equals, hashCode |
ObjectPool
public ObjectPool()
setDefaultPoolSize
public void setDefaultPoolSize(int value)
getDefaultPoolSize
public int getDefaultPoolSize()
get
public java.util.HashMap get(java.lang.Class c)
get
public Persistence get(java.lang.Class c,
java.lang.Object uid)
- Get the entry in the pool with the corresponding class
and unique identifier.
remove
public void remove(Persistence obj)
getSize
protected int getSize(java.lang.Class c)
- Size to make the initial hashmap associated with each class.
put
public Persistence put(Persistence obj)
- Put the persistent object into the pool. If it is already in
the pool, return the pool instance.
- Parameters:
obj
- The peristent object we are adding to the object pool.
elements
public java.util.Iterator elements(java.lang.Class c)