|
AppDynamics APM API v2.0 | |||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
public interface ITransactionDemarcator
This interface provides an API for java applications to integrate with AppDynamics business transaction management. This can be accessed by all classes in the application as it will be on the bootstrap classpath.
The api allows users to programmatically control transaction boundaries with single and multi threaded applications across distributed tiers.
| Field Summary | |
|---|---|
static java.lang.String |
APPDYNAMICS_TRANSACTION_CORRELATION_HEADER
Key name to retrieve AppDynamics Transaction Correlation Header from JMS Message Header properties |
| Method Summary | |
|---|---|
boolean |
addCurrentThreadToTransaction(java.lang.String uniqueIdentifierForTransaction,
java.lang.String activityName,
java.util.Map<java.lang.String,java.lang.String> activityProperties)
Method to add a thread's activity to a currently executing global transaction activity on a JVM. |
boolean |
addPropertiesForCurrentThread(java.util.Map<java.lang.String,java.lang.String> properties)
Method to add properties for the current thread's activity. |
boolean |
addPropertyForCurrentThread(java.lang.String name,
java.lang.String value)
Method to add a property for the current thread's activity. |
java.lang.String |
beginContinuingTransaction(java.lang.String appDynamicsTransactionHeader,
java.lang.String uniqueIdentifierForTransaction)
Marks begin of a multi threaded transaction originating from a remote JVM and identified by the correlation id 'appDynamicsTransactionHeader'. |
java.lang.String |
beginContinuingTransactionAndAddCurrentThread(java.lang.String appDynamicsTransactionHeader,
java.lang.String uniqueIdentifierForTransaction)
Marks begin of a transaction on cuerrent thread identified by the correlation id 'appDynamicsTransactionHeader' originating from a remote JVM . |
java.lang.String |
beginExternalCall(java.util.Map<java.lang.String,java.lang.String> invokedServiceIdentifyingProperties,
java.lang.String invokedServiceDisplayName,
boolean synchronous)
Marks the beginning of an external service call uniquely identified by the service identifying properties. |
java.lang.String |
beginExternalCall(java.lang.String invokedServiceIdentifyingName,
java.lang.String invokedServiceDisplayName,
boolean synchronous)
Marks the beginning of an external service call uniquely identified by the 'service identifying name' parameter. |
java.lang.String |
beginOriginatingTransaction(java.lang.String transactionName,
java.lang.String uniqueIdentifierForTransaction)
Method to start a new multi-threaded transaction on this JVM by name 'transactionName'. |
java.lang.String |
beginOriginatingTransactionAndAddCurrentThread(java.lang.String transactionName,
java.lang.String uniqueIdentifierForTransaction)
Method to start a new transaction on current thread by name 'transactionName'. |
boolean |
endContinuingTransaction(java.lang.String uniqueIdentifierForTransaction)
Method to end multi-threaded transaction activity tracking on a JVM. |
boolean |
endContinuingTransactionAndRemoveCurrentThread()
Method to end transaction activity tracking on a JVM for a continuing transaction. |
void |
endExternalCall(boolean error,
java.lang.String errorDetail)
Marks the end of an external service call. |
boolean |
endOriginatingTransaction(java.lang.String uniqueIdentifierForTransaction)
Method to end multi-threaded activity tracking on a JVM for a transaction originating in the same JVM. |
boolean |
endOriginatingTransactionAndRemoveCurrentThread()
Method to end transaction activity tracking on a JVM for a transaction originating in the current thread. |
java.lang.String |
extractTransactionHeaderFromJMSMessage(java.lang.Object jmsMessage)
Method to extract appdynamics transaction correlation header from a JMS Message. |
java.lang.String |
getUniqueIdentifierForTransaction()
Returns the unique transaction instance identifier for the transaction associated with the current thread or NULL if transaction is not intialized yet. |
boolean |
removeCurrentThreadFromTransaction()
Method to remove the current thread activity from the transaction. |
boolean |
setActivityNameForCurrentThread(java.lang.String activityName)
Method to set the logical name for the current thread activity. |
boolean |
setUniqueIdentifierForTransaction(java.lang.String uniqueIdentifierForTransaction)
Sets the unique transaction instance identifier for the transaction to the user defined id. |
| Field Detail |
|---|
static final java.lang.String APPDYNAMICS_TRANSACTION_CORRELATION_HEADER
| Method Detail |
|---|
java.lang.String beginExternalCall(java.lang.String invokedServiceIdentifyingName,
java.lang.String invokedServiceDisplayName,
boolean synchronous)
throws java.lang.IllegalArgumentException
beginContinuingTransactionAndAddCurrentThread api to continue the transaction.
If the caller is not waiting for external call invocation to complete (e.g. has a semantics
similar to JMS send(Message msg) api) the synchronous boolean should be set to false.
Refer Sample code
AsyncClient.
On server side use beginContinuingTransaction api to continue the transaction.
invokedServiceIdentifyingName - the name uniquely identifying the service being calledinvokedServiceDisplayName - the display name of the service being calledsynchronous - if the caller is waiting for external call to respond before proceeding
java.lang.IllegalArgumentException - if invokedServiceIdentifyingName is null
java.lang.String beginExternalCall(java.util.Map<java.lang.String,java.lang.String> invokedServiceIdentifyingProperties,
java.lang.String invokedServiceDisplayName,
boolean synchronous)
beginContinuingTransactionAndAddCurrentThread api to continue the transaction.
If the caller is not waiting for external call invocation to complete (e.g. has a semantics
similar to JMS send(Message msg) api) the synchronous boolean should be set to false.
Refer Sample code
AsyncClient
On server side use beginContinuingTransaction api to continue the transaction.
invokedServiceIdentifyingProperties - mandatory, the properties uniquely identifying the service being calledinvokedServiceDisplayName - mandatory, the display name of the service being calledsynchronous - if the caller is waiting for invoked service to complete execution before invoking
java.lang.IllegalArgumentException - if invokedServiceIdentifyingProperties is null orm empty
void endExternalCall(boolean error,
java.lang.String errorDetail)
error - if any error occurred during the execution of the external callerrorDetail - string containing a detailed message about the error
java.lang.String beginContinuingTransactionAndAddCurrentThread(java.lang.String appDynamicsTransactionHeader,
java.lang.String uniqueIdentifierForTransaction)
beginContinuingTransaction api instead.
This method starts measuring time for the transaction activity on this JVM and records the total time till
endContinuingTransactionAndRemoveCurrentThread is called
on the current thread. This method also starts capturing the call graph of the caller thread. If additional threads need to participate
in this global transaction they need to invoke addCurrentThreadToTransaction and
removeCurrentThreadFromTransaction with the transaction instance identifier.
This method should be called only once for a given 'appDynamicsTransactionHeader'.
Refer Sample code
SyncServer
appDynamicsTransactionHeader - the appdynamics transaction correlation header propagated from remote JVMuniqueIdentifierForTransaction - unique transaction instance identifier for all threads which are a part of this transaction,
if null system generates a new id and returns it.
boolean endContinuingTransactionAndRemoveCurrentThread()
beginContinuingTransactionAndAddCurrentThread.
It will record the total time for the transaction activity.
java.lang.String getUniqueIdentifierForTransaction()
addCurrentThreadToTransaction
api should be invoked by the worker thread with this transaction instance id.
See sample
MultiThreadServer
The identifier should not be used for correlating transactions across different
tiers.
boolean setUniqueIdentifierForTransaction(java.lang.String uniqueIdentifierForTransaction)
throws java.lang.IllegalArgumentException
uniqueIdentifierForTransaction - user defined unique transaction instance identifier
java.lang.IllegalArgumentException - if uniqueIdentifierForTransaction is null
boolean addCurrentThreadToTransaction(java.lang.String uniqueIdentifierForTransaction,
java.lang.String activityName,
java.util.Map<java.lang.String,java.lang.String> activityProperties)
removeCurrentThreadFromTransaction is called.
See sample
MutiThreadedExecutor
uniqueIdentifierForTransaction - the identification information for the transaction this thread is a part ofactivityName - the logical name for this activity visible in call graph user interface, this is an optional information
and can be set later using the setActivityNameForCurrentThread.activityProperties - any properties for this activity that need to be viewed in the visualization for the call graph for this thread , this is an optional
information for this call and can be set later using the addPropertiesForCurrentThread
boolean removeCurrentThreadFromTransaction()
boolean setActivityNameForCurrentThread(java.lang.String activityName)
activityName - the logical name for this activity, easy way to identify the activity in call graph ui
boolean addPropertyForCurrentThread(java.lang.String name,
java.lang.String value)
name - the name for the propertyvalue - the value for the property
boolean addPropertiesForCurrentThread(java.util.Map<java.lang.String,java.lang.String> properties)
properties - properties to be added.
java.lang.String extractTransactionHeaderFromJMSMessage(java.lang.Object jmsMessage)
throws java.lang.IllegalArgumentException
APPDYNAMICS_KEY) api
jmsMessage - the javax.jms.Message received on this tier
java.lang.IllegalArgumentException - if the object passed is not an instance of javax.jms.Message.
java.lang.String beginContinuingTransaction(java.lang.String appDynamicsTransactionHeader,
java.lang.String uniqueIdentifierForTransaction)
beginContinuingTransactionAndAddCurrentThread api instead.
The second parameter is a unique transaction instance id shared by all threads that participate in this global transaction.
This method starts measuring time for the multi threaded transaction activity on this JVM and records the total time when the
endContinuingTransaction is called
with the transaction instance identifier.
The calling thread is not associated with the transaction, hence if the calling thread's activity needs
to be captured then addCurrentThreadToTransaction and
removeCurrentThreadFromTransaction must be
invoked explicitly on current thread.
To mark the end of the transaction endContinuingTransaction needs to be invoked.
(from any thread) with the transaction instance identifier.
This method should be called only once for a given 'appDynamicsTransactionHeader'.
Refer Sample code
AsyncServer
appDynamicsTransactionHeader - the appdynamics transaction correlation header propagated from remote JVMuniqueIdentifierForTransaction - unique transaction instance identifier for all threads which are a part of this transaction,
if null system generates a new id and returns it.
boolean endContinuingTransaction(java.lang.String uniqueIdentifierForTransaction)
uniqueIdentifierForTransaction - the identification for this transaction
java.lang.String beginOriginatingTransaction(java.lang.String transactionName,
java.lang.String uniqueIdentifierForTransaction)
throws java.lang.IllegalArgumentException
endOriginatingTransaction is called
with the transaction instance identifier.
The calling thread is not associated with the transaction, hence if the calling thread's activity needs
to be captured then addCurrentThreadToTransaction and
removeCurrentThreadFromTransaction must be
invoked explicitly on current thread.
Refer Sample code
MultiThreadServer
transactionName - the name of the business transactionuniqueIdentifierForTransaction - unique transaction instance identifier for all threads which are a part of this transaction,
if null system generates a new id that can be retrieved using
getUniqueIdentifierForTransaction.
java.lang.IllegalArgumentException - if transactionName is emptyboolean endOriginatingTransaction(java.lang.String uniqueIdentifierForTransaction)
uniqueIdentifierForTransaction - the identification for this transaction
java.lang.String beginOriginatingTransactionAndAddCurrentThread(java.lang.String transactionName,
java.lang.String uniqueIdentifierForTransaction)
endOriginatingTransactionAndRemoveCurrentThread is called.
on the same thread. This method also starts capturing the call graph of the caller thread if applicable.
The addCurrentThreadToTransaction method needs
to be called from all threads whose execution time and activity call graphs need to be captured adn associated with the this transaction.
Refer Sample code
MultiThreadServer
transactionName - the name of the business transactionuniqueIdentifierForTransaction - unique transaction instance identifier for all threads which are a part of this transaction,
if null system generates a new id that can be retrieved using
getUniqueIdentifierForTransaction.
java.lang.IllegalArgumentException - if transactionName is emptyboolean endOriginatingTransactionAndRemoveCurrentThread()
beginOriginatingTransactionAndAddCurrentThread.
|
AppDynamics APM API v2.0 | |||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||