toolbox.services
Interface Interceptor

Package class diagram package Interceptor
All Superinterfaces:
java.lang.reflect.InvocationHandler
All Known Implementing Classes:
AbstractInterceptor, JAMonInterceptor, LoggingInterceptor

public interface Interceptor
extends java.lang.reflect.InvocationHandler

Interface that defines a method interceptor. Interceptor impelementations will handle method invocations on the provided invocation target object.

The purpose of the interceptor interface is to provide a mechanism for implementing cross-cutting concerns in a central location. Interceptors can be chained to implement multiple concerns.

The invocation mechanism is provided by the super interface of this interface and the java.lang.reflect.Proxy class.


Method Summary
 void init(java.util.Map config)
          Interceptor initialisation must be implemented here.
 void setObject(java.lang.Object obj)
          Set the actual Object instance that being is handled by the interceptor chain.
 void setTarget(java.lang.Object target)
          Set the invocation target object of this interceptor.
 
Methods inherited from interface java.lang.reflect.InvocationHandler
invoke
 

Method Detail

init

void init(java.util.Map config)
          throws ServiceException
Interceptor initialisation must be implemented here.

Parameters:
config - Map instance containing interceptor configuration.
Throws:
ServiceException - if the interceptor cannot be initialised.

setTarget

void setTarget(java.lang.Object target)
Set the invocation target object of this interceptor. All method invocations in this inerceptor will happen on the given object instance.

Parameters:
target - Object instance that is the invocation target of this interceptor.

setObject

void setObject(java.lang.Object obj)
Set the actual Object instance that being is handled by the interceptor chain.

Parameters:
obj - Object instance that is the real object.