abc.weaving.aspectinfo
Class GlobalAspectInfo

java.lang.Object
  extended by abc.weaving.aspectinfo.GlobalAspectInfo

public class GlobalAspectInfo
extends java.lang.Object

All aspect-specific information for an entire program.

Author:
Aske Simon Christensen, Ganesh Sittampalam, Damien Sereni

Field Summary
static int PRECEDENCE_CONFLICT
           
static int PRECEDENCE_FIRST
           
static int PRECEDENCE_NONE
           
static int PRECEDENCE_SECOND
           
 
Method Summary
 void addAdviceDecl(AbstractAdviceDecl ad)
           
 void addAspect(Aspect aspct)
           
 void addClassNotWeavableError(ErrorInfo ei)
           
 void addClassToMakePublic(ClassType c)
           
 void addDeclareMessage(DeclareMessage dm)
           
 void addDeclareParents(DeclareParents dp)
           
 void addDeclarePrecedence(DeclarePrecedence dpr)
           
 void addDeclareSoft(DeclareSoft ds)
           
 void addIntertypeConstructorDecl(IntertypeConstructorDecl imd)
           
 void addIntertypeFieldDecl(IntertypeFieldDecl ifd)
           
 void addIntertypeMethodDecl(IntertypeMethodDecl imd)
           
 void addPointcutDecl(PointcutDecl pcd)
           
 void addShadowMatch(SootMethod method, ShadowMatch sm)
           
 void addSJPInfo(SootMethod method, SJPInfo sjpInfo)
           
 void addWeavableClass(AbcClass cl)
           
 void buildAspectHierarchy()
          This method builds the aspect_visibility structure, which is a mapping from classes and abstract aspects to the concrete aspects that extend them.
 void computeAdviceLists()
          Computes the lists of advice application points for all weavable classes
 java.util.List getAdviceDecls()
          Returns the list of all advice declarations.
 MethodAdviceList getAdviceList(SootMethod m)
          Returns the list of AdviceApplication structures for the given method
 Aspect getAspect(AbcClass cl)
           
 java.util.List getAspects()
          Returns the list of all aspects.
 java.util.List getClassesToMakePublic()
           
 ClassInitializationShadowMatch getClassInitializationShadowMatch(SootMethod method)
           
 java.util.List getDeclareParents()
          Returns the list of all declare parents declarations.
 java.util.List getDeclarePrecedence()
          Returns the list of all declare precedence declarations.
 ExecutionShadowMatch getExecutionShadowMatch(SootMethod method)
           
 java.util.Collection getExtendedClasses()
           
 FieldSig getField(MethodSig sig)
           
 java.util.List getInterfaceInitializationShadowMatchList(SootMethod method)
           
 java.util.List getIntertypeConstructorDecls()
          Returns the list of all intertype constructor declarations.
 java.util.List getIntertypeFieldDecls()
          Returns the list of all intertype field declarations.
 java.util.List getIntertypeMethodDecls()
          Returns the list of all intertype method declarations.
 int getMethodCategory(MethodSig sig)
           
 java.util.List getNonWeavableClassErrors()
          Returns the list of errors about classes which are not currently being woven, but which we would really need to insert accessor methods into.
 PointcutDecl getPointcutDecl(java.lang.String name, Aspect context)
           
 java.util.List getPointcutDecls()
          Returns the list of all pointcut declarations.
 int getPrecedence(Aspect a, Aspect b)
          Get the precedence relationship between two aspects, using both declare precedence relations and aspect inheritance
 int getPrecedence(java.lang.String a, java.lang.String b)
          Get the precedence relationship between two aspect names, just using declare precedence relations
 PreinitializationShadowMatch getPreinitializationShadowMatch(SootMethod method)
           
 AbcClass getRealClass(FieldSig sig)
           
 AbcClass getRealClass(MethodSig sig)
           
 int getRealModifiers(FieldSig sig, int defmods)
           
 int getRealModifiers(MethodSig sig, int defmods)
           
 java.lang.String getRealName(FieldSig sig)
           
 java.lang.String getRealName(MethodSig sig)
           
 java.util.List getShadowMatchList(SootMethod method)
           
 java.util.List getSJPInfoList(SootMethod method)
           
 int getSkipFirst(MethodSig sig)
           
 int getSkipLast(MethodSig sig)
           
 java.util.List getStmtShadowMatchList(SootMethod method)
           
 java.util.Set getWeavableClasses()
          Returns the list of classes into which weaving can take place.
 java.util.Set getWovenClasses()
           
 void initPrecedenceRelation(java.util.Map prec_rel)
           
 void print(java.io.PrintStream p)
           
 void registerFieldAccessor(FieldSig fs, MethodSig ms)
           
 void registerMethodCategory(MethodSig sig, int cat)
           
 void registerRealNameAndClass(FieldSig sig, int mods, java.lang.String real_name, AbcClass real_class)
           
 void registerRealNameAndClass(MethodSig sig, int mods, java.lang.String real_name, AbcClass real_class, int skip_first, int skip_last)
           
 void registerSourceClass(AbcClass cl)
           
 void registerWeave(AbcClass cl)
           
