|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.codehaus.aspectwerkz.joinpoint.control.AbstractJoinPointController
Abstract join point controller with convenience methods for managing advices.
Constructor Summary | |
AbstractJoinPointController()
|
Method Summary | |
void |
addAdvice(java.lang.String adviceName,
MethodJoinPoint jp,
ExecutionPointcut pc)
Adds an advice to a pointcut |
int |
clearAllRedundancies(MethodJoinPoint jp)
Checks all advices of a joinpoint for redundancies. |
int |
clearRedundancy(MethodJoinPoint joinPoint,
java.lang.String adviceName,
boolean purge)
Checks for redundant advices of a given type in a joinpoint and then removes all redundant advices. |
abstract JoinPointController |
deepCopy()
Clones the controller |
boolean |
equals(java.lang.Object o)
The overridden equals method. |
static java.util.Iterator |
getAllAdvices(MethodJoinPoint joinPoint,
boolean asSet)
Returns all advices of the joinpoint. |
int |
hashCode()
Overridden hashCode method. |
abstract java.lang.Object |
proceed(MethodJoinPoint jp)
Proceeds in the execution model for the join point to the next logical pointcut/advice< |
static void |
purgePointcuts(MethodJoinPoint joinPoint)
Removes all empty pointcuts from the joinpoint. |
void |
removeAdvice(java.lang.String adviceName,
MethodJoinPoint joinPoint,
ExecutionPointcut pointcut)
Removes an advice from a pointcut |
Methods inherited from class java.lang.Object |
getClass, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public AbstractJoinPointController()
Method Detail |
public void addAdvice(java.lang.String adviceName, MethodJoinPoint jp, ExecutionPointcut pc)
adviceName
- name of the advice as defined in the metadatajp
- joinpoint the controller is handlingpc
- pointcut, the advice needs to be appended. If null, current pointcut is used.public void removeAdvice(java.lang.String adviceName, MethodJoinPoint joinPoint, ExecutionPointcut pointcut)
adviceName
- name of the advice as defined in the metadatajoinPoint
- joinpoint the controller is handlingpointcut
- pointcut, the advice needs to be appended. If null, current pointcut is used.public static java.util.Iterator getAllAdvices(MethodJoinPoint joinPoint, boolean asSet)
joinPoint
- the joinpoint to inspectasSet
- flag, whether result is a set
public static void purgePointcuts(MethodJoinPoint joinPoint)
joinPoint
- the joinpoint which pointcuts need to be purgedpublic int clearRedundancy(MethodJoinPoint joinPoint, java.lang.String adviceName, boolean purge)
Redundancy can be caused by the use of very global regexp's or the combination of advice definitions in java doclets and XML. After calling this method, only the first of a series of redundant advices will remain in the advice chain that gets executed by the controller.
joinPoint
- the joinpoint where redundant advices need to be removedadviceName
- the name of the advice to check for redundancy (e.g. log)purge
- true, if empty pointcuts shall be removed after redundancies have been foundpublic int clearAllRedundancies(MethodJoinPoint jp)
jp
- the joinpoint where redundant advices need to be removedpublic abstract java.lang.Object proceed(MethodJoinPoint jp) throws java.lang.Throwable
Joinpoint controller implementations need to implement the business logic for handling e.g. advice redundancy, advice dependency, advice compatibility or special exception handling here.
To implement this logic it can use the knowledge about the joinpoint, the current advice and pointcut.
proceed
in interface JoinPointController
jp
- The joinpoint using this controller
java.lang.Throwable
public abstract JoinPointController deepCopy()
deepCopy
in interface JoinPointController
public int hashCode()
public boolean equals(java.lang.Object o)
o
- the other object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |