|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.codehaus.aspectwerkz.xmldef.XmlDefSystem
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 |
Fields inherited from interface org.codehaus.aspectwerkz.System |
DEFAULT_SYSTEM, START_REMOTE_PROXY_SERVER |
Constructor Summary | |
XmlDefSystem(java.lang.String uuid,
AspectWerkzDefinition definition)
Should NEVER be invoked by the user. |
Method Summary | |
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. |
Advice |
getAdvice(IndexTuple index)
Retrieves a specific advice based setfield's index. |
Advice |
getAdvice(java.lang.String name)
Returns the advice for a specific name. |
IndexTuple |
getAdviceIndexFor(java.lang.String name)
Returns the index for a specific name to advice mapping. |
AspectMetaData |
getAspectMetaData(java.lang.String name)
Returns the aspect for the name specified. |
java.util.Collection |
getAspectsMetaData()
Returns a list with all the aspects. |
java.util.List |
getCallPointcuts(ClassMetaData classMetaData,
MethodMetaData methodMetaData)
Returns the caller side pointcut list for the class and method specified. |
java.util.List |
getCFlowExpressions(ClassMetaData classMetaData,
MethodMetaData methodMetaData)
Returns a list with the cflow call expressions that affects the join point with the class name and the method name specified. |
java.util.List |
getExecutionPointcuts(ClassMetaData classMetaData,
MethodMetaData methodMetaData)
Returns the method pointcut list for the class and method specified. |
java.util.List |
getGetPointcuts(ClassMetaData classMetaData,
FieldMetaData fieldMetaData)
Returns the get field pointcut list for the class and field specified. |
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. |
Mixin |
getMixin(int index)
Retrieves a specific introduction based it's index. |
Mixin |
getMixin(java.lang.String name)
Returns the introduction for a specific name. |
java.util.List |
getSetPointcuts(ClassMetaData classMetaData,
FieldMetaData fieldMetaData)
Returns the set field pointcut list for the class and field specified. |
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 |
isAttribDef()
Checks if the definition is of type attribute definition. |
boolean |
isInControlFlowOf(CompiledPatternTuple patternTuple)
ALEX RM Checks if we are in the control flow of a specific cflow pointcut. |
boolean |
isInControlFlowOf(Expression cflowExpression)
Checks if we are in the control flow of a specific cflow expression. |
boolean |
isXmlDef()
Checks if the definition is of type XML definition. |
void |
register(AspectMetaData 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 |
Constructor Detail |
public XmlDefSystem(java.lang.String uuid, AspectWerkzDefinition definition)
SystemLoader.getSystem(uuid)
to retrieve the system.
Creates a new AspectWerkz system instance.
Sets the UUID for the system.
uuid
- the UUID for the systemdefinition
- the definition for the systemMethod Detail |
public void initialize()
initialize
in interface System
public boolean isAttribDef()
isAttribDef
in interface System
public boolean isXmlDef()
isXmlDef
in interface System
public void register(AspectMetaData 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)
enteringControlFlow
in interface System
metaData
- the classname:methodMetaData metaDatapublic void exitingControlFlow(ClassNameMethodMetaDataTuple metaData)
exitingControlFlow
in interface System
metaData
- the classname:methodMetaData metaDatapublic boolean isInControlFlowOf(CompiledPatternTuple patternTuple)
patternTuple
- the compiled tuple with the class pattern and the method pattern of the cflow pointcut
public boolean isInControlFlowOf(Expression cflowExpression)
isInControlFlowOf
in interface System
cflowExpression
- the call expression 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 AspectMetaData getAspectMetaData(java.lang.String name)
getAspectMetaData
in interface System
name
- the name of the aspect
public java.util.Collection getAspectsMetaData()
getAspectsMetaData
in interface System
public java.util.List getExecutionPointcuts(ClassMetaData classMetaData, MethodMetaData methodMetaData)
getExecutionPointcuts
in interface System
classMetaData
- the meta-data for the classmethodMetaData
- meta-data for the method
public java.util.List getGetPointcuts(ClassMetaData classMetaData, FieldMetaData fieldMetaData)
getGetPointcuts
in interface System
classMetaData
- the meta-data for the classfieldMetaData
- meta-data for the field
public java.util.List getSetPointcuts(ClassMetaData classMetaData, FieldMetaData fieldMetaData)
getSetPointcuts
in interface System
classMetaData
- the meta-data for the classfieldMetaData
- meta-data for the field
public java.util.List getThrowsPointcuts(ClassMetaData classMetaData, MethodMetaData methodMetaData)
getThrowsPointcuts
in interface System
classMetaData
- the meta-data for the classmethodMetaData
- meta-data for the method
public java.util.List getCallPointcuts(ClassMetaData classMetaData, MethodMetaData methodMetaData)
getCallPointcuts
in interface System
classMetaData
- the meta-data for the classmethodMetaData
- meta-data for the method
public java.util.List getCFlowExpressions(ClassMetaData classMetaData, MethodMetaData methodMetaData)
getCFlowExpressions
in interface System
classMetaData
- the class meta-data for the join pointmethodMetaData
- the meta-data for the method for the join point
public IndexTuple getAdviceIndexFor(java.lang.String name)
getAdviceIndexFor
in interface System
name
- the name of the advice
public Advice getAdvice(IndexTuple 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 Mixin getMixin(int index)
getMixin
in interface System
index
- the index of the introduction
public Mixin getMixin(java.lang.String name)
getMixin
in interface System
name
- the name of the introduction
public boolean hasAspect(java.lang.String name)
hasAspect
in interface System
name
- the name of the aspect
public java.lang.reflect.Method getMethod(java.lang.Class klass, int index)
getMethod
in interface System
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 |