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
-
Field Summary
Fields inherited from interface org.apache.fulcrum.yaafi.framework.interceptor.AvalonInterceptorService
ON_ENTRY, ON_ERROR, ON_EXIT -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidconfigure(org.apache.avalon.framework.configuration.Configuration configuration) protected JavaSimonPerformanceMonitorcreateJavaSimonPerformanceMonitor(String serviceName, Method method, boolean isEnabled) Factory method for creating an implementation of a JavaSimonPerformanceMonitor.voiddispose()voidprotected final booleanvoidonEntry(AvalonInterceptorContext interceptorContext) Called before a service method is invoked.voidonError(AvalonInterceptorContext interceptorContext, Throwable t) Called when a service method throws an exeptionvoidonExit(AvalonInterceptorContext interceptorContext, Object result) Called after a service method was invoked.voidreconfigure(org.apache.avalon.framework.configuration.Configuration configuration) voidrun()Writes the JavaSimon report to the file system.protected voidWrite a report fileprotected voidwriteReport(File reportFile) Write the HTML report to the given destination.Methods inherited from class org.apache.fulcrum.yaafi.interceptor.baseservice.BaseInterceptorServiceImpl
contextualize, getClassLoader, getServiceApplicationDir, getServiceManager, getServiceName, getServiceTempDir, isEnabled, isServiceMonitored, makeAbsoluteFileMethods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
-
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:
configurein interfaceorg.apache.avalon.framework.configuration.Configurable- Overrides:
configurein classBaseInterceptorServiceImpl- Throws:
org.apache.avalon.framework.configuration.ConfigurationException- See Also:
-
initialize
- Specified by:
initializein interfaceorg.apache.avalon.framework.activity.Initializable- Throws:
Exception- See Also:
-
reconfigure
public void reconfigure(org.apache.avalon.framework.configuration.Configuration configuration) throws org.apache.avalon.framework.configuration.ConfigurationException - Specified by:
reconfigurein interfaceorg.apache.avalon.framework.configuration.Reconfigurable- Overrides:
reconfigurein classBaseInterceptorServiceImpl- Throws:
org.apache.avalon.framework.configuration.ConfigurationException- See Also:
-
dispose
public void dispose()- Specified by:
disposein interfaceorg.apache.avalon.framework.activity.Disposable- See Also:
-
onEntry
Description copied from interface:AvalonInterceptorServiceCalled before a service method is invoked.- Specified by:
onEntryin interfaceAvalonInterceptorService- Overrides:
onEntryin classBaseInterceptorServiceImpl- Parameters:
interceptorContext- shared interceptor context- See Also:
-
onExit
Description copied from interface:AvalonInterceptorServiceCalled after a service method was invoked.- Specified by:
onExitin interfaceAvalonInterceptorService- Overrides:
onExitin classBaseInterceptorServiceImpl- Parameters:
interceptorContext- shared interceptor contextresult- the result of the invocation- See Also:
-
onError
Description copied from interface:AvalonInterceptorServiceCalled when a service method throws an exeption- Specified by:
onErrorin interfaceAvalonInterceptorService- Overrides:
onErrorin classBaseInterceptorServiceImpl- Parameters:
interceptorContext- shared interceptor contextt- the resulting exception- See Also:
-
run
public void run()Writes the JavaSimon report to the file system. -
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 namemethod- the methodisEnabled- is the monitor enabled- Returns:
- the instance or null if the creation failed
-
writeReport
protected void writeReport()Write a report file -
writeReport
Write the HTML report to the given destination.- Parameters:
reportFile- the report destination
-