public class HttpConnectionInterceptorContext
extends java.lang.Object
HttpConnectionInterceptor.
The context is new for each request or replay of a request. If an interceptor instance needs to
carry some state across replays of a request then the state must be stored using the
setState(HttpConnectionInterceptor, String, Object) method and retrieved using the
getState(HttpConnectionInterceptor, String, Class) method.
| Modifier and Type | Field and Description |
|---|---|
HttpConnection |
connection |
boolean |
replayRequest |
| Constructor and Description |
|---|
HttpConnectionInterceptorContext(HttpConnection connection)
Constructor
|
HttpConnectionInterceptorContext(HttpConnectionInterceptorContext other)
Shallow copy constructor
|
| Modifier and Type | Method and Description |
|---|---|
<T> T |
getState(HttpConnectionInterceptor interceptor,
java.lang.String stateName,
java.lang.Class<T> stateType)
Retrieve the state object associated with the specified interceptor instance and property
name on this request context.
|
<T> void |
setState(HttpConnectionInterceptor interceptor,
java.lang.String stateName,
T stateObjectToStore)
Store some state on this request context associated with the specified interceptor instance.
|
public boolean replayRequest
public final HttpConnection connection
public HttpConnectionInterceptorContext(HttpConnection connection)
connection - HttpConnectionpublic HttpConnectionInterceptorContext(HttpConnectionInterceptorContext other)
other - Context to copypublic <T> void setState(HttpConnectionInterceptor interceptor, java.lang.String stateName, T stateObjectToStore)
T - the type of the state object to storeinterceptor - the interceptor instancestateName - the key to store the state object understateObjectToStore - the state object to storegetState(HttpConnectionInterceptor, String, Class)public <T> T getState(HttpConnectionInterceptor interceptor, java.lang.String stateName, java.lang.Class<T> stateType)
T - the type the stored state should be returned asinterceptor - the interceptor instancestateName - the name key that the state object was stored understateType - class of the type the stored state should be returned assetState(HttpConnectionInterceptor, String, Object)