Package org.eclipse.aether
Class RequestTrace
- java.lang.Object
-
- org.eclipse.aether.RequestTrace
-
public class RequestTrace extends Object
A trace of nested requests that are performed by the repository system. This trace information can be used to correlate repository events with higher level operations in the application code that eventually caused the events. A single trace can carry an arbitrary object as data which is meant to describe a request/operation that is currently executed. For call hierarchies within the repository system itself, this data will usually be the*Request
object that is currently processed. When invoking methods on the repository system, client code may provide a request trace that has been prepopulated with whatever data is useful for the application to indicate its state for later evaluation when processing the repository events.- See Also:
RepositoryEvent.getTrace()
-
-
Constructor Summary
Constructors Modifier Constructor Description RequestTrace(Object data)
Creates a new root trace with the specified data.protected
RequestTrace(RequestTrace parent, Object data)
Creates a new trace with the specified data and parent
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Object
getData()
Gets the data associated with this trace.RequestTrace
getParent()
Gets the parent of this trace.RequestTrace
newChild(Object data)
Creates a new child of this trace.static RequestTrace
newChild(RequestTrace parent, Object data)
Creates a child of the specified request trace.String
toString()
-
-
-
Constructor Detail
-
RequestTrace
public RequestTrace(Object data)
Creates a new root trace with the specified data.- Parameters:
data
- The data to associate with the trace, may benull
.
-
RequestTrace
protected RequestTrace(RequestTrace parent, Object data)
Creates a new trace with the specified data and parent- Parameters:
parent
- The parent trace, may benull
for a root trace.data
- The data to associate with the trace, may benull
.
-
-
Method Detail
-
newChild
public static RequestTrace newChild(RequestTrace parent, Object data)
Creates a child of the specified request trace. This method is basically a convenience that will invokeparent.newChild()
when the specified parent trace is notnull
or otherwise instantiante a new root trace.- Parameters:
parent
- The parent request trace, may benull
.data
- The data to associate with the child trace, may benull
.- Returns:
- The child trace, never
null
.
-
getData
public final Object getData()
Gets the data associated with this trace.- Returns:
- The data associated with this trace or
null
if none.
-
getParent
public final RequestTrace getParent()
Gets the parent of this trace.- Returns:
- The parent of this trace or
null
if this is the root of the trace stack.
-
newChild
public RequestTrace newChild(Object data)
Creates a new child of this trace.- Parameters:
data
- The data to associate with the child, may benull
.- Returns:
- The child trace, never
null
.
-
-