com.fitbur.aopalliance.intercept.Interceptor Maven / Gradle / Ivy
package com.fitbur.aopalliance.intercept;
import com.fitbur.aopalliance.aop.Advice;
/**
* This interface represents a generic interceptor.
*
* A generic interceptor can intercept runtime events that occur
* within a base program. Those events are materialized by (reified
* in) joinpoints. Runtime joinpoints can be invocations, field
* access, exceptions...
*
*
This interface is not used directly. Use the the sub-interfaces
* to intercept specific events. For instance, the following class
* implements some specific interceptors in order to implement a
* com.fitburbugger:
*
*
* class DebuggingInterceptor implements MethodInterceptor,
* ConstructorInterceptor, FieldInterceptor {
*
* Object invoke(MethodInvocation i) throws Throwable {
* com.fitburbug(i.getMethod(), i.getThis(), i.getArgs());
* return i.proceed();
* }
*
* Object construct(ConstructorInvocation i) throws Throwable {
* com.fitburbug(i.getConstructor(), i.getThis(), i.getArgs());
* return i.proceed();
* }
*
* Object get(FieldAccess fa) throws Throwable {
* com.fitburbug(fa.getField(), fa.getThis(), null);
* return fa.proceed();
* }
*
* Object set(FieldAccess fa) throws Throwable {
* com.fitburbug(fa.getField(), fa.getThis(), fa.getValueToSet());
* return fa.proceed();
* }
*
* void com.fitburbug(AccessibleObject ao, Object this, Object value) {
* ...
* }
* }
*
*
* @see Joinpoint */
public interface Interceptor extends Advice {
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy