org.activemath.omdocjdom
Class SimplePoolPassive

java.lang.Object
  extended by org.activemath.omdocjdom.SimplePool
      extended by 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:

Nested Class Summary
 class SimplePoolPassive.Wrapper
           
 
Nested classes/interfaces inherited from class org.activemath.omdocjdom.SimplePool
SimplePool.Poolable, SimplePool.PoolableFactory
 
Field Summary
 
Fields inherited from class org.activemath.omdocjdom.SimplePool
baseNum, factory, lastFinished, poolables
 
Constructor Summary
SimplePoolPassive(Object[] wrappedObjects)
           
 
Method Summary
 SimplePool.Poolable getAFreeOne(int timeout, int interval)
          Returns a free SimplePoolPassive.Wrapper.
 SimplePoolPassive.Wrapper getWrapperAt(int i)
           
 void justStart(SimplePool.Poolable poolable)
           
 void use(SimplePool.Poolable poolable)
          Currently does nothing but call the SimplePool.Poolable.run() but may, in the future, have a better freeness-flag modification.
 
Methods inherited from class org.activemath.omdocjdom.SimplePool
destroy, getAFreeOne, getAFreeOneInternal, waitTillAllFinished
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimplePoolPassive

public SimplePoolPassive(Object[] wrappedObjects)
Method Detail

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)