Class TransferThreadManager


  • public class TransferThreadManager
    extends Object
    • Method Detail

      • 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()
      • stopTaskThread

        public void stopTaskThread()
      • close

        public void close()