org.openejb.util
Class SoftLimitedInstancePool
java.lang.Object
org.openejb.util.SoftLimitedInstancePool
- All Implemented Interfaces:
- InstancePool, Serializable
- public final class SoftLimitedInstancePool
- extends Object
- implements InstancePool, Serializable
- Version:
- $Revision: 444657 $ $Date: 2004-04-04 00:20:12 +0200 (Sun, 04 Apr 2004) $
- See Also:
- Serialized Form
Method Summary |
Object |
acquire()
Get an instance from the pool. |
boolean |
release(Object instance)
Releases the hold on the instance. |
void |
remove(Object instance)
Drop an instance permanently from the pool. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SoftLimitedInstancePool
public SoftLimitedInstancePool(InstanceFactory factory,
int maxSize)
acquire
public Object acquire()
throws Exception
- Description copied from interface:
InstancePool
- Get an instance from the pool. This method may block indefinately if the pool has a
strict limit.
- Specified by:
acquire
in interface InstancePool
- Returns:
- an instance
- Throws:
Exception
- if object demand object construction was required and
an error occured during construction
release
public boolean release(Object instance)
- Description copied from interface:
InstancePool
- Releases the hold on the instance. This method may or may not reinsert the instance
into the pool. This method can not block.
- Specified by:
release
in interface InstancePool
- Parameters:
instance
- the instance to return to the pool
- Returns:
- true is the instance was reinserted into the pool.
remove
public void remove(Object instance)
- Description copied from interface:
InstancePool
- Drop an instance permanently from the pool. The instance will never be used again.
This method can not block.
- Specified by:
remove
in interface InstancePool
- Parameters:
instance
- the instance to discard
Copyright © 1999-2006 OpenEJB. All Rights Reserved.