static void reset()
           
 void setExtendedClasses(java.util.Collection ecs)
           
 void sinkAdviceDecls()
           
static GlobalAspectInfo v()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PRECEDENCE_NONE

public static final int PRECEDENCE_NONE
See Also:
Constant Field Values

PRECEDENCE_FIRST

public static final int PRECEDENCE_FIRST
See Also:
Constant Field Values

PRECEDENCE_SECOND

public static final int PRECEDENCE_SECOND
See Also:
Constant Field Values

PRECEDENCE_CONFLICT

public static final int PRECEDENCE_CONFLICT
See Also:
Constant Field Values
Method Detail

v

public static GlobalAspectInfo v()

reset

public static void reset()

buildAspectHierarchy

public void buildAspectHierarchy()
This method builds the aspect_visibility structure, which is a mapping from classes and abstract aspects to the concrete aspects that extend them. It also takes care of inheriting per clauses and registering the necessary pieces of advice to implement those clauses


getWeavableClasses

public java.util.Set getWeavableClasses()
Returns the list of classes into which weaving can take place.

Returns:
a list of AbcClass objects.

getAspects

public java.util.List getAspects()
Returns the list of all aspects.

Returns:
a list of Aspect objects.

getIntertypeFieldDecls

public java.util.List getIntertypeFieldDecls()
Returns the list of all intertype field declarations.

Returns:
a list of IntertypeFieldDecl objects.

getIntertypeMethodDecls

public java.util.List getIntertypeMethodDecls()
Returns the list of all intertype method declarations.

Returns:
a list of IntertypeMethodDecl objects.

getIntertypeConstructorDecls

public java.util.List getIntertypeConstructorDecls()
Returns the list of all intertype constructor declarations.

Returns:
a list of IntertypeConstructorDecl objects.

getAdviceDecls

public java.util.List getAdviceDecls()
Returns the list of all advice declarations.

Returns:
a list of AbstractAdviceDecl objects.

getNonWeavableClassErrors

public java.util.List getNonWeavableClassErrors()
Returns the list of errors about classes which are not currently being woven, but which we would really need to insert accessor methods into. This is populated in the AJTypeSystem and added to the error queue in AspectDecl.typeCheck().

Returns:
a list of ErrorInfo objects

getPointcutDecls

public java.util.List getPointcutDecls()
Returns the list of all pointcut declarations.

Returns:
a list of PointcutDecl objects.

getPointcutDecl

public PointcutDecl getPointcutDecl(java.lang.String name,
                                    Aspect context)

getDeclareParents

public java.util.List getDeclareParents()
Returns the list of all declare parents declarations.

Returns:
a list of DeclareParents objects.

getDeclarePrecedence

public java.util.List getDeclarePrecedence()
Returns the list of all declare precedence declarations.

Returns:
a list of DeclarePrecedence objects.

setExtendedClasses

public void setExtendedClasses(java.util.Collection ecs)

getExtendedClasses

public java.util.Collection getExtendedClasses()

getAspect

public Aspect getAspect(AbcClass cl)

getClassesToMakePublic

public java.util.List getClassesToMakePublic()

addWeavableClass

public void addWeavableClass(AbcClass cl)

addAspect

public void addAspect(Aspect aspct)

addIntertypeFieldDecl

public void addIntertypeFieldDecl(IntertypeFieldDecl ifd)

addIntertypeMethodDecl

public void addIntertypeMethodDecl(IntertypeMethodDecl imd)

addIntertypeConstructorDecl

public void addIntertypeConstructorDecl(IntertypeConstructorDecl imd)

addAdviceDecl

public void addAdviceDecl(AbstractAdviceDecl ad)

addPointcutDecl

public void addPointcutDecl(PointcutDecl pcd)

