ncsa.tools.trebuchet.core.util
Class CopyClientPool

java.lang.Object
  extended byncsa.tools.trebuchet.core.util.CopyClientPool
All Implemented Interfaces:
IClient, IConfigurable, Stoppable

public class CopyClientPool
extends java.lang.Object
implements IClient, Stoppable

Responsible for submitting clients to the static thread pool.
A per-operation (per-instance) limit on the number of clients can be given (default is 5).
Calls the static client factory for the appropriate client. A new client is constructed for each call, with availability determined by a counting semaphore, for scalability.
Any optimizations are carried out via the configuration routines inside the specific client.

Author:
arossi

Field Summary
static int DEFAULT_POOL_SIZE
           
 
Constructor Summary
CopyClientPool(java.net.URI source, java.net.URI target)
           
 
Method Summary
 void close()
           
 java.net.URI[] getUriPair()
           
 void halt()
          User-defined method for allowing the run() method (or some other continuous looping process) to exit peacefully.
 void initialize(TrebuchetConfiguration configuration)
           
 void registerAsActive(edu.emory.mathcs.backport.java.util.concurrent.Future future, CopyClient client)
           
 void release(edu.emory.mathcs.backport.java.util.concurrent.Future future)
           
 void setCallback(IOperationMonitor callback)
           
 void submit(ReverseLookupEntry entry)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_POOL_SIZE

public static final int DEFAULT_POOL_SIZE
See Also:
Constant Field Values
Constructor Detail

CopyClientPool

public CopyClientPool(java.net.URI source,
                      java.net.URI target)
Method Detail

initialize

public void initialize(TrebuchetConfiguration configuration)
                throws InitializationException
Specified by:
initialize in interface IConfigurable
Throws:
InitializationException

submit

public void submit(ReverseLookupEntry entry)
            throws FatalErrorDuringOperationException
Throws:
FatalErrorDuringOperationException

registerAsActive

public void registerAsActive(edu.emory.mathcs.backport.java.util.concurrent.Future future,
                             CopyClient client)

release

public void release(edu.emory.mathcs.backport.java.util.concurrent.Future future)

close

public void close()
Specified by:
close in interface IClient

halt

public void halt()
Description copied from interface: Stoppable
User-defined method for allowing the run() method (or some other continuous looping process) to exit peacefully.

Specified by:
halt in interface Stoppable

setCallback

public void setCallback(IOperationMonitor callback)

getUriPair

public java.net.URI[] getUriPair()