|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.addsimplicity.anicetus.TelemetryContext
public class TelemetryContext
The TelemetryContext establishes the execution container for all telemetry. The execution context is defined by the system, process, and potentially the thread of execution for the session. A session is a logical concept that represents a unit of activity performed by the application. A session provides a container for other telemetry artifacts. Transactions are one of the artifacts that are also containers for other artifacts. The TelemetryContext provides a convenience method for creating other artifacts that will be parented to the current container (either session or transaction). The TelemetryContext is responsible for sending telemetry to the bus. By default, a session is sent anytime it ends. Applications may also send beacon telemetry (i.e. state and events) directly to the telemetry bus using the context convenience method. The lifecycle of the session is controlled by startSession and endSession. These methods are automatically called from the Spring container if Spring is used to manage the lifecycle of the context.
| Constructor Summary | |
|---|---|
TelemetryContext()
|
|
| Method Summary | |
|---|---|
void |
afterPropertiesSet()
Called after the Spring framework sets all properties. |
TelemetryTransaction |
beginTransaction(java.lang.String resourceId)
The beginTransaction method starts a new transaction as a child of the current session or transaction. |
protected TelemetrySession |
createSession()
|
void |
destroy()
The destroy method is called by the Spring framework when the context is being disposed. |
void |
endSession()
The current session is ended. |
void |
endTransaction()
The current transaction is closed. |
DeliveryAdapter |
getDeliveryAdapter()
Return the currently set delivery adapter. |
java.lang.String |
getOperationName()
Return the operation name. |
int |
getProcessIdentifier()
Return the processor identifier. |
java.lang.String |
getReportingNode()
Return the reporting node. |
TelemetrySession |
getSession()
Return the current active session. |
TelemetryEvent |
newEvent(java.lang.String type)
Create an event, child of the current context (session or transaction). |
TelemetryState |
newState()
Create a state, child of the current context (session or transaction). |
ExecInfo |
peekTransaction()
Return the current execution context (session or transaction). |
ExecInfo |
popTransaction()
Pop the current transaction off the top of the stack. |
void |
pushTransaction(ExecInfo transaction)
Push a transaction to the top of the execution context. |
void |
sendBeacon(GlobalInfo beacon)
Send a telemetry beacon that is independent of the current execution context. |
void |
setDeliveryAdapter(DeliveryAdapter deliveryAdapter)
Set the delivery adpater that will be used to publish events on the telemetry bus. |
void |
setOperationName(java.lang.String operationName)
Set the operation name for this context. |
void |
setProcessIdentifier(int processIdentifier)
Set the process identifier for this context. |
void |
setReportingNode(java.lang.String reportingNode)
Set the node identifier for this context. |
void |
startSession()
Start a new session. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public TelemetryContext()
| Method Detail |
|---|
public void afterPropertiesSet()
throws java.lang.Exception
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBeanjava.lang.ExceptionInitializingBean.afterPropertiesSet()public TelemetryTransaction beginTransaction(java.lang.String resourceId)
resourceId - The application defined resource identifier.
public void destroy()
throws java.lang.Exception
destroy in interface org.springframework.beans.factory.DisposableBeanjava.lang.ExceptionDisposableBean.destroy()public void endSession()
public void endTransaction()
public DeliveryAdapter getDeliveryAdapter()
public java.lang.String getOperationName()
public int getProcessIdentifier()
public java.lang.String getReportingNode()
public TelemetrySession getSession()
public TelemetryEvent newEvent(java.lang.String type)
type - The application defined type of the event.
public TelemetryState newState()
public ExecInfo peekTransaction()
public ExecInfo popTransaction()
public void pushTransaction(ExecInfo transaction)
transaction - The transaction to push.public void sendBeacon(GlobalInfo beacon)
beacon - The beacon to be sent.public void setDeliveryAdapter(DeliveryAdapter deliveryAdapter)
deliveryAdapter - The delivery adapter instance.public void setOperationName(java.lang.String operationName)
operationName - public void setProcessIdentifier(int processIdentifier)
processIdentifier - The JVM process identifier.public void setReportingNode(java.lang.String reportingNode)
reportingNode - The node network identifier.public void startSession()
protected TelemetrySession createSession()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||