|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.mockejb.interceptor.AspectSystemImpl
Provides the implementation of the AspectSystem by adding aspects to the list and providing access to this list. Note that all "add" method first check if the same aspect is already in the list. If it is, the aspect is removed from the list and then added again. This is to prevent having the same aspect in the list multiple times. Aspect's "equals" method is used to compare aspects/interceptors, so it is the aspect providers must have this method implemented.
Constructor Summary | |
AspectSystemImpl()
|
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 list of aspects for this AspectSystem |
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. |
protected void |
removeIfExists(Aspect aspect)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public AspectSystemImpl()
Method Detail |
public void add(Aspect aspect)
AspectSystem
add
in interface AspectSystem
aspect
- aspect to addAspectSystem.add(org.mockejb.interceptor.Aspect)
public void addFirst(Aspect aspect)
AspectSystem
addFirst
in interface AspectSystem
aspect
- aspect to addAspectSystem.addFirst(org.mockejb.interceptor.Aspect)
public void add(Pointcut pointcut, Interceptor interceptor)
AspectSystem
add
in interface AspectSystem
pointcut
- pointcut of the aspectinterceptor
- interceptor of the aspectAspectSystem.add(org.mockejb.interceptor.Pointcut, org.mockejb.interceptor.Interceptor)
public void addFirst(Pointcut pointcut, Interceptor interceptor)
AspectSystem
addFirst
in interface AspectSystem
pointcut
- pointcut of the aspectinterceptor
- interceptor of the aspectAspectSystem.addFirst(org.mockejb.interceptor.Pointcut, org.mockejb.interceptor.Interceptor)
protected void removeIfExists(Aspect aspect)
public java.util.List getAspectList()
AspectSystem
getAspectList
in interface AspectSystem
AspectSystem.getAspectList()
public void clear()
clear
in interface AspectSystem
public java.util.List findInterceptors(java.lang.reflect.Method proxyMethod, java.lang.reflect.Method targetMethod)
AspectSystem
findInterceptors
in interface AspectSystem
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
AspectSystem.findInterceptors(java.lang.reflect.Method, java.lang.reflect.Method)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |