net.sf.mmm.util.io.base
Class StreamUtilImpl.BaseTransferrer

java.lang.Object
  extended by net.sf.mmm.util.io.base.StreamUtilImpl.AbstractAsyncTransferrer
      extended by net.sf.mmm.util.io.base.StreamUtilImpl.BaseTransferrer
All Implemented Interfaces:
Callable<Long>, Stoppable
Direct Known Subclasses:
StreamUtilImpl.ReaderTransferrer, StreamUtilImpl.StreamTransferrer
Enclosing class:
StreamUtilImpl

protected abstract class StreamUtilImpl.BaseTransferrer
extends StreamUtilImpl.AbstractAsyncTransferrer

This is an abstract implementation of the AsyncTransferrer interface, that implements Runnable defining the main flow.


Field Summary
private  TransferCallback callback
          The callback or null.
 
Constructor Summary
StreamUtilImpl.BaseTransferrer(TransferCallback callback)
          The constructor.
 
Method Summary
 Long call()
          
protected abstract  long transfer()
          This method performs the actual transfer.
 
Methods inherited from class net.sf.mmm.util.io.base.StreamUtilImpl.AbstractAsyncTransferrer
isCompleted, isStopped, setCompleted, stop
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

callback

private final TransferCallback callback
The callback or null.

Constructor Detail

StreamUtilImpl.BaseTransferrer

public StreamUtilImpl.BaseTransferrer(TransferCallback callback)
The constructor.

Parameters:
callback - is the callback or null.
Method Detail

transfer

protected abstract long transfer()
                          throws IOException
This method performs the actual transfer.

Returns:
the number of bytes that have been transferred.
Throws:
IOException - if the transfer failed.

call

public Long call()
          throws Exception

Throws:
Exception


Copyright © 2001-2010 mmm-Team. All Rights Reserved.