public class PerformanceInterceptorServiceImpl extends BaseInterceptorServiceImpl implements PerformanceInterceptorService, org.apache.avalon.framework.configuration.Reconfigurable, org.apache.avalon.framework.context.Contextualizable, org.apache.avalon.framework.thread.ThreadSafe
ON_ENTRY, ON_ERROR, ON_EXIT
Constructor and Description |
---|
PerformanceInterceptorServiceImpl()
Constructor
|
Modifier and Type | Method and Description |
---|---|
void |
configure(org.apache.avalon.framework.configuration.Configuration configuration) |
protected void |
createStopWatch(AvalonInterceptorContext interceptorContext)
Creates a stop watch
|
protected StopWatch |
getStopWatch(AvalonInterceptorContext interceptorContext)
Gets the stop watch
|
protected void |
log(int mode,
AvalonInterceptorContext interceptorContext,
StopWatch stopWatch)
Logs the execution time.
|
void |
onEntry(AvalonInterceptorContext interceptorContext)
Called before a service method is invoked.
|
void |
onError(AvalonInterceptorContext interceptorContext,
Throwable t)
Called when a service method throws an exeption
|
void |
onExit(AvalonInterceptorContext interceptorContext,
Object result)
Called after a service method was invoked.
|
void |
reconfigure(org.apache.avalon.framework.configuration.Configuration configuration) |
protected String |
toString(AvalonInterceptorContext interceptorContext,
StopWatch stopWatch,
int mode)
Create the log message for the performance logfile.
|
protected String |
toString(Object[] args)
Prints the argument list.
|
contextualize, getClassLoader, getServiceApplicationDir, getServiceManager, getServiceName, getServiceTempDir, isEnabled, isServiceMonitored, makeAbsoluteFile
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
public PerformanceInterceptorServiceImpl()
public void configure(org.apache.avalon.framework.configuration.Configuration configuration) throws org.apache.avalon.framework.configuration.ConfigurationException
configure
in interface org.apache.avalon.framework.configuration.Configurable
configure
in class BaseInterceptorServiceImpl
org.apache.avalon.framework.configuration.ConfigurationException
Configurable.configure(org.apache.avalon.framework.configuration.Configuration)
public void reconfigure(org.apache.avalon.framework.configuration.Configuration configuration) throws org.apache.avalon.framework.configuration.ConfigurationException
reconfigure
in interface org.apache.avalon.framework.configuration.Reconfigurable
reconfigure
in class BaseInterceptorServiceImpl
org.apache.avalon.framework.configuration.ConfigurationException
Reconfigurable.reconfigure(org.apache.avalon.framework.configuration.Configuration)
public void onEntry(AvalonInterceptorContext interceptorContext)
AvalonInterceptorService
onEntry
in interface AvalonInterceptorService
onEntry
in class BaseInterceptorServiceImpl
interceptorContext
- shared interceptor contextAvalonInterceptorService.onEntry(org.apache.fulcrum.yaafi.framework.interceptor.AvalonInterceptorContext)
public void onError(AvalonInterceptorContext interceptorContext, Throwable t)
AvalonInterceptorService
onError
in interface AvalonInterceptorService
onError
in class BaseInterceptorServiceImpl
interceptorContext
- shared interceptor contextt
- the resulting exceptionAvalonInterceptorService.onError(org.apache.fulcrum.yaafi.framework.interceptor.AvalonInterceptorContext, java.lang.Throwable)
public void onExit(AvalonInterceptorContext interceptorContext, Object result)
AvalonInterceptorService
onExit
in interface AvalonInterceptorService
onExit
in class BaseInterceptorServiceImpl
interceptorContext
- shared interceptor contextresult
- the result of the invocationAvalonInterceptorService.onExit(org.apache.fulcrum.yaafi.framework.interceptor.AvalonInterceptorContext, java.lang.Object)
protected void createStopWatch(AvalonInterceptorContext interceptorContext)
interceptorContext
- the current interceptor contextprotected StopWatch getStopWatch(AvalonInterceptorContext interceptorContext)
interceptorContext
- the current interceptor contextprotected void log(int mode, AvalonInterceptorContext interceptorContext, StopWatch stopWatch)
mode
- the invocation mode (onEntry, onExit, onError)interceptorContext
- the current interceptor contextstopWatch
- the stop watchprotected String toString(AvalonInterceptorContext interceptorContext, StopWatch stopWatch, int mode)
interceptorContext
- the contextstopWatch
- the stopwatchmode
- the mode (onEntry, onExit, onError)Copyright © 2004–1970 The Apache Software Foundation. All rights reserved.