org.jboss.aop.instrument
Class JoinPointGenerator

java.lang.Object
  extended by org.jboss.aop.instrument.JoinPointGenerator
Direct Known Subclasses:
ConByConJoinPointGenerator, ConByMethodJoinPointGenerator, ConstructionJoinPointGenerator, ConstructorJoinPointGenerator, FieldJoinPointGenerator, MethodByConJoinPointGenerator, MethodByMethodJoinPointGenerator, MethodJoinPointGenerator

public abstract class JoinPointGenerator
extends Object

Creates the Joinpoint invocation replacement classes used with Generated advisors

Version:
$Revision$
Author:
Kabir Khan, adrian@jboss.org

Nested Class Summary
protected  class JoinPointGenerator.AdviceSetup
           
protected static class JoinPointGenerator.JoinPointParameters
           
 
Field Summary
protected static String ARGUMENTS
           
protected static String CALLER_FIELD
           
static String DISPATCH
           
protected static javassist.CtClass[] EMPTY_CTCLASS_ARRAY
           
static String GENERATE_JOINPOINT_CLASS
           
protected static String GENERATED_CLASS_ADVISOR
           
static String INFO_FIELD
           
static String INITIALISE_LIGHTWEIGHT_INSTANCE_ASPECTS
           
static String INITIALISED_LIGHTWEIGHT_INSTANCE_ASPECTS
           
static String INVOKE_JOINPOINT
           
static String INVOKE_TARGET
           
static String IS_FOR_INSTANCE_ADVISOR
           
static String JOINPOINT_CLASS_PREFIX
           
static String JOINPOINT_FIELD_PREFIX
           
protected  String joinpointClassName
           
protected  String joinpointFieldName
           
protected static String TARGET_FIELD
           
protected static javassist.CtClass[] THROWS_THROWABLE
           
protected static String TYPED_CALLER_FIELD
           
protected static String TYPED_TARGET_FIELD
           
 
Constructor Summary
protected JoinPointGenerator(GeneratedClassAdvisor advisor, JoinPointInfo info, JoinPointGenerator.JoinPointParameters parameters, int argumentsSize, boolean nullArgsArray)
          Constructor.
 
Method Summary
protected static void addUntransformableInterface(javassist.ClassPool pool, javassist.CtClass clazz)
           
protected static void addUntransformableInterface(Instrumentor instrumentor, javassist.CtClass clazz)
           
 void generateJoinPointClass()
          Called by the joinpoint if a interceptors were regenereated Here for backwards compatiblity with AOP 1.5.0
 Object generateJoinPointClass(ClassLoader classloader, JoinPointInfo info)
          Called by the joinpoint if a interceptors were regenereated
protected abstract  AdviceMethodProperties getAdviceMethodProperties(JoinPointBean info, JoinPointGenerator.AdviceSetup setup)
           
protected  String getJoinPointArg(int index)
          This method returns the code that access the joinpoint arg number index (for invocations).
protected  Field getJoinpointField()
           
protected static String getMethodString(javassist.CtClass joinpoint, String method, javassist.CtClass[] params)
           
protected abstract  Class<?> getReturnClassType()
           
protected  boolean hasCallingObject()
           
protected abstract  boolean hasTargetObject()
           
protected abstract  void initialiseJoinPointNames(JoinPointInfo info)
           
protected  boolean isCaller()
           
protected abstract  boolean isVoid()
           
protected  void overrideDispatchMethods(javassist.CtClass superClass, javassist.CtClass clazz, CallerConstructorInfo cinfo)
          For ConByXXXX, If target constructor is execution advised, replace it with a call to the constructor wrapper
protected  void overrideDispatchMethods(javassist.CtClass superClass, javassist.CtClass clazz, JoinPointInfo newInfo)
          Normal people don't want to override the dispatch method
 void rebindJoinpoint(JoinPointInfo newInfo)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INFO_FIELD

public static final String INFO_FIELD
See Also:
Constant Field Values

INITIALISED_LIGHTWEIGHT_INSTANCE_ASPECTS

public static final String INITIALISED_LIGHTWEIGHT_INSTANCE_ASPECTS
See Also:
Constant Field Values

INITIALISE_LIGHTWEIGHT_INSTANCE_ASPECTS

public static final String INITIALISE_LIGHTWEIGHT_INSTANCE_ASPECTS
See Also:
Constant Field Values

IS_FOR_INSTANCE_ADVISOR

public static final String IS_FOR_INSTANCE_ADVISOR
See Also:
Constant Field Values

INVOKE_JOINPOINT

public static final String INVOKE_JOINPOINT
See Also:
Constant Field Values

INVOKE_TARGET

public static final String INVOKE_TARGET
See Also:
Constant Field Values

