Package org.globus.ftp.dc
Class TransferThreadManager
java.lang.Object
org.globus.ftp.dc.TransferThreadManager
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected DataChannelFactory
protected GridFTPServerFacade
protected GridFTPSession
protected BasicServerControlChannel
(package private) static org.apache.commons.logging.Log
protected SocketPool
protected TaskThread
protected int
-
Constructor Summary
ConstructorsConstructorDescriptionTransferThreadManager
(SocketPool socketPool, GridFTPServerFacade facade, BasicServerControlChannel myControlChannel, GridFTPSession gSession) -
Method Summary
Modifier and TypeMethodDescriptionvoid
activeClose
(TransferContext context, int connections) use only in mode Evoid
activeConnect
(HostPort hp, int connections) Act as the active side.void
close()
int
void
passiveConnect
(DataSink sink, TransferContext context, int connections, ServerSocket serverSocket) Accept connections from the remote server, and start transfer threads that will read incoming data and store in the sink.void
passiveConnect
(DataSource source, TransferContext context, ServerSocket serverSocket) Accept connection from the remote server and start transfer thread that will read incoming data and store in the sink.private void
Use this as an interface to the local manager thread.void
startTransfer
(DataSink sink, TransferContext context, int connections, boolean reusable) This should be used once the remote active server connected to us.void
startTransfer
(DataSource source, TransferContext context, int connections, boolean reusable) This should be used once the remote active server connected to us.void
void
void
-
Field Details
-
logger
static org.apache.commons.logging.Log logger -
socketPool
-
facade
-
localControlChannel
-
gSession
-
taskThread
-
transferThreadCount
protected int transferThreadCount -
dataChannelFactory
-
-
Constructor Details
-
TransferThreadManager
public TransferThreadManager(SocketPool socketPool, GridFTPServerFacade facade, BasicServerControlChannel myControlChannel, GridFTPSession gSession)
-
-
Method Details
-
activeConnect
Act as the active side. Connect to the server and store the newly connected sockets in the socketPool. -
activeClose
use only in mode E -
startTransfer
public void startTransfer(DataSource source, TransferContext context, int connections, boolean reusable) throws ServerException This should be used once the remote active server connected to us. This method starts transfer threads that will read data from the source and send.- Parameters:
reusable
- if set to false, the sockets will not be reused after the transfer- Throws:
ServerException
-
startTransfer
public void startTransfer(DataSink sink, TransferContext context, int connections, boolean reusable) throws ServerException This should be used once the remote active server connected to us. This method starts transfer threads that will receive the data and store them in the sink. Because of transfer direction, this method cannot be used with EBLOCK. Therefore the number of connections is fixed at 1.- Parameters:
reusable
- if set to false, the sockets will not be reused after the transfer- Throws:
ServerException
-
passiveConnect
public void passiveConnect(DataSink sink, TransferContext context, int connections, ServerSocket serverSocket) throws ServerException Accept connections from the remote server, and start transfer threads that will read incoming data and store in the sink.- Parameters:
connections
- the number of expected connections- Throws:
ServerException
-
passiveConnect
public void passiveConnect(DataSource source, TransferContext context, ServerSocket serverSocket) throws ServerException Accept connection from the remote server and start transfer thread that will read incoming data and store in the sink. This method, because of direction of transfer, cannot be used with EBlock. Therefore it is fixed to create only 1 connection.- Throws:
ServerException
-
getTransferThreadCount
public int getTransferThreadCount() -
transferThreadStarting
public void transferThreadStarting() -
transferThreadTerminating
public void transferThreadTerminating() -
runTask
Use this as an interface to the local manager thread. This submits the task to the thread queue. The thread will perform it when it's ready with other waiting tasks. -
stopTaskThread
public void stopTaskThread() -
close
public void close()
-