org.addsimplicity.anicetus.entity
Class ExecInfo

java.lang.Object
  extended by org.addsimplicity.anicetus.entity.GlobalInfo
      extended by org.addsimplicity.anicetus.entity.ExecInfo
All Implemented Interfaces:
java.util.Map<java.lang.String,java.lang.Object>, TelemetryContainer
Direct Known Subclasses:
TelemetrySession, TelemetryTransaction

public abstract class ExecInfo
extends GlobalInfo
implements TelemetryContainer

ExecInfo provides an execution container for telemetry that has a duration and potentially child telemetry.

Author:
Dan Pritchett (driveawedge@yahoo.com)

Nested Class Summary
 
Nested classes/interfaces inherited from interface java.util.Map
java.util.Map.Entry<K,V>
 
Constructor Summary
protected ExecInfo()
          Create an ExecInfo without a parent.
protected ExecInfo(GlobalInfo parent)
          Create an ExecInfo with the specified telemetry as the parent.
 
Method Summary
 void addChild(GlobalInfo child)
          Add a child to this container.
 void complete()
          Complete the current execution container.
 java.util.Collection<GlobalInfo> getChildren()
          Return the children of the execution container.
 long getDuration()
          Get the duration of the execution of the container.
 CompletionStatus getStatus()
          Return the completion status of the operation.
 void setDuration(long duration)
          Set the execution time in nanoseconds.
 void setStatus(CompletionStatus status)
          Set the completion status of the execution.
 void startTimer()
          Reset the start time of the operation.
 
Methods inherited from class org.addsimplicity.anicetus.entity.GlobalInfo
clear, containsKey, containsValue, entrySet, equals, get, getEntityId, getExecutionContext, getMessage, getParentId, getReportingNode, getTimeStamp, hashCode, isEmpty, keySet, put, putAll, remove, setEntityId, setExceptionAsMessage, setExecutionContext, setMessage, setParentId, setReportingNode, setTimeStamp, size, values
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExecInfo

protected ExecInfo()
Create an ExecInfo without a parent.


ExecInfo

protected ExecInfo(GlobalInfo parent)
Create an ExecInfo with the specified telemetry as the parent.

Parameters:
parent - The telemetry entity that will be considered the parent of this entity.
Method Detail

addChild

public void addChild(GlobalInfo child)
Add a child to this container. The entity will be marked as having this container as the parent.

Specified by:
addChild in interface TelemetryContainer
Parameters:
child - The entity to add to this container.
See Also:
TelemetryContainer.addChild(org.addsimplicity.anicetus.entity.GlobalInfo)

complete

public void complete()
Complete the current execution container. The duration of the execution is set automatically based the difference of when the event was created and the time this method is called. If the completion status has not been set, it will be set to Unknown.


getChildren

public java.util.Collection<GlobalInfo> getChildren()
Return the children of the execution container.

Specified by:
getChildren in interface TelemetryContainer
Returns:
the children of this container.

getDuration

public long getDuration()
Get the duration of the execution of the container. Note that this field will not be set until the complete method has been called.

Returns:
the execution time in nanoseconds.

getStatus

public CompletionStatus getStatus()
Return the completion status of the operation.

Returns:
the completion status.

setDuration

public void setDuration(long duration)
Set the execution time in nanoseconds. Note that the preferred method for setting the duration is to use the complete method and let the duration be computed.

Parameters:
duration - The execution time in milliseconds.

setStatus

public void setStatus(CompletionStatus status)
Set the completion status of the execution.

Parameters:
status - The completion status of the execution.

startTimer

public void startTimer()
Reset the start time of the operation. By default it is set to the object creation time.



Copyright © 2009 Add Simplicity. All Rights Reserved.