Tie

Java Method Interception

Quick Start Guide

The "InterceptionBuilder"

The InterceptionBuilder provides a convenient way to apply rules to an interception stack. Here's an example:

public static InterceptionInjector createInjector()
{
    InterceptionBuilder builder = new InterceptionBuilder();
    builder.always(new LoggingInterceptor());
    builder.whenInstanceOf(ConnectionAware.class, new ConnectionAwareInterceptor());
    MethodInterceptorStack stack = builder.done();
    return new ProxyInjector(stack);
}

The javadoc for InterceptionBuilder will show you all the methods it provides.

The instructions listed above require the "ext" jar to be on the classpath.