Class TransferThreadManager

java.lang.Object
org.globus.ftp.dc.TransferThreadManager

public class TransferThreadManager extends Object
  • Field Details

  • Constructor Details

  • Method Details

    • activeConnect

      public void activeConnect(HostPort hp, int connections)
      Act as the active side. Connect to the server and store the newly connected sockets in the socketPool.
    • activeClose

      public void activeClose(TransferContext context, int connections)
      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

      private void runTask(Task task)
      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()