org.mockejb.interceptor
Interface AspectSystem

All Known Implementing Classes:
AspectSystemImpl

public interface AspectSystem

Keeps the global list of aspects. Identifies the relevant aspects and interceptors for the given jointpoint.

Author:
Alexander Ananiev

Method Summary
 void add(Aspect aspect)
          Adds the given aspect to the end of the global list of aspects.
 void add(Pointcut pointcut, Interceptor interceptor)
          Creates the new aspect and adds it to the end of the list of aspects.
 void addFirst(Aspect aspect)
          Inserts the given aspect in the beginning of the list of aspects.
 void addFirst(Pointcut pointcut, Interceptor interceptor)
          Creates the new aspect from the given pointcut and the interceptor and inserts it in the beginning of the list of aspects.
 void clear()
          Clears the aspect list
 java.util.List findInterceptors(java.lang.reflect.Method proxyMethod, java.lang.reflect.Method targetMethod)
          Identifiesaspects whose pointcut matches the given source method or target method.
 java.util.List getAspectList()
          Returns the list of aspects to the client.
 

Method Detail

add

public void add(Aspect aspect)
Adds the given aspect to the end of the global list of aspects.

Parameters:
aspect - aspect to add

addFirst

public void addFirst(Aspect aspect)
Inserts the given aspect in the beginning of the list of aspects. If you want an interceptor for a given pointcut to be called before other interceptors for the same pointcut, you can use this method.

Parameters:
aspect - aspect to add

add

public void add(Pointcut pointcut,
                Interceptor interceptor)
Creates the new aspect and adds it to the end of the list of aspects.

Parameters:
pointcut - pointcut of the aspect
interceptor - interceptor of the aspect

addFirst

public void addFirst(Pointcut pointcut,
                     Interceptor interceptor)
Creates the new aspect from the given pointcut and the interceptor and inserts it in the beginning of the list of aspects. If you want an interceptor for a given pointcut to be called before other interceptors for the same pointcut, you can use this method.

Parameters:
pointcut - pointcut of the aspect
interceptor - interceptor of the aspect

getAspectList

public java.util.List getAspectList()
Returns the list of aspects to the client. Clients can manipulate the list.

Returns:
the list of aspects

findInterceptors

public java.util.List findInterceptors(java.lang.reflect.Method proxyMethod,
                                       java.lang.reflect.Method targetMethod)
Identifiesaspects whose pointcut matches the given source method or target method. Returns the list of the interceptors for the matching pointcuts.

Parameters:
proxyMethod - method invoked by the client on the proxy (interface method)
targetMethod - target method which will be called as the result of the proxy method
Returns:
list of the interceptors for the matching pointcuts

clear

public void clear()
Clears the aspect list