Java Simon 3.5.0

org.javasimon.javaee
Class SimonInterceptor

java.lang.Object
  extended by org.javasimon.javaee.SimonInterceptor

public class SimonInterceptor
extends Object

Simon Interceptor measuring method execution time - can be used in EJB, or CDI in general.

Since:
2.3
Author:
Richard "Virgo" Richter

Field Summary
static String DEFAULT_INTERCEPTOR_PREFIX
          Default prefix for interceptor Simons if no "prefix" init parameter is used.
protected  String prefix
          Simon name prefix - can be overridden in subclasses.
 
Constructor Summary
SimonInterceptor()
           
 
Method Summary
protected  String getSimonName(javax.interceptor.InvocationContext context)
          Returns Simon name for the specified Invocation context.
protected  boolean isMonitored(javax.interceptor.InvocationContext context)
          Indicates whether the method invocation should be monitored.
 Object monitor(javax.interceptor.InvocationContext context)
          Around invoke method that measures the split for one method invocation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_INTERCEPTOR_PREFIX

public static final String DEFAULT_INTERCEPTOR_PREFIX
Default prefix for interceptor Simons if no "prefix" init parameter is used.

See Also:
Constant Field Values

prefix

protected String prefix
Simon name prefix - can be overridden in subclasses.

Constructor Detail

SimonInterceptor

public SimonInterceptor()
Method Detail

getSimonName

protected String getSimonName(javax.interceptor.InvocationContext context)
Returns Simon name for the specified Invocation context. By default it contains the prefix + method name. This method can be overridden.

Parameters:
context - Invocation context
Returns:
fully qualified name of the Simon
Since:
3.1

isMonitored

protected boolean isMonitored(javax.interceptor.InvocationContext context)
Indicates whether the method invocation should be monitored. Default behavior always returns true. This method can be overridden

Parameters:
context - Method invocation context
Returns:
true to enable Simon, false either

monitor

public Object monitor(javax.interceptor.InvocationContext context)
               throws Exception
Around invoke method that measures the split for one method invocation.

Parameters:
context - invocation context
Returns:
return value from the invocation
Throws:
Exception - exception thrown from the invocation

Java Simon 3.5.0

Copyright © 2014. All rights reserved.