public class RequestContext extends Object
A RequestContext simply wraps an identifier that represents the execution context clearly. The thread id is such an identifier.
In order to represent a sequence of requests so that request1 spawned request2, which in turn
spawned request3 and so forth, a parent context can be specified by using constructor
RequestContext(String, RequestContext). In this way the execution of forks can be
represented.
| Modifier and Type | Field and Description |
|---|---|
static RequestContext |
EMPTY_REQUEST_CONTEXT
Empty request context.
|
| Constructor and Description |
|---|
RequestContext(String requestContextId)
Convenience Constructor.
|
RequestContext(String requestContextId,
RequestContext parentContext)
Default constructor.
|
| Modifier and Type | Method and Description |
|---|---|
RequestContext |
append(String addition)
Appends the specified addition to the request context id and returns a new
RequestContext containing the extended request context id. |
boolean |
equals(Object obj) |
List<RequestContext> |
getChildContexts()
Getter for the list of child contexts.
|
RequestContext |
getParentContext()
Getter for the parent context.
|
String |
getRequestContextId()
Returns the unique identifier of the request context represented by this object.
|
int |
hashCode() |
RequestContext |
rootContext()
Returns the root of the request context hierarchy (i.e., the top-most parent).
|
String |
toString() |
public static final RequestContext EMPTY_REQUEST_CONTEXT
public RequestContext(String requestContextId, RequestContext parentContext)
requestContextId - The unique identifier of the request context.parentContext - The parent context of the context which is to be constructed.public RequestContext(String requestContextId)
requestContextId - the unique identifier of the request contextpublic String getRequestContextId()
public RequestContext getParentContext()
public List<RequestContext> getChildContexts()
public RequestContext append(String addition)
RequestContext containing the extended request context id. The parent context will be
retained.addition - The String to append.public RequestContext rootContext()