DISPATCH

public static final String DISPATCH
See Also:
Constant Field Values

TARGET_FIELD

protected static final String TARGET_FIELD
See Also:
Constant Field Values

TYPED_TARGET_FIELD

protected static final String TYPED_TARGET_FIELD
See Also:
Constant Field Values

CALLER_FIELD

protected static final String CALLER_FIELD
See Also:
Constant Field Values

TYPED_CALLER_FIELD

protected static final String TYPED_CALLER_FIELD
See Also:
Constant Field Values

GENERATED_CLASS_ADVISOR

protected static final String GENERATED_CLASS_ADVISOR

GENERATE_JOINPOINT_CLASS

public static final String GENERATE_JOINPOINT_CLASS
See Also:
Constant Field Values

JOINPOINT_FIELD_PREFIX

public static final String JOINPOINT_FIELD_PREFIX
See Also:
Constant Field Values

JOINPOINT_CLASS_PREFIX

public static final String JOINPOINT_CLASS_PREFIX
See Also:
Constant Field Values

ARGUMENTS

protected static final String ARGUMENTS
See Also:
Constant Field Values

EMPTY_CTCLASS_ARRAY

protected static final javassist.CtClass[] EMPTY_CTCLASS_ARRAY

THROWS_THROWABLE

protected static final javassist.CtClass[] THROWS_THROWABLE

joinpointClassName

protected String joinpointClassName

joinpointFieldName

protected String joinpointFieldName
Constructor Detail

JoinPointGenerator

protected JoinPointGenerator(GeneratedClassAdvisor advisor,
                             JoinPointInfo info,
                             JoinPointGenerator.JoinPointParameters parameters,
                             int argumentsSize,
                             boolean nullArgsArray)
Constructor.

Parameters:
advisor - the advisor associated to this generator
info - information regarding the joinpoint to be intercepted
parameters - indicates the parameters available to the interception of this joinpoint
argumentsSize - number of joinpoint arguments
nullArgsArray - true to indicate that the arguments array should be null when there is not argument available
Method Detail

rebindJoinpoint

public void rebindJoinpoint(JoinPointInfo newInfo)

generateJoinPointClass

public void generateJoinPointClass()
Called by the joinpoint if a interceptors were regenereated Here for backwards compatiblity with AOP 1.5.0


generateJoinPointClass

public Object generateJoinPointClass(ClassLoader classloader,
                                     JoinPointInfo info)
Called by the joinpoint if a interceptors were regenereated


getJoinPointArg

protected String getJoinPointArg(int index)
This method returns the code that access the joinpoint arg number index (for invocations).

Parameters:
index - the index of the desired arg field

initialiseJoinPointNames

protected abstract void initialiseJoinPointNames(JoinPointInfo info)

isVoid

protected abstract boolean isVoid()

getReturnClassType

protected abstract Class<?> getReturnClassType()

getAdviceMethodProperties

protected abstract AdviceMethodProperties getAdviceMethodProperties(JoinPointBean info,
                                                                    JoinPointGenerator.AdviceSetup setup)

isCaller

protected boolean isCaller()

hasCallingObject

protected boolean hasCallingObject()

hasTargetObject

protected abstract boolean hasTargetObject()

overrideDispatchMethods

protected void overrideDispatchMethods(javassist.CtClass superClass,
                                       javassist.CtClass clazz,
                                       JoinPointInfo newInfo)
                                throws javassist.CannotCompileException,
                                       javassist.NotFoundException
Normal people don't want to override the dispatch method

Throws:
javassist.CannotCompileException
javassist.NotFoundException

overrideDispatchMethods

protected void overrideDispatchMethods(javassist.CtClass superClass,
                                       javassist.CtClass clazz,
                                       CallerConstructorInfo cinfo)
                                throws javassist.NotFoundException,
                                       javassist.CannotCompileException
For ConByXXXX, If target constructor is execution advised, replace it with a call to the constructor wrapper

Throws:
javassist.NotFoundException
javassist.CannotCompileException

addUntransformableInterface

protected static void addUntransformableInterface(Instrumentor instrumentor,
                                                  javassist.CtClass clazz)
                                           throws javassist.NotFoundException
Throws:
javassist.NotFoundException

addUntransformableInterface

protected static void addUntransformableInterface(javassist.ClassPool pool,
                                                  javassist.CtClass clazz)
                                           throws javassist.NotFoundException
Throws:
javassist.NotFoundException

getMethodString

protected static String getMethodString(javassist.CtClass joinpoint,
                                        String method,
                                        javassist.CtClass[] params)

getJoinpointField

protected Field getJoinpointField()


Copyright © 2008 JBoss, a division of Red Hat, Inc.. All Rights Reserved.