Class BaseInterceptorServiceImpl
java.lang.Object
org.apache.avalon.framework.logger.AbstractLogEnabled
org.apache.fulcrum.yaafi.interceptor.baseservice.BaseInterceptorServiceImpl
- All Implemented Interfaces:
org.apache.avalon.framework.configuration.Configurable
,org.apache.avalon.framework.configuration.Reconfigurable
,org.apache.avalon.framework.context.Contextualizable
,org.apache.avalon.framework.logger.LogEnabled
,AvalonInterceptorService
- Direct Known Subclasses:
JamonInterceptorServiceImpl
,JavaSimonInterceptorServiceImpl
,LoggingInterceptorServiceImpl
,PerformanceInterceptorServiceImpl
public class BaseInterceptorServiceImpl
extends org.apache.avalon.framework.logger.AbstractLogEnabled
implements AvalonInterceptorService, org.apache.avalon.framework.context.Contextualizable, org.apache.avalon.framework.configuration.Reconfigurable
A base service providing common functionality for interceptors
- 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 TypeMethodDescriptionvoid
configure
(org.apache.avalon.framework.configuration.Configuration configuration) void
contextualize
(org.apache.avalon.framework.context.Context context) protected ClassLoader
protected File
protected org.apache.avalon.framework.service.ServiceManager
protected String
protected File
protected boolean
protected boolean
isServiceMonitored
(AvalonInterceptorContext avalonInterceptorContext) Determine if the given service is monitored.protected File
makeAbsoluteFile
(String name) Determines the file location of the given name.void
onEntry
(AvalonInterceptorContext avalonInterceptorContext) Called before a service method is invoked.void
onError
(AvalonInterceptorContext avalonInterceptorContext, Throwable t) Called when a service method throws an exeptionvoid
onExit
(AvalonInterceptorContext avalonInterceptorContext, Object result) Called after a service method was invoked.void
reconfigure
(org.apache.avalon.framework.configuration.Configuration configuration) Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
-
Constructor Details
-
BaseInterceptorServiceImpl
public BaseInterceptorServiceImpl()Constructor
-
-
Method Details
-
contextualize
public void contextualize(org.apache.avalon.framework.context.Context context) throws org.apache.avalon.framework.context.ContextException - Specified by:
contextualize
in interfaceorg.apache.avalon.framework.context.Contextualizable
- Throws:
org.apache.avalon.framework.context.ContextException
- See Also:
-
configure
public void configure(org.apache.avalon.framework.configuration.Configuration configuration) throws org.apache.avalon.framework.configuration.ConfigurationException - Specified by:
configure
in interfaceorg.apache.avalon.framework.configuration.Configurable
- Throws:
org.apache.avalon.framework.configuration.ConfigurationException
- See Also:
-
reconfigure
public void reconfigure(org.apache.avalon.framework.configuration.Configuration configuration) throws org.apache.avalon.framework.configuration.ConfigurationException - Specified by:
reconfigure
in interfaceorg.apache.avalon.framework.configuration.Reconfigurable
- Throws:
org.apache.avalon.framework.configuration.ConfigurationException
- See Also:
-
onEntry
Description copied from interface:AvalonInterceptorService
Called before a service method is invoked.- Specified by:
onEntry
in interfaceAvalonInterceptorService
- Parameters:
avalonInterceptorContext
- shared interceptor context- See Also:
-
onError
Description copied from interface:AvalonInterceptorService
Called when a service method throws an exeption- Specified by:
onError
in interfaceAvalonInterceptorService
- Parameters:
avalonInterceptorContext
- shared interceptor contextt
- the resulting exception- See Also:
-
onExit
Description copied from interface:AvalonInterceptorService
Called after a service method was invoked.- Specified by:
onExit
in interfaceAvalonInterceptorService
- Parameters:
avalonInterceptorContext
- shared interceptor contextresult
- the result of the invocation- See Also:
-
isEnabled
protected boolean isEnabled()- Returns:
- Returns the isEnabled.
-
isServiceMonitored
Determine if the given service is monitored.- Parameters:
avalonInterceptorContext
- interceptor context- Returns:
- true if the service is monitored or false otherwise
-
getServiceApplicationDir
- Returns:
- Returns the serviceApplicationDir.
-
getServiceManager
protected org.apache.avalon.framework.service.ServiceManager getServiceManager()- Returns:
- Returns the serviceManager.
-
getServiceName
- Returns:
- Returns the serviceName.
-
getServiceTempDir
- Returns:
- Returns the serviceTempDir.
-
getClassLoader
- Returns:
- Returns the classLoader.
-
makeAbsoluteFile
Determines the file location of the given name. If the name denotes a relative file location it will be resolved using the application home directory.- Parameters:
name
- the filename- Returns:
- the file
-