public abstract class ScopedTraceHandler extends Object implements TraceHandler
When the traced method that created the scope exits, the scope exits, and gathered data is reported. If a parent scope exists, this data is transferred to it as well.
| Modifier and Type | Class and Description |
|---|---|
static class |
ScopedTraceHandler.MethodData |
static class |
ScopedTraceHandler.Scope |
| Constructor and Description |
|---|
ScopedTraceHandler(TraceToolbox toolbox) |
| Modifier and Type | Method and Description |
|---|---|
void |
enterMethod(int mid)
Called by a traced method upon entry.
|
void |
enterMethod(int mid,
Object... arguments)
Called by a traced method upon entry.
|
void |
enterMethod(int mid,
Object argument)
Called by a traced method upon entry.
|
void |
exitMethod(int mid)
Called by a traced method upon exit.
|
void |
exitMethod(int mid,
long timeNanos)
Called by a traced method upon exit.
|
void |
exitMethod(int mid,
Object result)
Called by a traced method upon exit.
|
void |
exitMethod(int mid,
Object result,
long timeNanos)
Called by a traced method upon exit.
|
void |
exitMethod(int mid,
Throwable t)
Called by a traced method upon exit caused by a thrown exception.
|
void |
exitMethod(int mid,
Throwable t,
long timeNanos)
Called by a traced method upon exit caused by a thrown exception.
|
protected TraceToolbox |
getToolbox() |
TraceModes |
getTraceModes(String className)
Always returns
TraceModes.ALL_USER. |
protected abstract void |
report(ScopedTraceHandler.Scope scope)
Called when a scope exits, allowing subclasses to report on the data it
gathered.
|
protected Object |
scopeGet(String key)
Retrieve an arbitrary key-value pair from the current scope, unless
there is no current scope.
|
protected boolean |
scopePut(String key,
Object value)
Add an arbitrary key-value pair to the current scope, unless there is no
current scope.
|
public ScopedTraceHandler(TraceToolbox toolbox)
public TraceModes getTraceModes(String className)
TraceModes.ALL_USER.getTraceModes in interface TraceHandlerclassName - full name of class which may contain traced methodspublic void enterMethod(int mid)
TraceHandlerenterMethod in interface TraceHandlermid - method idpublic void enterMethod(int mid,
Object argument)
TraceHandlerenterMethod in interface TraceHandlermid - method idargument - argument passed to method; is "this" for non-static methodpublic void enterMethod(int mid,
Object... arguments)
TraceHandlerenterMethod in interface TraceHandlermid - method idarguments - arguments passed to method; first is "this" for non-static methodpublic void exitMethod(int mid)
TraceHandlerexitMethod in interface TraceHandlermid - method idpublic void exitMethod(int mid,
long timeNanos)
TraceHandlerexitMethod in interface TraceHandlermid - method idtimeNanos - total execution time of method, in nanosecondspublic void exitMethod(int mid,
Object result)
TraceHandlerexitMethod in interface TraceHandlermid - method idresult - method return valuepublic void exitMethod(int mid,
Object result,
long timeNanos)
TraceHandlerexitMethod in interface TraceHandlermid - method idresult - method return valuetimeNanos - total execution time of method, in nanosecondspublic void exitMethod(int mid,
Throwable t)
TraceHandlerexitMethod in interface TraceHandlermid - method idt - exception thrown by methodpublic void exitMethod(int mid,
Throwable t,
long timeNanos)
TraceHandlerexitMethod in interface TraceHandlermid - method idt - exception thrown by methodtimeNanos - total execution time of method, in nanosecondsprotected TraceToolbox getToolbox()
protected boolean scopePut(String key, Object value)
protected Object scopeGet(String key)
protected abstract void report(ScopedTraceHandler.Scope scope)
Copyright © 2006–2015 Cojen. All rights reserved.