Java Simon 3.5.0

org.javasimon.javaee
Class MethodStopwatchSource

java.lang.Object
  extended by org.javasimon.source.AbstractStopwatchSource<T>
      extended by org.javasimon.source.AbstractMethodStopwatchSource<javax.interceptor.InvocationContext>
          extended by org.javasimon.javaee.MethodStopwatchSource
All Implemented Interfaces:
MonitorSource<javax.interceptor.InvocationContext,Stopwatch>, StopwatchSource<javax.interceptor.InvocationContext>

public class MethodStopwatchSource
extends AbstractMethodStopwatchSource<javax.interceptor.InvocationContext>

Provide stopwatch source for EJB and CDI invocation context. Used by SimonInterceptor as default stopwatch source. Can be overridden to customize monitored EJB methods and their related Simon name.

Author:
gquintana

Field Summary
static String DEFAULT_PREFIX
          Default prefix for Simon names
protected  String prefix
          Simon name prefix - can be overridden in subclasses.
 
Constructor Summary
MethodStopwatchSource(Manager manager)
           
 
Method Summary
protected  String getMonitorName(javax.interceptor.InvocationContext context)
          Returns Simon name for the specified Invocation context.
 String getPrefix()
           
protected  Class<?> getTargetClass(javax.interceptor.InvocationContext context)
           
protected  Method getTargetMethod(javax.interceptor.InvocationContext context)
           
 void setPrefix(String prefix)
           
 
Methods inherited from class org.javasimon.source.AbstractMethodStopwatchSource
cache, getMonitor, newCacheStopwatchSource
 
Methods inherited from class org.javasimon.source.AbstractStopwatchSource
getManager, isMonitored, start
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_PREFIX

public static final String DEFAULT_PREFIX
Default prefix for Simon names

See Also:
Constant Field Values

prefix

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

Constructor Detail

MethodStopwatchSource

public MethodStopwatchSource(Manager manager)
Method Detail

getPrefix

public String getPrefix()

setPrefix

public void setPrefix(String prefix)

getTargetClass

protected final Class<?> getTargetClass(javax.interceptor.InvocationContext context)
Specified by:
getTargetClass in class AbstractMethodStopwatchSource<javax.interceptor.InvocationContext>

getTargetMethod

protected final Method getTargetMethod(javax.interceptor.InvocationContext context)
Specified by:
getTargetMethod in class AbstractMethodStopwatchSource<javax.interceptor.InvocationContext>

getMonitorName

protected String getMonitorName(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.

Specified by:
getMonitorName in class AbstractStopwatchSource<javax.interceptor.InvocationContext>
Parameters:
context - Invocation context
Returns:
fully qualified name of the Simon
Since:
3.1

Java Simon 3.5.0

Copyright © 2014. All rights reserved.