|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
This is the interface for Pools that are not a fixed size. This interface exposes enough explicit state so that an external asynchronous Controller can do it's job. A secondary purpose of this interface is to supply a simple authentication mechanism so that the Pool only responds to method invocations by the legitimate controller.
The key is a randomly generated number greater than one assigned by the PoolManager and given to the Pool and the PoolController. The mechanism to generate the number is up to the PoolManager's policy. Keep in mind that should the key be made publicly available, the Pool is susceptible to a replay attack. Therefore, it is suggested that the key be created at the same time the Pool is created.
Method Summary | |
void |
grow(int amount,
long key)
Grow by the specified amount. |
void |
shrink(int amount,
long key)
Shrink the pool by the specified amount. |
int |
size(long key)
Determine the pool's current size. |
Methods inherited from interface org.apache.excalibur.mpool.Pool |
acquire, newInstance, release |
Method Detail |
public void grow(int amount, long key) throws java.lang.IllegalAccessException
amount
- 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 void shrink(int amount, long key) throws java.lang.IllegalAccessException
amount
- 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 int size(long key) throws java.lang.IllegalAccessException
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 |