org.apache.excalibur.mpool
Class VariableSizePool
java.lang.Object
org.apache.excalibur.mpool.VariableSizePool
- All Implemented Interfaces:
- org.apache.avalon.framework.activity.Disposable, org.apache.excalibur.mpool.ManagablePool, org.apache.excalibur.mpool.Pool
public final class VariableSizePool
- extends java.lang.Object
- implements org.apache.excalibur.mpool.Pool, org.apache.avalon.framework.activity.Disposable, org.apache.excalibur.mpool.ManagablePool
This is an Pool
that caches Poolable objects for reuse.
Please note that this pool offers no resource limiting whatsoever.
- Since:
- 4.1
- Version:
- CVS $Revision: 1.4 $ $Date: 2004/02/28 11:47:34 $
- Author:
- Avalon Development Team
Constructor Summary |
VariableSizePool(org.apache.excalibur.mpool.ObjectFactory factory,
int size)
Constructor for an unmanaged pool |
VariableSizePool(org.apache.excalibur.mpool.ObjectFactory factory,
int size,
long key)
Constructor for a managed pool |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
VariableSizePool
public VariableSizePool(org.apache.excalibur.mpool.ObjectFactory factory,
int size)
throws java.lang.Exception
- Constructor for an unmanaged pool
- Throws:
java.lang.Exception
VariableSizePool
public VariableSizePool(org.apache.excalibur.mpool.ObjectFactory factory,
int size,
long key)
throws java.lang.Exception
- Constructor for a managed pool
- Throws:
java.lang.Exception
acquire
public java.lang.Object acquire()
throws java.lang.Exception
- Specified by:
acquire
in interface org.apache.excalibur.mpool.Pool
- Throws:
java.lang.Exception
release
public void release(java.lang.Object pooledObject)
- Specified by:
release
in interface org.apache.excalibur.mpool.Pool
newInstance
public java.lang.Object newInstance()
throws java.lang.Exception
- Specified by:
newInstance
in interface org.apache.excalibur.mpool.Pool
- Throws:
java.lang.Exception
dispose
public void dispose()
- Specified by:
dispose
in interface org.apache.avalon.framework.activity.Disposable
shrink
public void shrink(int byNum,
long key)
throws java.lang.IllegalAccessException
- Specified by:
shrink
in interface org.apache.excalibur.mpool.ManagablePool
- Throws:
java.lang.IllegalAccessException
grow
public void grow(int byNum,
long key)
throws java.lang.IllegalAccessException
- Specified by:
grow
in interface org.apache.excalibur.mpool.ManagablePool
- Throws:
java.lang.IllegalAccessException
size
public int size(long key)
throws java.lang.IllegalAccessException
- Specified by:
size
in interface org.apache.excalibur.mpool.ManagablePool
- Throws:
java.lang.IllegalAccessException
Copyright © {inceptionYear}-2009 Apache Software Foundation. All Rights Reserved.