Package com.newrelic.agent.bridge
Class NoOpTransaction
- java.lang.Object
-
- com.newrelic.agent.bridge.NoOpTransaction
-
- All Implemented Interfaces:
Transaction,com.newrelic.api.agent.Transaction
public class NoOpTransaction extends java.lang.Object implements Transaction
-
-
Field Summary
Fields Modifier and Type Field Description static com.newrelic.agent.bridge.NoOpTransaction.NoOpMap<java.lang.String,java.lang.Object>AGENT_ATTRIBUTESstatic TransactionINSTANCEstatic com.newrelic.agent.bridge.NoOpTransaction.NoOpMap<java.lang.String,java.lang.Object>USER_ATTRIBUTES
-
Constructor Summary
Constructors Constructor Description NoOpTransaction()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidacceptDistributedTraceHeaders(com.newrelic.api.agent.TransportType transportType, com.newrelic.api.agent.Headers headers)voidacceptDistributedTracePayload(com.newrelic.api.agent.DistributedTracePayload payload)Accept a distributed trace payload.voidacceptDistributedTracePayload(java.lang.String payload)Accept a distributed trace payload.voidaddOutboundResponseHeaders()voidbeforeSendResponseHeaders()booleanclearTransaction()voidconvertToWebTransaction()TracedActivitycreateAndStartTracedActivity()com.newrelic.api.agent.DistributedTracePayloadcreateDistributedTracePayload()Create a distributed trace payload.voidexpireAllTokens()Expires all tokens associated with the current transaction.voidfinishFlyweightTracer(TracedMethod parent, long startInNanos, long finishInNanos, java.lang.String className, java.lang.String methodName, java.lang.String methodDesc, java.lang.String metricName, java.lang.String[] rollupMetricNames)java.util.Map<java.lang.String,java.lang.Object>getAgentAttributes()CrossProcessStategetCrossProcessState()TracedMethodgetLastTracer()java.lang.StringgetRequestMetadata()java.lang.StringgetResponseMetadata()java.lang.ObjectgetSecurityMetaData()TokengetToken()TracedMethodgetTracedMethod()java.util.Map<java.lang.String,java.lang.Object>getUserAttributes()WebResponsegetWebResponse()voidignore()voidignoreApdex()voidignoreErrors()Ignore throwable and http status code errors resulting from this transaction.voidinsertDistributedTraceHeaders(com.newrelic.api.agent.Headers headers)booleanisAutoAppNamingEnabled()booleanisStarted()booleanisTransactionNameSet()booleanisWebRequestSet()booleanisWebResponseSet()booleanisWebTransaction()booleanmarkFirstByteOfResponse()Does not affect APM UI.booleanmarkLastByteOfResponse()Does not affect APM UI.voidmarkResponseAtTxaEnd()booleanmarkResponseSent()voidprocessRequestMetadata(java.lang.String metadata)voidprocessResponseMetadata(java.lang.String metadata)voidprocessResponseMetadata(java.lang.String responseMetadata, java.net.URI uri)voidprovideHeaders(com.newrelic.api.agent.InboundHeaders headers)Provide a headers collection to be processed for NewRelic-defined synthetics, CAT, or beacon (RUM) header keysbooleanregisterAsyncActivity(java.lang.Object activityContext)voidrequestDestroyed()Called from servlet containers when a request is destroyed to finish the current web transaction.voidrequestInitialized(com.newrelic.api.agent.Request request, com.newrelic.api.agent.Response response)Called from servlet containers when a request is initiated.voidsaveMessageParameters(java.util.Map<java.lang.String,java.lang.String> parameters)voidsetApplicationName(ApplicationNamePriority priority, java.lang.String appName)Sets the name of the application as reported in the New Relic UI.booleansetTransactionName(TransactionNamePriority namePriority, boolean override, java.lang.String category, java.lang.String... parts)Sets the current transaction's name.booleansetTransactionName(com.newrelic.api.agent.TransactionNamePriority namePriority, boolean override, java.lang.String category, java.lang.String... parts)voidsetTransportType(com.newrelic.api.agent.TransportType transportType)voidsetWebRequest(com.newrelic.api.agent.ExtendedRequest request)voidsetWebRequest(com.newrelic.api.agent.Request request)voidsetWebResponse(com.newrelic.api.agent.Response response)TracedMethodstartFlyweightTracer()Starts a flyweight tracer and returns the parent tracer.com.newrelic.api.agent.SegmentstartSegment(java.lang.String segmentName)com.newrelic.api.agent.SegmentstartSegment(java.lang.String category, java.lang.String segmentName)
-
-
-
Field Detail
-
INSTANCE
public static final Transaction INSTANCE
-
AGENT_ATTRIBUTES
public static final com.newrelic.agent.bridge.NoOpTransaction.NoOpMap<java.lang.String,java.lang.Object> AGENT_ATTRIBUTES
-
USER_ATTRIBUTES
public static final com.newrelic.agent.bridge.NoOpTransaction.NoOpMap<java.lang.String,java.lang.Object> USER_ATTRIBUTES
-
-
Method Detail
-
beforeSendResponseHeaders
public void beforeSendResponseHeaders()
- Specified by:
beforeSendResponseHeadersin interfaceTransaction
-
addOutboundResponseHeaders
public void addOutboundResponseHeaders()
- Specified by:
addOutboundResponseHeadersin interfaceTransaction- Specified by:
addOutboundResponseHeadersin interfacecom.newrelic.api.agent.Transaction
-
setTransactionName
public boolean setTransactionName(com.newrelic.api.agent.TransactionNamePriority namePriority, boolean override, java.lang.String category, java.lang.String... parts)- Specified by:
setTransactionNamein interfacecom.newrelic.api.agent.Transaction
-
setTransactionName
public boolean setTransactionName(TransactionNamePriority namePriority, boolean override, java.lang.String category, java.lang.String... parts)
Description copied from interface:TransactionSets the current transaction's name.- Specified by:
setTransactionNamein interfaceTransactionoverride- Overrides the current transaction name if it has the same priority level (or lower).
-
isTransactionNameSet
public boolean isTransactionNameSet()
- Specified by:
isTransactionNameSetin interfacecom.newrelic.api.agent.Transaction
-
getLastTracer
public TracedMethod getLastTracer()
- Specified by:
getLastTracerin interfacecom.newrelic.api.agent.Transaction
-
getTracedMethod
public TracedMethod getTracedMethod()
- Specified by:
getTracedMethodin interfacecom.newrelic.api.agent.Transaction
-
isStarted
public boolean isStarted()
- Specified by:
isStartedin interfaceTransaction
-
setApplicationName
public void setApplicationName(ApplicationNamePriority priority, java.lang.String appName)
Description copied from interface:TransactionSets the name of the application as reported in the New Relic UI.- Specified by:
setApplicationNamein interfaceTransaction
-
isAutoAppNamingEnabled
public boolean isAutoAppNamingEnabled()
- Specified by:
isAutoAppNamingEnabledin interfaceTransaction
-
isWebRequestSet
public boolean isWebRequestSet()
- Specified by:
isWebRequestSetin interfaceTransaction- Returns:
-
isWebResponseSet
public boolean isWebResponseSet()
- Specified by:
isWebResponseSetin interfaceTransaction- Returns:
-
setWebRequest
public void setWebRequest(com.newrelic.api.agent.Request request)
- Specified by:
setWebRequestin interfaceTransaction- Parameters:
request- The current transaction's request.
-
setWebResponse
public void setWebResponse(com.newrelic.api.agent.Response response)
- Specified by:
setWebResponsein interfaceTransaction- Specified by:
setWebResponsein interfacecom.newrelic.api.agent.Transaction- Parameters:
response- The current transaction's response.
-
getWebResponse
public WebResponse getWebResponse()
- Specified by:
getWebResponsein interfaceTransaction- Returns:
-
convertToWebTransaction
public void convertToWebTransaction()
- Specified by:
convertToWebTransactionin interfaceTransaction- Specified by:
convertToWebTransactionin interfacecom.newrelic.api.agent.Transaction
-
isWebTransaction
public boolean isWebTransaction()
- Specified by:
isWebTransactionin interfaceTransaction- Specified by:
isWebTransactionin interfacecom.newrelic.api.agent.Transaction
-
requestInitialized
public void requestInitialized(com.newrelic.api.agent.Request request, com.newrelic.api.agent.Response response)Description copied from interface:TransactionCalled from servlet containers when a request is initiated. This starts a transaction which will be completed whenTransaction.requestDestroyed()is invoked.- Specified by:
requestInitializedin interfaceTransaction
-
requestDestroyed
public void requestDestroyed()
Description copied from interface:TransactionCalled from servlet containers when a request is destroyed to finish the current web transaction.- Specified by:
requestDestroyedin interfaceTransaction
-
ignore
public void ignore()
- Specified by:
ignorein interfacecom.newrelic.api.agent.Transaction
-
ignoreApdex
public void ignoreApdex()
- Specified by:
ignoreApdexin interfacecom.newrelic.api.agent.Transaction
-
ignoreErrors
public void ignoreErrors()
Description copied from interface:TransactionIgnore throwable and http status code errors resulting from this transaction.- Specified by:
ignoreErrorsin interfaceTransaction- Specified by:
ignoreErrorsin interfacecom.newrelic.api.agent.Transaction
-
saveMessageParameters
public void saveMessageParameters(java.util.Map<java.lang.String,java.lang.String> parameters)
- Specified by:
saveMessageParametersin interfaceTransaction
-
getCrossProcessState
public CrossProcessState getCrossProcessState()
- Specified by:
getCrossProcessStatein interfaceTransaction
-
startFlyweightTracer
public TracedMethod startFlyweightTracer()
Description copied from interface:TransactionStarts a flyweight tracer and returns the parent tracer.- Specified by:
startFlyweightTracerin interfaceTransaction- Returns:
-
finishFlyweightTracer
public void finishFlyweightTracer(TracedMethod parent, long startInNanos, long finishInNanos, java.lang.String className, java.lang.String methodName, java.lang.String methodDesc, java.lang.String metricName, java.lang.String[] rollupMetricNames)
- Specified by:
finishFlyweightTracerin interfaceTransaction
-
getAgentAttributes
public java.util.Map<java.lang.String,java.lang.Object> getAgentAttributes()
- Specified by:
getAgentAttributesin interfaceTransaction
-
getUserAttributes
public java.util.Map<java.lang.String,java.lang.Object> getUserAttributes()
- Specified by:
getUserAttributesin interfaceTransaction
-
registerAsyncActivity
public boolean registerAsyncActivity(java.lang.Object activityContext)
- Specified by:
registerAsyncActivityin interfaceTransaction- Parameters:
activityContext- the key used by instrumentation to identify this asynchronous activity. The value must be unique across all asynchronous activities tracked during the life of the current Agent instance.- Returns:
- true if the registration succeeded else false
-
provideHeaders
public void provideHeaders(com.newrelic.api.agent.InboundHeaders headers)
Description copied from interface:TransactionProvide a headers collection to be processed for NewRelic-defined synthetics, CAT, or beacon (RUM) header keys- Specified by:
provideHeadersin interfaceTransaction- Parameters:
headers- a headers collection
-
getRequestMetadata
public java.lang.String getRequestMetadata()
- Specified by:
getRequestMetadatain interfacecom.newrelic.api.agent.Transaction
-
processRequestMetadata
public void processRequestMetadata(java.lang.String metadata)
- Specified by:
processRequestMetadatain interfacecom.newrelic.api.agent.Transaction
-
getResponseMetadata
public java.lang.String getResponseMetadata()
- Specified by:
getResponseMetadatain interfacecom.newrelic.api.agent.Transaction
-
processResponseMetadata
public void processResponseMetadata(java.lang.String metadata)
- Specified by:
processResponseMetadatain interfacecom.newrelic.api.agent.Transaction
-
processResponseMetadata
public void processResponseMetadata(java.lang.String responseMetadata, java.net.URI uri)- Specified by:
processResponseMetadatain interfacecom.newrelic.api.agent.Transaction
-
setWebRequest
public void setWebRequest(com.newrelic.api.agent.ExtendedRequest request)
- Specified by:
setWebRequestin interfacecom.newrelic.api.agent.Transaction
-
markFirstByteOfResponse
public boolean markFirstByteOfResponse()
Description copied from interface:TransactionDoes not affect APM UI. SeeTransaction.markResponseSent()to set the response time. Marks the time when the first byte of the response left the server. This time can only be set once. After the first setting, all other attempts to set the time will fail and return false.- Specified by:
markFirstByteOfResponsein interfaceTransaction- Returns:
- True if the time to first byte was successfully set.
-
markLastByteOfResponse
public boolean markLastByteOfResponse()
Description copied from interface:TransactionDoes not affect APM UI. SeeTransaction.markResponseSent()to set the response time. Marks the time to last byte as right now (as this method is called). This time can only be set once. After the first setting, all other attempts to set the time will fail and return false.- Specified by:
markLastByteOfResponsein interfaceTransaction- Returns:
- True if the last byte time has not already been set.
-
markResponseAtTxaEnd
public void markResponseAtTxaEnd()
- Specified by:
markResponseAtTxaEndin interfaceTransaction
-
markResponseSent
public boolean markResponseSent()
- Specified by:
markResponseSentin interfaceTransaction- Specified by:
markResponseSentin interfacecom.newrelic.api.agent.Transaction- Returns:
- True if the call to set the response time was successful
-
createAndStartTracedActivity
public TracedActivity createAndStartTracedActivity()
- Specified by:
createAndStartTracedActivityin interfaceTransaction- Returns:
- a new traced activity, if successful. Will return null if the circuit breaker is tripped, if the transaction has not started, or if the transaction is ignored.
-
getToken
public Token getToken()
- Specified by:
getTokenin interfaceTransaction- Specified by:
getTokenin interfacecom.newrelic.api.agent.Transaction- Returns:
- A token to pass to another thread with work for the current transaction.
-
startSegment
public com.newrelic.api.agent.Segment startSegment(java.lang.String segmentName)
- Specified by:
startSegmentin interfacecom.newrelic.api.agent.Transaction
-
startSegment
public com.newrelic.api.agent.Segment startSegment(java.lang.String category, java.lang.String segmentName)- Specified by:
startSegmentin interfacecom.newrelic.api.agent.Transaction
-
expireAllTokens
public void expireAllTokens()
Description copied from interface:TransactionExpires all tokens associated with the current transaction. The transaction will then end when all currently running work then finishes.- Specified by:
expireAllTokensin interfaceTransaction
-
clearTransaction
public boolean clearTransaction()
- Specified by:
clearTransactionin interfaceTransaction
-
createDistributedTracePayload
public com.newrelic.api.agent.DistributedTracePayload createDistributedTracePayload()
Description copied from interface:TransactionCreate a distributed trace payload.- Specified by:
createDistributedTracePayloadin interfaceTransaction- Specified by:
createDistributedTracePayloadin interfacecom.newrelic.api.agent.Transaction- Returns:
- a
DistributedTracePayload
-
acceptDistributedTracePayload
public void acceptDistributedTracePayload(java.lang.String payload)
Description copied from interface:TransactionAccept a distributed trace payload.- Specified by:
acceptDistributedTracePayloadin interfaceTransaction- Specified by:
acceptDistributedTracePayloadin interfacecom.newrelic.api.agent.Transaction- Parameters:
payload-DistributedTracePayloadto accept
-
acceptDistributedTracePayload
public void acceptDistributedTracePayload(com.newrelic.api.agent.DistributedTracePayload payload)
Description copied from interface:TransactionAccept a distributed trace payload.- Specified by:
acceptDistributedTracePayloadin interfaceTransaction- Specified by:
acceptDistributedTracePayloadin interfacecom.newrelic.api.agent.Transaction- Parameters:
payload-DistributedTracePayloadto accept
-
insertDistributedTraceHeaders
public void insertDistributedTraceHeaders(com.newrelic.api.agent.Headers headers)
- Specified by:
insertDistributedTraceHeadersin interfacecom.newrelic.api.agent.Transaction
-
acceptDistributedTraceHeaders
public void acceptDistributedTraceHeaders(com.newrelic.api.agent.TransportType transportType, com.newrelic.api.agent.Headers headers)- Specified by:
acceptDistributedTraceHeadersin interfacecom.newrelic.api.agent.Transaction
-
getSecurityMetaData
public java.lang.Object getSecurityMetaData()
- Specified by:
getSecurityMetaDatain interfacecom.newrelic.api.agent.Transaction
-
setTransportType
public void setTransportType(com.newrelic.api.agent.TransportType transportType)
- Specified by:
setTransportTypein interfaceTransaction
-
-