public class SourceContext extends Object
Modifier and Type | Field and Description |
---|---|
static String |
CONNECTION_INFORMATION |
Constructor and Description |
---|
SourceContext(SourceConfiguration sourceConfiguration) |
Modifier and Type | Method and Description |
---|---|
static boolean |
assertState(org.apache.http.nio.NHttpConnection conn,
ProtocolState state) |
static void |
create(org.apache.http.nio.NHttpConnection conn,
ProtocolState state,
SourceConfiguration configuration) |
static SourceContext |
get(org.apache.http.nio.NHttpConnection conn) |
Pipe |
getReader() |
SourceRequest |
getRequest() |
static SourceRequest |
getRequest(org.apache.http.nio.NHttpConnection conn) |
SourceResponse |
getResponse() |
static SourceResponse |
getResponse(org.apache.http.nio.NHttpConnection conn) |
ProtocolState |
getState() |
static ProtocolState |
getState(org.apache.http.nio.NHttpConnection conn) |
Pipe |
getWriter() |
boolean |
isShutDown() |
void |
reset()
Reset the resources associated with this context
|
void |
reset(boolean isError)
Reset the resources associated with this context
|
void |
setReader(Pipe reader) |
static void |
setRequest(org.apache.http.nio.NHttpConnection conn,
SourceRequest request) |
void |
setRequest(SourceRequest request) |
static void |
setResponse(org.apache.http.nio.NHttpConnection conn,
SourceResponse response) |
void |
setResponse(SourceResponse response) |
void |
setShutDown(boolean shutDown) |
void |
setState(ProtocolState state) |
void |
setWriter(Pipe writer) |
static void |
updateState(org.apache.http.nio.NHttpConnection conn,
ProtocolState state) |
public static final String CONNECTION_INFORMATION
public SourceContext(SourceConfiguration sourceConfiguration)
public ProtocolState getState()
public void setState(ProtocolState state)
public SourceRequest getRequest()
public void setRequest(SourceRequest request)
public SourceResponse getResponse()
public void setResponse(SourceResponse response)
public void reset()
public void reset(boolean isError)
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 factoriespublic boolean isShutDown()
public void setShutDown(boolean shutDown)
public Pipe getReader()
public void setReader(Pipe reader)
public Pipe getWriter()
public void setWriter(Pipe writer)
public static void create(org.apache.http.nio.NHttpConnection conn, ProtocolState state, SourceConfiguration configuration)
public static void updateState(org.apache.http.nio.NHttpConnection conn, ProtocolState state)
public static boolean assertState(org.apache.http.nio.NHttpConnection conn, ProtocolState state)
public static ProtocolState getState(org.apache.http.nio.NHttpConnection conn)
public static void setRequest(org.apache.http.nio.NHttpConnection conn, SourceRequest request)
public static void setResponse(org.apache.http.nio.NHttpConnection conn, SourceResponse response)
public static SourceRequest getRequest(org.apache.http.nio.NHttpConnection conn)
public static SourceResponse getResponse(org.apache.http.nio.NHttpConnection conn)
public static SourceContext get(org.apache.http.nio.NHttpConnection conn)
Copyright © 2005-2017 Apache Software Foundation. All Rights Reserved.