Class TargetContext
java.lang.Object
org.apache.synapse.transport.passthru.TargetContext
When a connection is created, an object of this class is stored in the Connection Context.
It is used as a holder for information required during the life-cycle of this connection.
-
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, TargetConfiguration configuration) static TargetContextget(org.apache.http.nio.NHttpConnection conn) longstatic TargetRequestgetRequest(org.apache.http.nio.NHttpConnection conn) org.apache.axis2.context.MessageContextstatic TargetResponsegetResponse(org.apache.http.nio.NHttpConnection conn) getState()static ProtocolStategetState(org.apache.http.nio.NHttpConnection conn) static BooleanisCorrelationIdAvailable(org.apache.http.nio.NHttpConnection connection) voidreset()Reset the resources associated with this contextvoidreset(boolean isError) Reset the resources associated with this contextvoidstatic voidsetRequest(org.apache.http.nio.NHttpConnection conn, TargetRequest request) voidsetRequest(TargetRequest request) voidsetRequestMsgCtx(org.apache.axis2.context.MessageContext requestMsgCtx) static voidsetResponse(org.apache.http.nio.NHttpConnection conn, TargetResponse response) voidsetResponse(TargetResponse response) voidsetState(ProtocolState state) voidlongstatic voidupdateState(org.apache.http.nio.NHttpConnection conn, ProtocolState state)
-
Field Details
-
CONNECTION_INFORMATION
- See Also:
-
-
Constructor Details
-
TargetContext
-
-
Method Details
-
getState
-
setState
-
getTargetConfiguration
-
getRequest
-
setRequest
-
getResponse
-
setResponse
-
getRequestMsgCtx
public org.apache.axis2.context.MessageContext getRequestMsgCtx() -
setRequestMsgCtx
public void setRequestMsgCtx(org.apache.axis2.context.MessageContext requestMsgCtx) -
getReader
-
getWriter
-
setReader
-
setWriter
-
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
-
create
public static void create(org.apache.http.nio.NHttpConnection conn, ProtocolState state, TargetConfiguration configuration) -
updateState
-
assertState
-
getState
-
setRequest
-
setResponse
-
getRequest
-
getResponse
-
get
-
getLastStateUpdatedTime
public long getLastStateUpdatedTime() -
updateLastStateUpdatedTime
public long updateLastStateUpdatedTime() -
isCorrelationIdAvailable
-