org.apache.aries.blueprint
Interface Interceptor

All Known Implementing Classes:
QuiesceInterceptor

public interface Interceptor

An Interceptor interface provides support for custom interceptor implementation.


Method Summary
 int getRank()
          Return the rank of the interceptor, which is used to determine the order of the interceptors to be invoked Rank is between Integer.MIN_VALUE and Integer.MAX_VALUE, interceptors are called in the order of highest value rank first to lowest value rank last i.e.
 void postCallWithException(ComponentMetadata cm, java.lang.reflect.Method m, java.lang.Throwable ex, java.lang.Object preCallToken)
          The method is called after the method m is invoked and causes an exception.
 void postCallWithReturn(ComponentMetadata cm, java.lang.reflect.Method m, java.lang.Object returnType, java.lang.Object preCallToken)
          This method is called after the method m is invoked and returned normally.
 java.lang.Object preCall(ComponentMetadata cm, java.lang.reflect.Method m, java.lang.Object... parameters)
          This is called just before the method m is invocation.
 

Method Detail

preCall

java.lang.Object preCall(ComponentMetadata cm,
                         java.lang.reflect.Method m,
                         java.lang.Object... parameters)
                         throws java.lang.Throwable
This is called just before the method m is invocation.

Parameters:
cm - : the component's metada
m: - the method to be invoked
parameters: - method parameters
Returns:
token which will subsequently be passed to postCall
Throws:
java.lang.Throwable

postCallWithReturn

void postCallWithReturn(ComponentMetadata cm,
                        java.lang.reflect.Method m,
                        java.lang.Object returnType,
                        java.lang.Object preCallToken)
                        throws java.lang.Throwable
This method is called after the method m is invoked and returned normally.

Parameters:
cm: - the component metadata
m: - the method invoked
returnType - : the return object
preCallToken - token returned by preCall
Throws:
java.lang.Throwable

postCallWithException

void postCallWithException(ComponentMetadata cm,
                           java.lang.reflect.Method m,
                           java.lang.Throwable ex,
                           java.lang.Object preCallToken)
                           throws java.lang.Throwable
The method is called after the method m is invoked and causes an exception.

Parameters:
cm - : the component metadata
m - : the method invoked
ex - : the Throwable thrown
preCallToken - token returned by preCall
Throws:
java.lang.Throwable

getRank

int getRank()
Return the rank of the interceptor, which is used to determine the order of the interceptors to be invoked Rank is between Integer.MIN_VALUE and Integer.MAX_VALUE, interceptors are called in the order of highest value rank first to lowest value rank last i.e. an interceptor with rank Integer.MAX_VALUE will be called before all others (except of the same rank).

Returns:
the rank of the interceptor


Copyright © 2009-2011 The Apache Software Foundation. All Rights Reserved.