Class SourceContext
java.lang.Object
org.apache.synapse.transport.passthru.SourceContext
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.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanassertState(org.apache.http.nio.NHttpConnection conn, ProtocolState state) static voidcreate(org.apache.http.nio.NHttpConnection conn, ProtocolState state, SourceConfiguration configuration) static SourceContextget(org.apache.http.nio.NHttpConnection conn) longgetLock()static LockgetLock(org.apache.http.nio.NHttpConnection conn) static SourceRequestgetRequest(org.apache.http.nio.NHttpConnection conn) static SourceResponsegetResponse(org.apache.http.nio.NHttpConnection conn) getState()static ProtocolStategetState(org.apache.http.nio.NHttpConnection conn) booleanbooleanvoidreset()Reset the resources associated with this contextvoidreset(boolean isError) Reset the resources associated with this contextvoidsetIsSourceRequestMarkedToBeDiscarded(boolean isPipeDiscarded) voidstatic voidsetRequest(org.apache.http.nio.NHttpConnection conn, SourceRequest request) voidsetRequest(SourceRequest request) static voidsetResponse(org.apache.http.nio.NHttpConnection conn, SourceResponse response) voidsetResponse(SourceResponse response) voidsetShutDown(boolean shutDown) voidsetState(ProtocolState state) voidlongstatic voidupdateState(org.apache.http.nio.NHttpConnection conn, ProtocolState state)
-
Field Details
-
CONNECTION_INFORMATION
- See Also:
-
-
Constructor Details
-
SourceContext
-
-
Method Details
-
getSourceConfiguration
-
getState
-
isSourceRequestMarkedToBeDiscarded
public boolean isSourceRequestMarkedToBeDiscarded() -
setIsSourceRequestMarkedToBeDiscarded
public void setIsSourceRequestMarkedToBeDiscarded(boolean isPipeDiscarded) -
setState
-
getRequest
-
setRequest
-
getResponse
-
setResponse
-
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
-
isShutDown
public boolean isShutDown() -
setShutDown
public void setShutDown(boolean shutDown) -
getReader
-
setReader
-
getWriter
-
setWriter
-
create
public static void create(org.apache.http.nio.NHttpConnection conn, ProtocolState state, SourceConfiguration configuration) -
updateState
-
assertState
-
getState
-
setRequest
-
setResponse
-
getRequest
-
getResponse
-
get
-
getLock
-
getLastStateUpdatedTime
public long getLastStateUpdatedTime() -
updateLastStateUpdatedTime
public long updateLastStateUpdatedTime()
-