org.apache.hivemind.service.impl
Class LoggingInterceptorFactory
java.lang.Object
org.apache.hivemind.service.impl.LoggingInterceptorFactory
- All Implemented Interfaces:
- ServiceInterceptorFactory
public class LoggingInterceptorFactory
- extends java.lang.Object
- implements ServiceInterceptorFactory
An interceptor factory that adds logging capability to a service.
The logging is based upon the Jakarta
commons-logging toolkit,
which makes
it very transportable.
The interceptor will log entry to each method and exit from the method
(with return value), plus log any exceptions thrown by the method.
The logger used is the id of the service, which is not necessarily
the name of the implementing class. Logging occurs at the debug level.
- Author:
- Howard Lewis Ship
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
LoggingInterceptorFactory
public LoggingInterceptorFactory()
addServiceMethodImplementation
protected void addServiceMethodImplementation(ClassFab classFab,
MethodSignature sig)
addServiceMethods
protected void addServiceMethods(InterceptorStack stack,
ClassFab fab,
java.util.List parameters)
addToStringMethod
protected void addToStringMethod(InterceptorStack stack,
ClassFab fab)
- Creates a toString() method that identify the interceptor service id,
the intercepted service id, and the service interface class name).
createInterceptor
public void createInterceptor(InterceptorStack stack,
Module contributingModule,
java.util.List parameters)
- Creates the interceptor.
The class that is created is cached; if an interceptor is requested
for the same extension point, then the previously constructed class
is reused (this can happen with the threaded service model, for example,
when a thread-local service implementation is created for different threads).
- Specified by:
createInterceptor
in interface ServiceInterceptorFactory
setFactory
public void setFactory(ClassFactory factory)
setServiceId
public void setServiceId(java.lang.String string)