01: package org.mockejb.interceptor;
02:
03: /**
04: * Interceptors intercept calls to an object to perform some actions, such as logging,
05: * transaction management and so on.
06: * Interceptor can perform actions before the call, then it must call the
07: * {@link InvocationContext#proceed proceed} method
08: * and after that it can perform post-call actions if needed.
09: *
10: * @author Alexander Ananiev
11: */
12: public interface Interceptor {
13:
14: /**
15: * Performs pre and post invocation actions for the target object call.
16: * @param invocationContext provides the info about this call. Also calls interceptors in
17: * turn according to their order in the chain. invocationContext provides access to the return value
18: * and thrown exceptions of this call.
19: */
20: void intercept(InvocationContext invocationContext)
21: throws Exception;
22:
23: }
|