com.partnersoft.v3x.io
Class AsynchronousStreamCopyManager

java.lang.Object
  extended by com.partnersoft.v3x.io.AsynchronousStreamCopyManager

public class AsynchronousStreamCopyManager
extends java.lang.Object

A manager for stream copies where the input and output streams may be provided at different times in different threads. Keeps track of input/output pairs via a magic cookie; sources of these then report in with the actual input or output and the cookie when they are ready for actual byte copying. When both an input and output are available, the copy thread copies the actual bytes.


Constructor Summary
AsynchronousStreamCopyManager()
           
 
Method Summary
 void copyReady(AsynchronousStreamCopy copy)
          Notify the manager that an AsynchronousStreamCopy has both input and output streams and is therefore ready to go.
 AsynchronousStreamCopy registerStreamCopy(java.lang.String description, long byteCount, long checksum)
          Register for an AsynchronousStreamCopy.
 void sync()
          Blocks until all copies are resolved.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AsynchronousStreamCopyManager

public AsynchronousStreamCopyManager()
Method Detail

registerStreamCopy

public AsynchronousStreamCopy registerStreamCopy(java.lang.String description,
                                                 long byteCount,
                                                 long checksum)
Register for an AsynchronousStreamCopy. Set input and output on the returned object when they are available, and the copy will magically happen.


copyReady

public void copyReady(AsynchronousStreamCopy copy)
Notify the manager that an AsynchronousStreamCopy has both input and output streams and is therefore ready to go.


sync

public void sync()
Blocks until all copies are resolved.