Class SourceContext


  • public class SourceContext
    extends Object
    This class represents the information about a TCP Connection at a given point in time. In a Single TCP Connection there can be multiple HTTP Requests.
    • Method Detail

      • reset

        public void reset()
        Reset the resources associated with this context
      • reset

        public void reset​(boolean isError)
        Reset the resources associated with this context
        Parameters:
        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
      • getLock

        public Lock getLock()
      • isShutDown

        public boolean isShutDown()
      • setShutDown

        public void setShutDown​(boolean shutDown)
      • getReader

        public Pipe getReader()
      • setReader

        public void setReader​(Pipe reader)
      • getWriter

        public Pipe getWriter()
      • setWriter

        public void setWriter​(Pipe writer)
      • updateState

        public static void updateState​(org.apache.http.nio.NHttpConnection conn,
                                       ProtocolState state)
      • assertState

        public static boolean assertState​(org.apache.http.nio.NHttpConnection conn,
                                          ProtocolState state)
      • getState

        public static ProtocolState getState​(org.apache.http.nio.NHttpConnection conn)
      • setRequest

        public static void setRequest​(org.apache.http.nio.NHttpConnection conn,
                                      SourceRequest request)
      • setResponse

        public static void setResponse​(org.apache.http.nio.NHttpConnection conn,
                                       SourceResponse response)
      • getRequest

        public static SourceRequest getRequest​(org.apache.http.nio.NHttpConnection conn)
      • getResponse

        public static SourceResponse getResponse​(org.apache.http.nio.NHttpConnection conn)
      • get

        public static SourceContext get​(org.apache.http.nio.NHttpConnection conn)
      • getLock

        public static Lock getLock​(org.apache.http.nio.NHttpConnection conn)
      • getLastStateUpdatedTime

        public long getLastStateUpdatedTime()
      • updateLastStateUpdatedTime

        public long updateLastStateUpdatedTime()