Class TracerFactory
- java.lang.Object
-
- org.nuxeo.ecm.automation.core.trace.TracerFactory
-
- All Implemented Interfaces:
TracerFactoryMBean
public class TracerFactory extends Object implements TracerFactoryMBean
- Since:
- 5.7.3 The Automation tracer factory service.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static class
TracerFactory.ChainTraces
-
Field Summary
Fields Modifier and Type Field Description static String
AUTOMATION_TRACE_PRINTABLE_PROPERTY
static String
AUTOMATION_TRACE_PROPERTY
protected static Integer
CACHE_CONCURRENCY_LEVEL
protected static Integer
CACHE_MAXIMUM_SIZE
protected static Integer
CACHE_TIMEOUT
protected Trace
lastError
protected String
printable
protected Function<String,Boolean>
printableAssertor
protected boolean
recording
protected com.google.common.cache.Cache<String,TracerFactory.ChainTraces>
tracesCache
-
Constructor Summary
Constructors Constructor Description TracerFactory()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clearTrace(OperationChain chain)
void
clearTrace(OperationChain chain, int index)
void
clearTraces()
protected static String
formatKey(OperationType chain, int index)
Trace
getLastErrorTrace()
String
getPrintableTraces()
boolean
getRecordingState()
Trace
getTrace(String key)
Trace
getTrace(String key, int index)
Trace
getTrace(OperationChain chain, int index)
Call
newCall(OperationType chain, OperationContext context, OperationType type, InvokableMethod method, Map<String,Object> params)
If trace mode is enabled, instantiateCall
.Trace
newTrace(Call parent, OperationType typeof, List<Call> calls, Object output, Exception error)
OperationCallback
newTracer()
void
onTrace(Trace trace)
String
print(Trace trace)
protected void
recordTrace(Trace trace)
String
setPrintableTraces(String option)
boolean
toggleRecording()
-
-
-
Field Detail
-
AUTOMATION_TRACE_PROPERTY
public static final String AUTOMATION_TRACE_PROPERTY
- See Also:
- Constant Field Values
-
AUTOMATION_TRACE_PRINTABLE_PROPERTY
public static final String AUTOMATION_TRACE_PRINTABLE_PROPERTY
- See Also:
- Constant Field Values
-
CACHE_CONCURRENCY_LEVEL
protected static final Integer CACHE_CONCURRENCY_LEVEL
-
CACHE_MAXIMUM_SIZE
protected static final Integer CACHE_MAXIMUM_SIZE
-
CACHE_TIMEOUT
protected static final Integer CACHE_TIMEOUT
-
printable
protected String printable
-
tracesCache
protected com.google.common.cache.Cache<String,TracerFactory.ChainTraces> tracesCache
-
recording
protected boolean recording
-
lastError
protected Trace lastError
-
-
Method Detail
-
newTracer
public OperationCallback newTracer()
-
newCall
public Call newCall(OperationType chain, OperationContext context, OperationType type, InvokableMethod method, Map<String,Object> params)
-
newTrace
public Trace newTrace(Call parent, OperationType typeof, List<Call> calls, Object output, Exception error)
-
recordTrace
protected void recordTrace(Trace trace)
-
getTrace
public Trace getTrace(OperationChain chain, int index)
-
getTrace
public Trace getTrace(String key)
- Parameters:
key
- The name of the chain.- Returns:
- The last trace of the given chain.
-
getLastErrorTrace
public Trace getLastErrorTrace()
-
clearTrace
public void clearTrace(OperationChain chain, int index)
-
clearTrace
public void clearTrace(OperationChain chain)
-
clearTraces
public void clearTraces()
- Specified by:
clearTraces
in interfaceTracerFactoryMBean
-
formatKey
protected static String formatKey(OperationType chain, int index)
-
onTrace
public void onTrace(Trace trace)
-
toggleRecording
public boolean toggleRecording()
- Specified by:
toggleRecording
in interfaceTracerFactoryMBean
-
getRecordingState
public boolean getRecordingState()
- Specified by:
getRecordingState
in interfaceTracerFactoryMBean
-
getPrintableTraces
public String getPrintableTraces()
- Specified by:
getPrintableTraces
in interfaceTracerFactoryMBean
-
setPrintableTraces
public String setPrintableTraces(String option)
- Specified by:
setPrintableTraces
in interfaceTracerFactoryMBean
-
-