net.sf.swan.xpath.util
Class SelectorPool

java.lang.Object
  |
  +--net.sf.swan.xpath.util.SelectorPool

public class SelectorPool
extends java.lang.Object

Utility for using Selectors in a thread-safe manner. Clients take a Selector from the pool when one is needed and return it when they are done. The pool retains one Selector as a prototype that is used to create Selectors as needed. If no prototype is available, this component invokes create() on itself to create a new instance.


Constructor Summary
SelectorPool()
           
SelectorPool(Selector prototype)
           
 
Method Summary
protected  Selector create()
           
 void put(Selector freeSelector)
           
 Selector take()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SelectorPool

public SelectorPool()

SelectorPool

public SelectorPool(Selector prototype)
Method Detail

take

public Selector take()

put

public void put(Selector freeSelector)

create

protected Selector create()