Class JavaSimonInterceptorServiceImpl

java.lang.Object
org.apache.avalon.framework.logger.AbstractLogEnabled
org.apache.fulcrum.yaafi.interceptor.baseservice.BaseInterceptorServiceImpl
org.apache.fulcrum.yaafi.interceptor.javasimon.JavaSimonInterceptorServiceImpl
All Implemented Interfaces:
Runnable, org.apache.avalon.framework.activity.Disposable, org.apache.avalon.framework.activity.Initializable, org.apache.avalon.framework.configuration.Configurable, org.apache.avalon.framework.configuration.Reconfigurable, org.apache.avalon.framework.context.Contextualizable, org.apache.avalon.framework.logger.LogEnabled, org.apache.avalon.framework.thread.ThreadSafe, AvalonInterceptorService, JavaSimonInterceptorService

public class JavaSimonInterceptorServiceImpl extends BaseInterceptorServiceImpl implements JavaSimonInterceptorService, org.apache.avalon.framework.configuration.Reconfigurable, org.apache.avalon.framework.thread.ThreadSafe, org.apache.avalon.framework.activity.Disposable, org.apache.avalon.framework.activity.Initializable
A service using JavaSimon for performance monitoring. The implementation relies on reflection to invoke JavaSimon to avoid compile-time coupling.
Since:
1.0.7
Author:
Siegfried Goeschl
  • Constructor Details

    • JavaSimonInterceptorServiceImpl

      public JavaSimonInterceptorServiceImpl()
      Constructor
  • Method Details

    • configure

      public void configure(org.apache.avalon.framework.configuration.Configuration configuration) throws org.apache.avalon.framework.configuration.ConfigurationException
      Specified by:
      configure in interface org.apache.avalon.framework.configuration.Configurable
      Overrides:
      configure in class BaseInterceptorServiceImpl
      Throws:
      org.apache.avalon.framework.configuration.ConfigurationException
      See Also:
      • Configurable.configure(Configuration)
    • initialize

      public void initialize() throws Exception
      Specified by:
      initialize in interface org.apache.avalon.framework.activity.Initializable
      Throws:
      Exception
      See Also:
      • Initializable.initialize()
    • reconfigure

      public void reconfigure(org.apache.avalon.framework.configuration.Configuration configuration) throws org.apache.avalon.framework.configuration.ConfigurationException
      Specified by:
      reconfigure in interface org.apache.avalon.framework.configuration.Reconfigurable
      Overrides:
      reconfigure in class BaseInterceptorServiceImpl
      Throws:
      org.apache.avalon.framework.configuration.ConfigurationException
      See Also:
      • Reconfigurable.reconfigure(Configuration)
    • dispose

      public void dispose()
      Specified by:
      dispose in interface org.apache.avalon.framework.activity.Disposable
      See Also:
      • Disposable.dispose()
    • onEntry

      public void onEntry(AvalonInterceptorContext interceptorContext)
      Description copied from interface: AvalonInterceptorService
      Called before a service method is invoked.
      Specified by:
      onEntry in interface AvalonInterceptorService
      Overrides:
      onEntry in class BaseInterceptorServiceImpl
      Parameters:
      interceptorContext - shared interceptor context
      See Also:
    • onExit

      public void onExit(AvalonInterceptorContext interceptorContext, Object result)
      Description copied from interface: AvalonInterceptorService
      Called after a service method was invoked.
      Specified by:
      onExit in interface AvalonInterceptorService
      Overrides:
      onExit in class BaseInterceptorServiceImpl
      Parameters:
      interceptorContext - shared interceptor context
      result - the result of the invocation
      See Also:
    • onError

      public void onError(AvalonInterceptorContext interceptorContext, Throwable t)
      Description copied from interface: AvalonInterceptorService
      Called when a service method throws an exeption
      Specified by:
      onError in interface AvalonInterceptorService
      Overrides:
      onError in class BaseInterceptorServiceImpl
      Parameters:
      interceptorContext - shared interceptor context
      t - the resulting exception
      See Also:
    • run

      public void run()
      Writes the JavaSimon report to the file system.
      Specified by:
      run in interface Runnable
      See Also:
    • isJavaSimonAvailable

      protected final boolean isJavaSimonAvailable()
      Returns:
      Returns the isJavaSimonAvailable.
    • createJavaSimonPerformanceMonitor

      protected JavaSimonPerformanceMonitor createJavaSimonPerformanceMonitor(String serviceName, Method method, boolean isEnabled)
      Factory method for creating an implementation of a JavaSimonPerformanceMonitor.
      Parameters:
      serviceName - the service name
      method - the method
      isEnabled - is the monitor enabled
      Returns:
      the instance or null if the creation failed
    • writeReport

      protected void writeReport()
      Write a report file
    • writeReport

      protected void writeReport(File reportFile)
      Write the HTML report to the given destination.
      Parameters:
      reportFile - the report destination