protected Object shutdown() throws java.io.IOException {

        // send EOD and maybe EOF
        writer.endOfData();

        // attempt to obtain permission to close data source
        Object quitToken = context.getQuitToken();

        try {
            SocketPool pool =
                    ((EBlockParallelTransferContext) context).getSocketPool();

            if (((ManagedSocketBox) socketBox).isReusable()) {
                // we're in EBLOCK mode. Store the socket for later reuse
                logger.debug("shutdown; leaving the socket open");
                pool.checkIn(socketBox);
            } else {
                // we're in stream mode or other non-eblock,
                // or it was indicated that socket should not be reused.
                logger.debug("shutdown; closing the socket");
                try {
                    writer.close();
                } finally {
                    // do not reuse the socket
                    try {
                        pool.remove(socketBox);
                    } catch (IllegalArgumentException e) {
                        logger.warn(e);
                    }
                    socketBox.setSocket(null);
                }
            }
        } finally {
            //update manager's thread count
            TransferThreadManager threadManager =
                    eContext.getTransferThreadManager();
            threadManager.transferThreadTerminating();

            // data sink is shared by all data channels,
            // so should be closed by the last one exiting
            if (quitToken != null) {
                logger.debug("closing the data source");
                source.close();
            }
        }



        return quitToken;
    }
protected Object shutdown ( ) throws java . io . IOException { writer . endOfData ( ) ; Object quitToken = context . getQuitToken ( ) ; try { SocketPool pool = ( ( EBlockParallelTransferContext ) context ) . getSocketPool ( ) ; if ( ( ( ManagedSocketBox ) socketBox ) . isReusable ( ) ) { logger . debug ( "shutdown; leaving the socket open" ) ; pool . checkIn ( socketBox ) ; } else { logger . debug ( "shutdown; closing the socket" ) ; try { writer . close ( ) ; } finally { try { pool . remove ( socketBox ) ; } catch ( IllegalArgumentException e ) { logger . warn ( e ) ; } socketBox . setSocket ( null ) ; } } } finally { TransferThreadManager threadManager = eContext . getTransferThreadManager ( ) ; threadManager . transferThreadTerminating ( ) ; if ( quitToken != null ) { logger . debug ( "closing the data source" ) ; source . close ( ) ; } } return quitToken ; }
called after the transfer completes, before 226