org.codehaus.aspectwerkz.joinpoint.management
Class JoinPointManager

java.lang.Object
  extended byorg.codehaus.aspectwerkz.joinpoint.management.JoinPointManager

public class JoinPointManager
extends Object

Manages the join points, invokes the correct advice chains, handles redeployment, JIT compilation etc. Each advised class' instance holds one instance of this class.

Author:
Jonas Bonér , Alexandre Vasseur

Method Summary
static AdviceInfo[] extractAfterFinallyAdvices(AdviceIndexInfo[] adviceIndexes)
          Extracts the after finally advices.
static AdviceInfo[] extractAfterReturningAdvices(AdviceIndexInfo[] adviceIndexes)
          Extracts the after returning advices.
static AdviceInfo[] extractAfterThrowingAdvices(AdviceIndexInfo[] adviceIndexes)
          Extracts the after throwing advices.
static AdviceInfo[] extractAroundAdvices(AdviceIndexInfo[] adviceIndexes)
          Extracts the around advices.
static AdviceInfo[] extractBeforeAdvices(AdviceIndexInfo[] adviceIndexes)
          Extracts the before advices.
static JoinPointManager getJoinPointManager(Class targetClass, String uuid)
          Returns the join point manager for a specific class.
static JoinPointRegistry getJoinPointRegistry()
          Returs the join point registry.
 boolean isAdvised(int joinPointHash)
          Checks if a join point is advised, this does not mean that it has any advices attached to it.
 Object proceedWithCallJoinPoint(int methodHash, int joinPointIndex, Object[] parameters, Class targetClass, Object targetInstance, Class thisClass, Object thisInstance, String withinMethodName, String withinMethodSignature, int joinPointType)
          Proceeds with the invocation of the join point, passing on the method hash, the parameter values and the target instance.
 Object proceedWithExecutionJoinPoint(int methodHash, int joinPointIndex, Object[] parameters, Object targetInstance, int joinPointType)
          Proceeds with the invocation of the join point, passing on the method hash, the parameter values and the target instance.
 Object proceedWithGetJoinPoint(int fieldHash, int joinPointIndex, Object targetInstance, Class declaringClass, String fieldSignature)
          Proceeds with the invocation of the join point, passing on the method hash, the parameter values and the target instance.
 void proceedWithHandlerJoinPoint(int handlerHash, int joinPointIndex, Object exceptionInstance, Object targetInstance, String handlerSignature)
          Proceeds with the invocation of the join point, passing on the method hash, the parameter values and the target instance.
 void proceedWithSetJoinPoint(int fieldHash, int joinPointIndex, Object[] fieldValue, Object targetInstance, Class declaringClass, String fieldSignature)
          Proceeds with the invocation of the join point, passing on the method hash, the parameter values and the target instance.
static void reset(Class klass)
          Reset the join point manager.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getJoinPointManager

public static final JoinPointManager getJoinPointManager(Class targetClass,
                                                         String uuid)
Returns the join point manager for a specific class.

Parameters:
targetClass -
uuid -
Returns:
the join point manager instance for this class

getJoinPointRegistry

public static JoinPointRegistry getJoinPointRegistry()
Returs the join point registry.

Returns:
the join point registry

isAdvised

public boolean isAdvised(int joinPointHash)
Checks if a join point is advised, this does not mean that it has any advices attached to it.

This method should be used by inserting a check in the wrapper/proxy method similar to this:

 if (___AW_joinPointManager.hasAdvices(joinPointHash)) {
     // execute the advice chain
 } else {
     // invoke the prefixed target method
 }
 

Parameters:
joinPointHash -
Returns:

proceedWithExecutionJoinPoint

public final Object proceedWithExecutionJoinPoint(int methodHash,
                                                  int joinPointIndex,
                                                  Object[] parameters,
                                                  Object targetInstance,
                                                  int joinPointType)
                                           throws Throwable
Proceeds with the invocation of the join point, passing on the method hash, the parameter values and the target instance.

Parameters:
methodHash -
joinPointIndex -
parameters -
targetInstance -
joinPointType -
Returns:
@throws Throwable
Throws:
Throwable

proceedWithCallJoinPoint

public final Object proceedWithCallJoinPoint(int methodHash,
                                             int joinPointIndex,
                                             Object[] parameters,
                                             Class targetClass,
                                             Object targetInstance,
                                             Class thisClass,
                                             Object thisInstance,
                                             String withinMethodName,
                                             String withinMethodSignature,
                                             int joinPointType)
                                      throws Throwable
Proceeds with the invocation of the join point, passing on the method hash, the parameter values and the target instance.

Parameters:
methodHash -
joinPointIndex -
parameters -
targetClass -
targetInstance -
thisClass -
thisInstance -
withinMethodName -
withinMethodSignature -
joinPointType -
Returns:
the result from the method invocation
Throws:
Throwable

proceedWithSetJoinPoint

public final void proceedWithSetJoinPoint(int fieldHash,
                                          int joinPointIndex,
                                          Object[] fieldValue,
                                          Object targetInstance,
                                          Class declaringClass,
                                          String fieldSignature)
                                   throws Throwable
Proceeds with the invocation of the join point, passing on the method hash, the parameter values and the target instance.

Parameters:
fieldHash -
joinPointIndex -
fieldValue - as the first arg in an Object array
targetInstance -
declaringClass -
fieldSignature -
Throws:
Throwable

proceedWithGetJoinPoint

public final Object proceedWithGetJoinPoint(int fieldHash,
                                            int joinPointIndex,
                                            Object targetInstance,
                                            Class declaringClass,
                                            String fieldSignature)
                                     throws Throwable
Proceeds with the invocation of the join point, passing on the method hash, the parameter values and the target instance.

Parameters:
fieldHash -
joinPointIndex -
targetInstance -
declaringClass -
fieldSignature -
Throws:
Throwable

proceedWithHandlerJoinPoint

public final void proceedWithHandlerJoinPoint(int handlerHash,
                                              int joinPointIndex,
                                              Object exceptionInstance,
                                              Object targetInstance,
                                              String handlerSignature)
                                       throws Throwable
Proceeds with the invocation of the join point, passing on the method hash, the parameter values and the target instance.

Parameters:
handlerHash -
joinPointIndex -
exceptionInstance -
targetInstance -
handlerSignature -
Throws:
Throwable

extractAroundAdvices

public static final AdviceInfo[] extractAroundAdvices(AdviceIndexInfo[] adviceIndexes)
Extracts the around advices.

Parameters:
adviceIndexes -
Returns:

extractBeforeAdvices

public static final AdviceInfo[] extractBeforeAdvices(AdviceIndexInfo[] adviceIndexes)
Extracts the before advices.

Parameters:
adviceIndexes -
Returns:

extractAfterFinallyAdvices

public static final AdviceInfo[] extractAfterFinallyAdvices(AdviceIndexInfo[] adviceIndexes)
Extracts the after finally advices.

Parameters:
adviceIndexes -
Returns:

extractAfterReturningAdvices

public static final AdviceInfo[] extractAfterReturningAdvices(AdviceIndexInfo[] adviceIndexes)
Extracts the after returning advices.

Parameters:
adviceIndexes -
Returns:

extractAfterThrowingAdvices

public static final AdviceInfo[] extractAfterThrowingAdvices(AdviceIndexInfo[] adviceIndexes)
Extracts the after throwing advices.

Parameters:
adviceIndexes -
Returns:

reset

public static void reset(Class klass)
Reset the join point manager.

Parameters:
klass -


Copyright © 2002-2004 Jonas Bonér, Alexandre Vasseur. All Rights Reserved.