org.activemath.omdocjdom
Class SimplePoolPassive
java.lang.Object
org.activemath.omdocjdom.SimplePool
org.activemath.omdocjdom.SimplePoolPassive
public class SimplePoolPassive
- extends SimplePool
This extension of SimplePool is meant for SimplePoolPassive.Wrapper objects that
do not SimplePool.Poolable.run() but are notified of their SimplePool.Poolable.isBusy()
status using method-calls from outside.
The pool is created with a (fixed) array of wrapped objects.
A free one is then obtained using getAFreeOne(int, int) who's
SimplePoolPassive.Wrapper.setBusy(boolean) has to be called (with true).
Once finished the SimplePoolPassive.Wrapper.setBusy(boolean)(false)
is then to be called, freeing the object for a next call to
getAFreeOne(int, int).
Please note that this class and its parent class will probably
undergo deep changes so it should be used at few places.
- Version:
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SimplePoolPassive
public SimplePoolPassive(Object[] wrappedObjects)
use
public void use(SimplePool.Poolable poolable)
- Description copied from class:
SimplePool
- Currently does nothing but call the
SimplePool.Poolable.run()
but may, in the future, have a better freeness-flag modification.
- Overrides:
use in class SimplePool
- Throws:
IllegalStateException - always.
justStart
public void justStart(SimplePool.Poolable poolable)
- Overrides:
justStart in class SimplePool
- Throws:
IllegalStateException - always.
getAFreeOne
public SimplePool.Poolable getAFreeOne(int timeout,
int interval)
throws InterruptedException
- Returns a free
SimplePoolPassive.Wrapper.
- Overrides:
getAFreeOne in class SimplePool
- Throws:
InterruptedException
getWrapperAt
public SimplePoolPassive.Wrapper getWrapperAt(int i)