Class RequestContext
java.lang.Object
org.palladiosimulator.probeframework.measurement.RequestContext
This class represents the execution context of a request. Normally the execution context of a
request is the thread which processes this request. Then the thread's id is a unique identifier
for this execution context.
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.
-
Field Summary
-
Constructor Summary
ConstructorDescriptionRequestContext
(String requestContextId) Convenience Constructor.RequestContext
(String requestContextId, RequestContext parentContext) Default constructor. -
Method Summary
Modifier and TypeMethodDescriptionAppends the specified addition to the request context id and returns a newRequestContext
containing the extended request context id.boolean
Getter for the list of child contexts.Getter for the parent context.Returns the unique identifier of the request context represented by this object.int
hashCode()
Returns the root of the request context hierarchy (i.e., the top-most parent).toString()
-
Field Details
-
EMPTY_REQUEST_CONTEXT
Empty request context.
-
-
Constructor Details
-
RequestContext
Default constructor. Used when there is a parent context.- Parameters:
requestContextId
- The unique identifier of the request context.parentContext
- The parent context of the context which is to be constructed.
-
RequestContext
Convenience Constructor. Used when there is no parent context.- Parameters:
requestContextId
- the unique identifier of the request context
-
-
Method Details
-
getRequestContextId
Returns the unique identifier of the request context represented by this object.- Returns:
- the request context identifier
-
getParentContext
Getter for the parent context.- Returns:
- The parent context.
-
getChildContexts
Getter for the list of child contexts.- Returns:
- The list of child contexts.
-
append
Appends the specified addition to the request context id and returns a newRequestContext
containing the extended request context id. The parent context will be retained.- Parameters:
addition
- The String to append.- Returns:
- The modified request context.
-
rootContext
Returns the root of the request context hierarchy (i.e., the top-most parent).- Returns:
- The root request context.
-
hashCode
public int hashCode() -
equals
-
toString
-