addDeclareParents

public void addDeclareParents(DeclareParents dp)

addDeclarePrecedence

public void addDeclarePrecedence(DeclarePrecedence dpr)

addDeclareMessage

public void addDeclareMessage(DeclareMessage dm)

addDeclareSoft

public void addDeclareSoft(DeclareSoft ds)

addClassToMakePublic

public void addClassToMakePublic(ClassType c)

addClassNotWeavableError

public void addClassNotWeavableError(ErrorInfo ei)

print

public void print(java.io.PrintStream p)

initPrecedenceRelation

public void initPrecedenceRelation(java.util.Map prec_rel)

getPrecedence

public int getPrecedence(java.lang.String a,
                         java.lang.String b)
Get the precedence relationship between two aspect names, just using declare precedence relations

Parameters:
a - the name of the first aspect.
b - the name of the second aspect.
Returns:
PRECEDENCE_NONE if none of the aspects have precedence, PRECEDENCE_FIRST if the first aspect has precedence, PRECEDENCE_SECOND if the second aspect has precedence, or PRECEDENCE_CONFLICT if there is a precedence conflict between the two aspects.

getPrecedence

public int getPrecedence(Aspect a,
                         Aspect b)
Get the precedence relationship between two aspects, using both declare precedence relations and aspect inheritance

Parameters:
a - the first aspect.
b - the second aspect.
Returns:
PRECEDENCE_NONE if none of the aspects have precedence, PRECEDENCE_FIRST if the first aspect has precedence, PRECEDENCE_SECOND if the second aspect has precedence, or PRECEDENCE_CONFLICT if there is a precedence conflict between the two aspects.

sinkAdviceDecls

public void sinkAdviceDecls()

computeAdviceLists

public void computeAdviceLists()
                        throws SemanticException
Computes the lists of advice application points for all weavable classes

Throws:
SemanticException

getAdviceList

public MethodAdviceList getAdviceList(SootMethod m)
Returns the list of AdviceApplication structures for the given method


addSJPInfo

public void addSJPInfo(SootMethod method,
                       SJPInfo sjpInfo)

getSJPInfoList

public java.util.List getSJPInfoList(SootMethod method)

getShadowMatchList

public java.util.List getShadowMatchList(SootMethod method)

getStmtShadowMatchList

public java.util.List getStmtShadowMatchList(SootMethod method)

getInterfaceInitializationShadowMatchList

public java.util.List getInterfaceInitializationShadowMatchList(SootMethod method)

getExecutionShadowMatch

public ExecutionShadowMatch getExecutionShadowMatch(SootMethod method)

getClassInitializationShadowMatch

public ClassInitializationShadowMatch getClassInitializationShadowMatch(SootMethod method)

getPreinitializationShadowMatch

public PreinitializationShadowMatch getPreinitializationShadowMatch(SootMethod method)

addShadowMatch

public void addShadowMatch(SootMethod method,
                           ShadowMatch sm)

registerMethodCategory

public void registerMethodCategory(MethodSig sig,
                                   int cat)

getMethodCategory

public int getMethodCategory(MethodSig sig)

registerRealNameAndClass

public void registerRealNameAndClass(MethodSig sig,
                                     int mods,
                                     java.lang.String real_name,
                                     AbcClass real_class,
                                     int skip_first,
                                     int skip_last)

getRealModifiers

public int getRealModifiers(MethodSig sig,
                            int defmods)

getRealName

public java.lang.String getRealName(MethodSig sig)

getRealClass

public AbcClass getRealClass(MethodSig sig)

getSkipFirst

public int getSkipFirst(MethodSig sig)

getSkipLast

public int getSkipLast(MethodSig sig)

registerRealNameAndClass

public void registerRealNameAndClass(FieldSig sig,
                                     int mods,
                                     java.lang.String real_name,
                                     AbcClass real_class)

getRealModifiers

public int getRealModifiers(FieldSig sig,
                            int defmods)

getRealName

public java.lang.String getRealName(FieldSig sig)

getRealClass

public AbcClass getRealClass(FieldSig sig)

getField

public FieldSig getField(MethodSig sig)

registerFieldAccessor

public void registerFieldAccessor(FieldSig fs,
                                  MethodSig ms)

registerWeave

public void registerWeave(AbcClass cl)

getWovenClasses

public java.util.Set getWovenClasses()

registerSourceClass

public void registerSourceClass(AbcClass cl)