net.sf.mmm.util.io.api
Interface TransferCallback


public interface TransferCallback

This is the callback interface used to receive the status of an AsyncTransferrer. Exactly one of the methods declared in this interface are called when the transfer is done (successful or unsuccessful).
ATTENTION:
The according method of this callback will (typically) be invoked by a different Thread. Please ensure that your implementation is thread-safe.

Since:
1.0.0
Author:
Joerg Hohwiller (hohwille at users.sourceforge.net)
See Also:
StreamUtilImpl.transferAsync(java.io.InputStream, java.io.OutputStream, boolean, TransferCallback)

Method Summary
 void transferCompleted(long bytesTransferred)
          This method is invoked if the transfer completed successfully.
 void transferFailed(Exception e)
          This method is invoked if the transfer failed because an exception occurred.
 void transferStopped(long bytesTransferred)
          This method is invoked if the transfer was stopped before it completed.
 

Method Detail

transferCompleted

void transferCompleted(long bytesTransferred)
This method is invoked if the transfer completed successfully.

Parameters:
bytesTransferred - is the number of bytes that have been transferred.

transferStopped

void transferStopped(long bytesTransferred)
This method is invoked if the transfer was stopped before it completed.

Parameters:
bytesTransferred - is the number of bytes that have been transferred until the task has been stopped.

transferFailed

void transferFailed(Exception e)
This method is invoked if the transfer failed because an exception occurred. This will typically be an IOException. It may also be a RuntimeException.

Parameters:
e - is the exception indicating the problem.


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