|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.codehaus.aspectwerkz.AspectWerkz
Manages the aspects in the AspectWerkz system.
Handles the initialization and configuration of the system.
Stores and indexes the aspects defined in the system.
Stores and indexes the advised methods.
Stores and indexes the introduced methods.
Field Summary | |
static java.lang.String |
DEFAULT_SYSTEM
The UUID of the single AspectWerkz system if only one definition is used. |
Method Summary | |
static java.lang.Integer |
calculateHash(java.lang.String className,
MetaData metaData)
Calculates the hash for the class name and the meta-data. |
void |
createAdvice(java.lang.String name,
java.lang.String className,
java.lang.String deploymentModel,
java.lang.ClassLoader loader)
Creates and registers new advice at runtime. |
void |
enteringControlFlow(ClassNameMethodMetaDataTuple metaData)
Registers entering of a control flow join point. |
void |
exitingControlFlow(ClassNameMethodMetaDataTuple metaData)
Registers exiting from a control flow join point. |
static void |
fakeStackTrace(java.lang.Throwable exception,
java.lang.String className)
Removes the AspectWerkz specific elements from the stack trace. |
Advice |
getAdvice(int index)
Retrieves a specific advice based setfield's index. |
Advice |
getAdvice(java.lang.String name)
Returns the advice for a specific name. |
int |
getAdviceIndexFor(java.lang.String name)
Returns the index for a specific name to advice mapping. |
Aspect |
getAspect(ClassPattern classPattern)
Returns the aspect for the class pattern specified. |
Aspect |
getAspect(java.lang.String name)
Returns the aspect for the name specified. |
java.util.Collection |
getAspects()
Returns a list with all the aspects. |
java.util.List |
getCallerSidePointcuts(java.lang.String className,
MethodMetaData methodMetaData)
Returns the caller side pointcut list for the class and method specified. |
java.util.List |
getCFlowPointcuts(java.lang.String className,
MethodMetaData methodMetaData)
Returns a list with the cflow pointcuts that affects the join point with the class name and the method name specified. |
static AspectWerkz |
getDefaultSystem()
Returns the AspectWerkz system, no system UUID is needed to be specified. |
java.util.List |
getGetFieldPointcuts(ClassMetaData classMetaData,
FieldMetaData fieldMetaData)
Returns the get field pointcut list for the class and field specified. |
Introduction |
getIntroduction(int index)
Retrieves a specific introduction based it's index. |
Introduction |
getIntroduction(java.lang.String name)
Returns the introduction for a specific name. |
int |
getIntroductionIndex(java.lang.String name)
Returns the index for a specific name to introduction mapping. |
Introduction[] |
getIntroductions()
Returns an array with all the introductions in the system. |
java.lang.reflect.Method |
getMethod(java.lang.Class klass,
int index)
Returns a specific method by the class and the method index. |
java.util.List |
getMethodPointcuts(ClassMetaData classMetaData,
MethodMetaData methodMetaData)
Returns the method pointcut list for the class and method specified. |
java.util.List |
getSetFieldPointcuts(ClassMetaData classMetaData,
FieldMetaData fieldMetaData)
Returns the set field pointcut list for the class and field specified. |
static AspectWerkz |
getSystem(java.lang.String uuid)
Returns the AspectWerkz system with a specific UUID. |
java.util.List |
getThrowsPointcuts(ClassMetaData classMetaData,
MethodMetaData methodMetaData)
Returns the throws pointcut list for the class and method specified. |
boolean |
hasAspect(java.lang.String name)
Checks if a specific class has an aspect defined. |
void |
initialize()
Initializes the system. |
boolean |
isInControlFlowOf(PointcutPatternTuple patternTuple)
Checks if we are in the control flow of a specific cflow pointcut. |
void |
register(Aspect aspect)
Registers a new aspect for a specific class. |
void |
register(java.lang.String name,
Advice advice)
Registers a new advice and maps it to a name. |
void |
register(java.lang.String name,
Introduction introduction)
Registers an introduction and maps it to a name. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.String DEFAULT_SYSTEM
Method Detail |
public static AspectWerkz getDefaultSystem()
public static AspectWerkz getSystem(java.lang.String uuid)
uuid
- the UUID for the system (the UUID specified when compiling
the weave model, if autogenerated can it be read in the name of
the weave model file, ex: "weaveModel_public static void fakeStackTrace(java.lang.Throwable exception, java.lang.String className)
exception
- the Throwable to modify the stack trace onclassName
- the name of the fake origin class of the exceptionpublic static java.lang.Integer calculateHash(java.lang.String className, MetaData metaData)
className
- the class namemetaData
- the meta-data
public void initialize()
public void register(Aspect aspect)
aspect
- the aspect to registerpublic void register(java.lang.String name, Advice advice)
name
- the name to map the advice toadvice
- the advice to registerpublic void register(java.lang.String name, Introduction introduction)
name
- the name to map the introduction tointroduction
- the introduction to registerpublic void enteringControlFlow(ClassNameMethodMetaDataTuple metaData)
metaData
- the classname:methodMetaData metaDatapublic void exitingControlFlow(ClassNameMethodMetaDataTuple metaData)
metaData
- the classname:methodMetaData metaDatapublic boolean isInControlFlowOf(PointcutPatternTuple patternTuple)
patternTuple
- the compiled tuple with the class pattern and the method pattern of the cflow pointcut
public void createAdvice(java.lang.String name, java.lang.String className, java.lang.String deploymentModel, java.lang.ClassLoader loader)
name
- the name of the adviceclassName
- the class name of the advicedeploymentModel
- the deployment model for the adviceloader
- an optional class loader (if null it uses the context classloader)public Aspect getAspect(java.lang.String name)
name
- the name of the aspect
public Aspect getAspect(ClassPattern classPattern)
classPattern
- the class pattern
public java.util.Collection getAspects()
public java.util.List getMethodPointcuts(ClassMetaData classMetaData, MethodMetaData methodMetaData)
classMetaData
- the meta-data for the classmethodMetaData
- meta-data for the method
public java.util.List getGetFieldPointcuts(ClassMetaData classMetaData, FieldMetaData fieldMetaData)
classMetaData
- the meta-data for the class
public java.util.List getSetFieldPointcuts(ClassMetaData classMetaData, FieldMetaData fieldMetaData)
classMetaData
- the meta-data for the class
public java.util.List getThrowsPointcuts(ClassMetaData classMetaData, MethodMetaData methodMetaData)
classMetaData
- the meta-data for the classmethodMetaData
- meta-data for the method
public java.util.List getCallerSidePointcuts(java.lang.String className, MethodMetaData methodMetaData)
className
- the class namemethodMetaData
- meta-data for the method
public java.util.List getCFlowPointcuts(java.lang.String className, MethodMetaData methodMetaData)
className
- the name of the class for the join pointmethodMetaData
- the meta-data for the method for the join point
public int getAdviceIndexFor(java.lang.String name)
name
- the name of the advice
public Advice getAdvice(int index)
index
- the index of the advice
public Advice getAdvice(java.lang.String name)
name
- the name of the advice
public Introduction[] getIntroductions()
public int getIntroductionIndex(java.lang.String name)
name
- the name of the introduction
public Introduction getIntroduction(int index)
index
- the index of the introduction
public Introduction getIntroduction(java.lang.String name)
name
- the name of the introduction
public boolean hasAspect(java.lang.String name)
name
- the name of the aspect
public java.lang.reflect.Method getMethod(java.lang.Class klass, int index)
klass
- the class housing the methodindex
- the method index
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |