Package com.newrelic.agent.bridge
Class NoOpToken
- java.lang.Object
-
- com.newrelic.agent.bridge.NoOpToken
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanexpire()Once a token is taken from a transaction, the transaction will remain open until the token is expired.com.newrelic.api.agent.TransactiongetTransaction()Returns the transaction associated with the token.booleanisActive()Returns true if the token can be used to link work.booleanlink()Links the transaction associated with the token to the current thread.booleanlinkAndExpire()Links the transaction associated with the token to the current thread and expires the token.
-
-
-
Field Detail
-
INSTANCE
public static final Token INSTANCE
-
-
Method Detail
-
expire
public boolean expire()
Description copied from interface:TokenOnce a token is taken from a transaction, the transaction will remain open until the token is expired. This means a token can be used to join multiple units of work together.
-
link
public boolean link()
Description copied from interface:TokenLinks the transaction associated with the token to the current thread. Linking does not start tracing work on the thread. @Trace must be called to begin tracing work to be put into the transaction.
-
linkAndExpire
public boolean linkAndExpire()
Description copied from interface:TokenLinks the transaction associated with the token to the current thread and expires the token. If linking fails for any reason the token will still be expired. Linking does not start tracing work on the thread. @Trace must be called to begin tracing work to be put into the transaction.- Specified by:
linkAndExpirein interfaceToken- Specified by:
linkAndExpirein interfacecom.newrelic.api.agent.Token- Returns:
- Returns true if the current thread has been linked to the token's transaction and the token has been expired, false otherwise. Note: The token will be expired (if found) even if the result of this call is "false".
-
isActive
public boolean isActive()
Description copied from interface:TokenReturns true if the token can be used to link work. Returns false if the token has already been expired meaning it can no longer be used to link work.
-
getTransaction
public com.newrelic.api.agent.Transaction getTransaction()
Description copied from interface:TokenReturns the transaction associated with the token.- Specified by:
getTransactionin interfaceToken- Returns:
- Returns the transaction associated with the token or null if there is not one.
-
-