public class JAMonInterceptor extends Object
Modifier and Type | Field and Description |
---|---|
protected static int |
DEFAULT_ARG_STRING_MAX_LENGTH
Maximum length for a parameter in the exception dump
|
protected static String |
DEFAULT_MAX_STRING_ENDING
Parameters kept in the details section are capped at a max length and this string is put at the end of
the string after the truncation point to indicate there is more data that is not shown.
|
protected static String |
EXCEPTION_UNITS
Exception units
|
protected String |
exceptionLabel
JAMon exception label - can be overridden in subclasses.
|
protected static String |
LINE_SEPARATOR |
protected static String |
MONITOR_PREFIX |
protected static String |
NULL_STR
Returned when a method parameter is null
|
protected static String |
UNKNOWN
used when a value isn't returned, and yet we don't want to throw an exception (hey it's just monitoring)
|
Modifier | Constructor and Description |
---|---|
|
JAMonInterceptor() |
protected |
JAMonInterceptor(String exceptionLabel) |
Modifier and Type | Method and Description |
---|---|
protected String |
createExceptionDetails(String label,
Object[] parameters,
Exception exception)
Default exception handling.
|
protected String |
getJamonLabel(javax.interceptor.InvocationContext ctx)
Returns JAMon's label for the specified Invocation context.
|
Object |
intercept(javax.interceptor.InvocationContext ctx)
Decorates method calls by monitoring them for performance and exceptions
|
protected boolean |
isMonitored(javax.interceptor.InvocationContext ctx)
Indicates whether the method invocation should be monitored.
|
protected String |
onException(javax.interceptor.InvocationContext ctx,
String label,
Exception exception)
Default exception handling.
|
JAMonInterceptor |
setUseParametersInDetails(boolean useParametersInDetails) |
protected String |
toString(Object parameter)
Turns a single method parameter into a string.
|
boolean |
useParametersInDetails() |
protected static final String EXCEPTION_UNITS
protected static final String NULL_STR
protected static final String UNKNOWN
protected static final int DEFAULT_ARG_STRING_MAX_LENGTH
protected static final String DEFAULT_MAX_STRING_ENDING
protected static final String MONITOR_PREFIX
protected String exceptionLabel
protected static final String LINE_SEPARATOR
protected JAMonInterceptor(String exceptionLabel)
public JAMonInterceptor()
public boolean useParametersInDetails()
public JAMonInterceptor setUseParametersInDetails(boolean useParametersInDetails)
useParametersInDetails
- Enable/disable saving parameter names and values in the 'detail' data section.public Object intercept(javax.interceptor.InvocationContext ctx) throws Exception
ctx
- Exception
protected String getJamonLabel(javax.interceptor.InvocationContext ctx)
ctx
- Invocation contextprotected boolean isMonitored(javax.interceptor.InvocationContext ctx)
ctx
- Method invocation contextprotected String onException(javax.interceptor.InvocationContext ctx, String label, Exception exception) throws Exception
ctx
- Invocation contextlabel
- the label used for this method invocationexception
- the offending exceptionException
protected String createExceptionDetails(String label, Object[] parameters, Exception exception)
label
- the label used for this method invocationparameters
- the method invocation parametersexception
- the offending exceptionCopyright © 2015. All rights reserved.