rabbit.httpio
Class TransferHandler
java.lang.Object
rabbit.httpio.TransferHandler
- All Implemented Interfaces:
- Runnable
public class TransferHandler
- extends Object
- implements Runnable
A handler that transfers data from a Transferable to a socket channel.
Since file transfers may take time we run in a separate thread.
- Author:
- Robert Olofsson
Method Summary |
void |
run()
|
void |
transfer()
Start the data transfer. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
TransferHandler
public TransferHandler(NioHandler nioHandler,
Transferable t,
SocketChannel channel,
TrafficLogger tlFrom,
TrafficLogger tlTo,
TransferListener listener)
- Create a new TransferHandler
- Parameters:
nioHandler
- the NioHandler to use for network and background taskst
- the resource to transferchannel
- the Channel to transfer the resource totlFrom
- the network statistics for the sourcetlTo
- the network statistics for the sinklistener
- the listener that will be notified when the transfer has
completed
transfer
public void transfer()
- Start the data transfer.
run
public void run()
- Specified by:
run
in interface Runnable