|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apache.excalibur.mpool.VariableSizePool
This is an Pool
that caches Poolable objects for reuse.
Please note that this pool offers no resource limiting whatsoever.
Constructor Summary | |
VariableSizePool(ObjectFactory factory,
int size)
Constructor for an unmanaged pool |
|
VariableSizePool(ObjectFactory factory,
int size,
long key)
Constructor for a managed pool |
Method Summary | |
Object |
acquire()
Acquire an instance of the pooled object. |
void |
dispose()
|
void |
grow(int byNum,
long key)
Grow by the specified amount. |
Object |
newInstance()
Create a new instance of the object being pooled. |
void |
release(Object pooledObject)
Release the instance of the pooled object. |
void |
shrink(int byNum,
long key)
Shrink the pool by the specified amount. |
int |
size(long key)
Determine the pool's current size. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public VariableSizePool(ObjectFactory factory, int size) throws Exception
public VariableSizePool(ObjectFactory factory, int size, long key) throws Exception
Method Detail |
public Object acquire() throws Exception
Pool
acquire
in interface Pool
Exception
- if the Pool is not able to return an object.public void release(Object pooledObject)
Pool
release
in interface Pool
pooledObject
- The pooled object to release to the pool.public Object newInstance() throws Exception
Pool
newInstance
in interface Pool
Exception
- if the instance cannot be createdpublic void dispose()
dispose
in interface Disposable
public void shrink(int byNum, long key) throws IllegalAccessException
ManagablePool
shrink
in interface ManagablePool
byNum
- an integer amount to decrease the pool size by.key
- an integer number supplied by the PoolManager to
validate that the method is called legitimately
IllegalAccessException
- if the key does not match the
controller's key.public void grow(int byNum, long key) throws IllegalAccessException
ManagablePool
grow
in interface ManagablePool
byNum
- an integer amount to increase the pool size by.key
- an integer number supplied by the PoolManager to
validate that the method is called legitimately
IllegalAccessException
- if the key does not match the
controller's key.public int size(long key) throws IllegalAccessException
ManagablePool
size
in interface ManagablePool
key
- an integer number supplied by the PoolManager to
validate that the method is called legitimately
IllegalAccessException
- if the key does not match the
controller's key.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |