Class SourceConnections


  • public class SourceConnections
    extends Object
    Keeps track of the connections coming in to the transport.
    • Constructor Detail

      • SourceConnections

        public SourceConnections()
    • Method Detail

      • addConnection

        public void addConnection​(org.apache.http.nio.NHttpServerConnection conn)
        Add a connection to the pool.
        Parameters:
        conn - connection to be added
      • useConnection

        public void useConnection​(org.apache.http.nio.NHttpServerConnection conn)
        This method should be called when ever a connection being used for processing a request-response.
        Parameters:
        conn - the connection to be used
      • releaseConnection

        public void releaseConnection​(org.apache.http.nio.NHttpServerConnection conn)
        This method should be called after a connection is being used for a request-response.
        Parameters:
        conn - the connection being used
      • shutDownConnection

        public void shutDownConnection​(org.apache.http.nio.NHttpServerConnection conn)
        Shutdown a connection
        Parameters:
        conn - the connection that needs to be shut down
      • shutDownConnection

        public void shutDownConnection​(org.apache.http.nio.NHttpServerConnection conn,
                                       boolean isError)
        Shutdown a connection
        Parameters:
        conn - the connection that needs to be shut down
        isError - whether an error is causing this shutdown of the connection It is very important to set this flag correctly. When an error causing the shutdown of the connections we should not release associated writer buffer to the pool as it might lead into situations like same buffer is getting released to both source and target buffer factories
      • closeConnection

        public void closeConnection​(org.apache.http.nio.NHttpServerConnection conn)
        Close a connection gracefully.
        Parameters:
        conn - the connection that needs to be closed.
      • closeConnection

        public void closeConnection​(org.apache.http.nio.NHttpServerConnection conn,
                                    boolean isError)
        Close a connection gracefully.
        Parameters:
        conn - the connection that needs to be closed.
        isError - whether an error is causing the shutdown of the connection. When as error is causing a close of a connection we should not release the associated buffers into the pool.
      • destroy

        public void destroy()