public class DefaultTraceCollector extends Object implements TraceCollector, SessionManager
| Constructor and Description |
|---|
DefaultTraceCollector() |
DefaultTraceCollector(BatchTraceRecorder batchTraceRecorder) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
activate(String uri,
String operation)
This method is a guard condition for instrumentation rules, used
to determine whether the invoker should be permitted to create
and record a node as part of a trace fragment.
|
boolean |
activate(String uri,
String operation,
String id)
This method is a guard condition for Consumer based instrumentation
rules, used to determine whether the invoker should be permitted to
create and record a Consumer as part of a trace fragment.
|
void |
appendInBuffer(String location,
Object obj,
byte[] data,
int offset,
int len)
This method appends data to the buffer associated with the supplied object.
|
void |
appendOutBuffer(String location,
Object obj,
byte[] data,
int offset,
int len)
This method appends data to the buffer associated with the supplied out object.
|
void |
assertComplete()
This method asserts that the current thread of execution is complete.
|
protected void |
checkForCompletion(FragmentBuilder builder,
Node node)
This method checks whether the supplied fragment has been completed
and therefore should be processed.
|
void |
completeCorrelation(String id,
boolean allowSpawn)
This method ends the correlation between the current thread of execution and another
associated with the supplied id.
|
void |
componentEnd(String location,
String uri,
String type,
String operation)
This method indicates the end of a component invocation.
|
void |
componentStart(String location,
String uri,
String type,
String operation)
This method indicates the start of a component invocation.
|
void |
consumerEnd(String location,
String uri,
String type,
String operation)
This method indicates the end of a message being consumed.
|
void |
consumerStart(String location,
String uri,
String type,
String operation,
String id)
This method indicates the start of a message being consumed.
|
void |
correlate(String id)
This method associates the current thread of execution with the session associated
with the supplied correlation id.
|
void |
deactivate()
This method deactivates an active session.
|
protected void |
diagnostics()
This method reports diagnostic information to the log.
|
protected int |
getCode(Object obj)
This method returns a code associated with the supplied object.
|
protected FragmentManager |
getFragmentManager()
This method provides access to the fragment manager.
|
protected String |
getHeaderValueText(Object value)
This method returns a textual representation of the supplied
header value.
|
String |
getLevel()
This method returns the reporting level.
|
Object |
getState(Object context,
String name,
boolean session)
This method returns the state associated with the name and optional
context.
|
String |
getTenantId() |
String |
getTraceId()
This method returns the trace id.
|
String |
getTransaction()
This method returns the name of the transaction.
|
void |
ignoreNode()
This method indicates that the current node can be ignored if handled out of
order.
|
protected void |
initConfig()
This method initialises the configuration.
|
void |
initiateCorrelation(String id)
This method initiates a correlation between this thread of execution and one or more based
on the supplied id.
|
void |
initInBuffer(String location,
Object obj)
This method initialises a data buffer associated with the supplied object.
|
void |
initOutBuffer(String location,
Object obj)
This method initialises a data buffer associated with the supplied out object.
|
protected void |
initRefreshCycle()
This method initialises the refresh cycle.
|
boolean |
isActive()
This method determines if there is an active session associated with
this thread of execution.
|
boolean |
isCorrelated(String id)
This method identifies whether a correlation with the supplied id is currently active
(i.e.
|
boolean |
isInBufferActive(String location,
Object obj)
This method determines if there is an active in data buffer for
the supplied object.
|
boolean |
isInContentProcessed(String location)
This method identifies whether the in content for the current
trace and node will be processed to extract information.
|
boolean |
isInProcessed(String location)
This method identifies whether the in data (content and headers) for the current
trace and node will be processed to extract information.
|
boolean |
isOutBufferActive(String location,
Object obj)
This method determines if there is an active out data buffer for
the supplied object.
|
boolean |
isOutContentProcessed(String location)
This method identifies whether the out content for the current
trace and node will be processed to extract information.
|
boolean |
isOutProcessed(String location)
This method identifies whether the out data (content and headers) for the current
trace and node will be processed to extract information.
|
protected void |
mergeProducer(Producer inner,
Producer outer)
This method merges an inner Producer node information into its
containing Producer node, before removing the inner node.
|
protected <T extends Node> |
pop(String location,
FragmentBuilder builder,
Class<T> cls,
String uri)
This method pops an existing node from the trace fragment.
|
void |
processIn(String location,
Map<String,?> headers,
Object... values)
This method processes the supplied in headers and content.
|
protected void |
processInContent(String location,
FragmentBuilder builder,
int hashCode)
This method processes the in content if available.
|
void |
processOut(String location,
Map<String,?> headers,
Object... values)
This method processes the supplied out headers and content.
|
protected void |
processOutContent(String location,
FragmentBuilder builder,
int hashCode)
This method processes the out content if available.
|
protected void |
processValues(Trace trace,
Node node,
Direction direction,
Map<String,?> headers,
Object[] values)
This method processes the values associated with the start or end of a scoped
activity.
|
void |
producerEnd(String location,
String uri,
String type,
String operation)
This method indicates the end of a message being produced.
|
void |
producerStart(String location,
String uri,
String type,
String operation,
String id)
This method indicates the start of a message being produced.
|
protected void |
push(String location,
FragmentBuilder builder,
Node node)
This method pushes a new node into the trace fragment.
|
void |
recordInBuffer(String location,
Object obj)
This method records the data within a buffer associated with the supplied in
object.
|
void |
recordOutBuffer(String location,
Object obj)
This method records the data within a buffer associated with the supplied
object.
|
void |
releaseNode(String id)
This method indicates that the identified node, for this thread of execution, should
be released.
|
void |
retainNode(String id)
This method indicates that the current node, for this thread of execution, should
be retained temporarily pending further changes.
|
Node |
retrieveNode(String id)
This method returns the node associated, for this thread of execution, identified
by the supplied id.
|
SessionManager |
session()
This method returns the session manager associated with the
current thread of execution.
|
protected void |
setConfigurationService(ConfigurationService configService)
This method sets the configuration service.
|
void |
setLevel(String location,
String level)
This method sets the reporting level.
|
void |
setProperty(String location,
String name,
String value)
This method sets a property on the trace.
|
void |
setState(Object context,
String name,
Object value,
boolean session)
This method stores state information associated with the name and optional
context.
|
void |
setTenantId(String tenantId) |
void |
setTraceId(String location,
String value)
This method sets the id of the trace.
|
void |
setTransaction(String location,
String name)
This method sets the name of the trace.
|
protected void |
spawnFragment(FragmentBuilder parentBuilder,
Node node,
int position,
FragmentBuilder spawnedBuilder)
This method creates a new linked fragment to handle some asynchronous
activities.
|
void |
suppress()
This method suppressed recording of any child nodes under the current
transaction fragment node.
|
void |
unlink()
Unlink the current "linked" thread of execution from the target thread.
|
public DefaultTraceCollector()
public DefaultTraceCollector(BatchTraceRecorder batchTraceRecorder)
protected void setConfigurationService(ConfigurationService configService)
configService - The configuration serviceprotected void initConfig()
protected void initRefreshCycle()
public String getTenantId()
public void setTenantId(String tenantId)
tenantId - the tenantId to setpublic void setTraceId(String location, String value)
TraceCollectorsetTraceId in interface TraceCollectorlocation - The instrumentation locationvalue - The trace idpublic String getTraceId()
TraceCollectorgetTraceId in interface TraceCollectorpublic void setTransaction(String location, String name)
TraceCollectorsetTransaction in interface TraceCollectorlocation - The instrumentation locationname - The transaction namepublic String getTransaction()
TraceCollectorgetTransaction in interface TraceCollectorpublic void setLevel(String location, String level)
TraceCollectorsetLevel in interface TraceCollectorlocation - The instrumentation locationlevel - The reporting levelpublic String getLevel()
TraceCollectorgetLevel in interface TraceCollectorpublic void consumerStart(String location, String uri, String type, String operation, String id)
TraceCollectorconsumerStart in interface TraceCollectorlocation - The instrumentation locationuri - The uritype - The endpoint typeoperation - The operationid - The unique interaction idpublic void consumerEnd(String location, String uri, String type, String operation)
TraceCollectorconsumerEnd in interface TraceCollectorlocation - The instrumentation locationuri - The uritype - The endpoint typeoperation - The operationpublic void componentStart(String location, String uri, String type, String operation)
TraceCollectorcomponentStart in interface TraceCollectorlocation - The instrumentation locationuri - The uritype - The component typeoperation - The operationpublic void componentEnd(String location, String uri, String type, String operation)
TraceCollectorcomponentEnd in interface TraceCollectorlocation - The instrumentation locationuri - The uritype - The component typeoperation - The operationpublic void producerStart(String location, String uri, String type, String operation, String id)
TraceCollectorproducerStart in interface TraceCollectorlocation - The instrumentation locationuri - The uritype - The endpoint typeoperation - The operationid - The unique interaction idpublic void producerEnd(String location, String uri, String type, String operation)
TraceCollectorproducerEnd in interface TraceCollectorlocation - The instrumentation locationuri - The uritype - The endpoint typeoperation - The operationprotected void mergeProducer(Producer inner, Producer outer)
inner - outer - public boolean isInProcessed(String location)
TraceCollectorisInProcessed in interface TraceCollectorlocation - The instrumentation locationpublic boolean isInContentProcessed(String location)
TraceCollectorisInContentProcessed in interface TraceCollectorlocation - The instrumentation locationpublic boolean isOutProcessed(String location)
TraceCollectorisOutProcessed in interface TraceCollectorlocation - The instrumentation locationpublic boolean isOutContentProcessed(String location)
TraceCollectorisOutContentProcessed in interface TraceCollectorlocation - The instrumentation locationpublic void processIn(String location, Map<String,?> headers, Object... values)
TraceCollectorprocessIn in interface TraceCollectorlocation - The instrumentation locationheaders - The header valuesvalues - The valuespublic void processOut(String location, Map<String,?> headers, Object... values)
TraceCollectorprocessOut in interface TraceCollectorlocation - The instrumentation locationheaders - The header valuesvalues - The valuespublic void setProperty(String location, String name, String value)
TraceCollectorsetProperty in interface TraceCollectorlocation - The instrumentation locationname - The property namevalue - The property valuepublic void initInBuffer(String location, Object obj)
TraceCollectorinitInBuffer in interface TraceCollectorlocation - The instrumentation locationobj - The object associated with the bufferprotected int getCode(Object obj)
obj - The optional objectpublic boolean isInBufferActive(String location, Object obj)
TraceCollectorisInBufferActive in interface TraceCollectorlocation - The instrumentation locationobj - The object associated with the bufferpublic void appendInBuffer(String location, Object obj, byte[] data, int offset, int len)
TraceCollectorappendInBuffer in interface TraceCollectorlocation - The instrumentation locationobj - The object associated with the bufferdata - The data to be appendedoffset - The offset of the datalen - The length of datapublic void recordInBuffer(String location, Object obj)
TraceCollectorrecordInBuffer in interface TraceCollectorlocation - The instrumentation locationobj - The object associated with the bufferprotected void processInContent(String location, FragmentBuilder builder, int hashCode)
location - The instrumentation locationbuilder - The builderhashCode - The hash code, or -1 to ignore the hash codepublic void initOutBuffer(String location, Object obj)
TraceCollectorinitOutBuffer in interface TraceCollectorlocation - The instrumentation locationobj - The object associated with the bufferpublic boolean isOutBufferActive(String location, Object obj)
TraceCollectorisOutBufferActive in interface TraceCollectorlocation - The instrumentation locationobj - The object associated with the bufferpublic void appendOutBuffer(String location, Object obj, byte[] data, int offset, int len)
TraceCollectorappendOutBuffer in interface TraceCollectorlocation - The instrumentation locationobj - The object associated with the bufferdata - The data to be appendedoffset - The offset of the datalen - The length of datapublic void recordOutBuffer(String location, Object obj)
TraceCollectorrecordOutBuffer in interface TraceCollectorlocation - The instrumentation locationobj - The object associated with the bufferprotected void processOutContent(String location, FragmentBuilder builder, int hashCode)
location - The instrumentation locationbuilder - The builderhashCode - The hash code, or -1 to ignore the hash codeprotected void push(String location, FragmentBuilder builder, Node node)
location - The instrumentation locationbuilder - The fragment buildernode - The nodeprotected <T extends Node> T pop(String location, FragmentBuilder builder, Class<T> cls, String uri)
location - The instrumentation locationThe - class to popThe - optional URI to matchprotected void processValues(Trace trace, Node node, Direction direction, Map<String,?> headers, Object[] values)
trace - The tracenode - The nodedirection - The directionheaders - The optional headersvalues - The valuesprotected String getHeaderValueText(Object value)
value - The original valueprotected void checkForCompletion(FragmentBuilder builder, Node node)
node - The most recently popped nodebuilder - The fragment builderpublic boolean activate(String uri, String operation)
SessionManageractivate in interface SessionManageruri - The URIoperation - The optional operationpublic boolean activate(String uri, String operation, String id)
SessionManageractivate in interface SessionManageruri - The URIoperation - The optional operationid - The idpublic boolean isActive()
SessionManagerisActive in interface SessionManagerpublic void deactivate()
SessionManagerdeactivate in interface SessionManagerpublic void retainNode(String id)
SessionManagerretainNode in interface SessionManagerid - The identifier used to later on to identify the nodepublic void releaseNode(String id)
SessionManagerreleaseNode in interface SessionManagerid - The identifier used to identify the nodepublic Node retrieveNode(String id)
SessionManagerretrieveNode in interface SessionManagerid - The identifier used to identify the nodepublic void initiateCorrelation(String id)
SessionManagerinitiateCorrelation in interface SessionManagerid - The idpublic boolean isCorrelated(String id)
SessionManagerisCorrelated in interface SessionManagerid - The idpublic void correlate(String id)
SessionManagercorrelate in interface SessionManagerid - The id associated with the target thread of executionpublic void completeCorrelation(String id, boolean allowSpawn)
SessionManagercompleteCorrelation in interface SessionManagerid - The id associated with the target thread of executionallowSpawn - Determine if completing correlation can spawn fragment if requiredprotected void spawnFragment(FragmentBuilder parentBuilder, Node node, int position, FragmentBuilder spawnedBuilder)
public void unlink()
SessionManagerunlink in interface SessionManagerpublic void suppress()
SessionManagersuppress in interface SessionManagerpublic void ignoreNode()
SessionManagerignoreNode in interface SessionManagerpublic void assertComplete()
SessionManagerassertComplete in interface SessionManagerpublic void setState(Object context, String name, Object value, boolean session)
SessionManagersetState in interface SessionManagercontext - The optional contextname - The namevalue - The valuesession - Whether related to sessionpublic Object getState(Object context, String name, boolean session)
SessionManagergetState in interface SessionManagercontext - The optional contextname - The namesession - Whether related to sessionpublic SessionManager session()
TraceCollectorsession in interface TraceCollectorprotected FragmentManager getFragmentManager()
protected void diagnostics()
Copyright © 2015–2017 Red Hat, Inc.. All rights reserved.