Package org.skife.intercept

The InterceptionBroker provides the entry point to most of the functionality for this library.

See:
          Description

Interface Summary
InterceptedObject  
Interceptor Define an interceptor on method calls.
InterceptorFactory Used with the InterceptionBroker.addInterceptor(InterceptorFactory, Signature) to provide a very flexible way of obtaining interceptors on a per-invocation basis.
Signature This is used to match what should be intercepted.
 

Class Summary
InterceptionBroker provide interception matches against arbitrary non-final objects
InterceptorStack Provides one way traversal across a list of interceptors.
 

Package org.skife.intercept Description

The InterceptionBroker provides the entry point to most of the functionality for this library. Use it to register Interceptor instances or classes via the addInterceptor() calls. Use it, also, to enhance objects so that their method calls will be intercepted.

The Signature interface defines the equivalent of a join point in AOP speak (which I have avoided as this isn't AOP, it is just interception). It should be pretty easy to implement anonymous Sigantures, or use common ones. The library will bundle a few commonly used types of signatures for your convenience in the signatures package.

The Interceptor interface defines the equivalent of around advice (but again, we are talking interception here, not aspects). Several common cases are provided in the interceptors package. All of the ones included with the library are atomic -- their ordering doesn't matter, and they don't depend on each other.

The broker is optimized for execution and wrapping objects, not for adding new interceptors. Registering a new interceptor is in fact very slow, so I suggest doing it at startup rather than whenever is convenient. It caches interceptors on a per-class bases based on the intercepted object's getClass() value. Once you have wrapped one type wrapping additional instances of the same type should be very fast. The first time you wrap a new type it is a bit slow as it must do some bytecode generation.

This library makes extensive use of the cglib library. Thank you cglib developers!