FileDocCategorySizeDatePackage
ProcessorPool.javaAPI DocExample3464Tue May 29 16:56:42 BST 2007com.sun.xml.ws.rm.jaxws.runtime.client

ProcessorPool

public class ProcessorPool extends Stack
Pool of Pipelines used by RMClientPipe to insure that no two invocations of nextPipe.process() are done concurrently.

Fields Summary
private T
pipe
private int
capacity
private int
length
Constructors Summary
public ProcessorPool(T pipe)

    
       
        this(pipe, 5);
    
public ProcessorPool(T pipe, int capacity)
Creates a new instance of ProcessorPool

        this.capacity = capacity;
        this.pipe =pipe;
        
        
    
Methods Summary
public synchronized voidcheckIn(T in)

        push(in);
        notifyAll();
    
public synchronized TcheckOut()

        try {
            if (!empty()) {
                return pop();
            } else if (length < capacity) {
                length++;
                return (T)PipeCloner.clone(pipe);
            } else {
                while (empty()) {
                    wait();
                }
                return pop();
            }
        } catch (InterruptedException e) {
        }
        return null;