|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.e2etrace.trace.AbstractTraceStep
public abstract class AbstractTraceStep
Abstract base class for trace steps.
All custom trace step implementation must inherit from this class.
Field Summary | |
---|---|
protected List |
children
|
Constructor Summary | |
---|---|
AbstractTraceStep(ITraceStepId id)
Constructor. |
Method Summary | |
---|---|
void |
addChild(ITraceStep child)
Adds a new child to this trace step. |
abstract void |
enter()
Enter the trace step and start time measuring. |
boolean |
equals(Object o)
|
ITraceStep[] |
getChildren()
Returns the list of children for this trace steps. |
abstract long |
getDuration()
Returns the duration of this TraceStep and all children. |
ITraceStepId |
getId()
Return the id of the trace step. |
abstract long |
getIsolatedDuration()
Returns the isolated duration of this TraceStep. |
ITraceStep |
getParent()
Returns the parent of a TraceStep, if any exists. |
int |
hashCode()
|
abstract boolean |
isActive()
Checks, if the current trace step is active. |
abstract void |
leave()
Leave the trace step and calculate the elapsed time since enter has been called. |
protected void |
leaveAllChildren()
Invokes leave() on all children of this trace step. |
void |
setParent(ITraceStep parent)
Set the parent of a TraceStep. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected List children
Constructor Detail |
---|
public AbstractTraceStep(ITraceStepId id)
id
- Id of the new trace stepMethod Detail |
---|
public ITraceStepId getId()
getId
in interface ITraceStep
public void addChild(ITraceStep child)
The implementation must make sure that the child receives a references to this
trace step. This reference must be returned by getParent()
.
addChild
in interface ITraceStep
child
- trace step to add as childpublic ITraceStep[] getChildren()
getChildren
in interface ITraceStep
public ITraceStep getParent()
getParent
in interface ITraceStep
public void setParent(ITraceStep parent)
This method is invoked when a new child is added using addChild()
. It should
never be called manually.
setParent
in interface ITraceStep
parent
- new parent of the child.public int hashCode()
hashCode
in class Object
public boolean equals(Object o)
equals
in class Object
public abstract void enter() throws IllegalStateException
This method should only be called once for a trace step. All subsequent calls will be ignored.
enter
in interface ITraceStep
IllegalStateException
public abstract long getDuration()
This value reflects the overall execution time of a trace step between the
calls to enter
and leave
inclusive the
durations of all children.
getDuration
in interface ITraceStep
public abstract long getIsolatedDuration()
The duration is the time elapsed between the calls to enter
and leave
minus the durations of all children.
getIsolatedDuration
in interface ITraceStep
public abstract boolean isActive()
A step is active between the calls to enter
and
leave
.
isActive
in interface ITraceStep
public abstract void leave() throws IllegalStateException
enter
has been called.
The elapsed time is returned by getDuration()
.
Leaving a step implies that all children are left, too.
This method should only be called once for a trace step. All subsequent calls will be ignored.
leave
in interface ITraceStep
IllegalStateException
protected void leaveAllChildren()
leave()
on all children of this trace step.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |