|
|||||||||||
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 | |
java.lang.Object |
acquire()
Acquire an instance of the pooled object. |
void |
dispose()
The dispose operation is called at the end of a components lifecycle. |
void |
grow(int byNum,
long key)
Grow by the specified amount. |
java.lang.Object |
newInstance()
Create a new instance of the object being pooled. |
void |
release(java.lang.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 java.lang.Exception
public VariableSizePool(ObjectFactory factory, int size, long key) throws java.lang.Exception
Method Detail |
public java.lang.Object acquire() throws java.lang.Exception
Pool
acquire
in interface Pool
java.lang.Exception
- if the Pool is not able to return an object.public void release(java.lang.Object pooledObject)
Pool
release
in interface Pool
pooledObject
- The pooled object to release to the pool.public java.lang.Object newInstance() throws java.lang.Exception
Pool
newInstance
in interface Pool
java.lang.Exception
- if the instance cannot be createdpublic void dispose()
Disposable
dispose
in interface Disposable
public void shrink(int byNum, long key) throws java.lang.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
java.lang.IllegalAccessException
- if the key does not match the
controller's key.public void grow(int byNum, long key) throws java.lang.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
java.lang.IllegalAccessException
- if the key does not match the
controller's key.public int size(long key) throws java.lang.IllegalAccessException
ManagablePool
size
in interface ManagablePool
key
- an integer number supplied by the PoolManager to
validate that the method is called legitimately
java.lang.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 |