org.codehaus.aspectwerkz.definition
Class SystemDefinition

java.lang.Object
  extended byorg.codehaus.aspectwerkz.definition.SystemDefinition

public class SystemDefinition
extends Object

Abstraction of the system definition, defines the aspect system.

Author:
Jonas Bonér , Alexandre Vasseur

Field Summary
static Map EMPTY_HASH_MAP
          Empty hash map.
static String PER_CLASS
           
static String PER_INSTANCE
           
static String PER_JVM
           
static String PER_THREAD
           
 
Constructor Summary
SystemDefinition(String uuid)
          Creates a new instance, creates and sets the system cflow aspect.
 
Method Summary
 void addAspect(AspectDefinition aspectDef)
          Adds a new aspect definition.
 void addExcludePackage(String excludePackage)
          Adds a new exclude package.
 void addIncludePackage(String includePackage)
          Adds a new include package.
 void addInterfaceIntroductionDefinition(InterfaceIntroductionDefinition introDef)
          Adds a new pure interface mixin definition.
 void addIntroductionDefinition(IntroductionDefinition introDef)
          Adds a new mixin definition.
 void addParameter(String aspectName, String key, String value)
          Adds a new parameter for the aspect.
 void addPreparePackage(String preparePackage)
          Adds a new prepare package.
 AdviceDefinition getAdviceDefinition(String name)
          Returns a specific advice definition.
 Collection getAdviceDefinitions()
          Returns a collection with the advice definitions registered.
 AspectDefinition getAspectDefinition(String name)
          Returns a specific aspect definition.
 Collection getAspectDefinitions()
          Returns a collection with the aspect definitions registered.
 int getAspectIndexByName(String aspectName)
          Returns the index for a specific introduction.
 Set getExcludePackages()
          Returns the exclude packages.
 Set getIncludePackages()
          Returns the include packages.
 List getInterfaceIntroductionDefinitions(ExpressionContext ctx)
          Returns the interface introductions for a certain class merged with the implementation based introductions as well.
 Collection getIntroductionDefinitions()
          Returns a collection with the introduction definitions registered.
 List getIntroductionDefinitions(ExpressionContext ctx)
          Returns the introduction definitions for a specific class.
 int getMixinIndexByName(String mixinName)
          Returns the index for a specific introduction.
 Map getParameters(String aspectName)
          Returns parameters for the aspect.
 Set getPreparePackages()
          Returns the prepare packages.
 String getUuid()
          Returns the UUID for the definition.
 boolean hasAdvice(String name)
          Checks if there exists an advice with the name specified.
 boolean hasCflowPointcut(ExpressionContext ctx)
          Checks if a method has an cflow pointcut.
 boolean hasIntroduction(ExpressionContext ctx)
          Checks if a class has an introduction.
 boolean hasIntroduction(String name)
          Checks if there exists an introduction with the name specified.
 boolean hasPointcut(ExpressionContext ctx)
          Checks if a method has an pointcut.
 boolean inExcludePackage(String className)
          Checks if a class should be excluded.
 boolean inIncludePackage(String className)
          Checks if a class should be included.
 boolean inPreparePackage(String className)
          Checks if a class is in prepare declaration
 boolean isAdvised(ExpressionContext ctx)
          Checks if a class is advised.
 boolean isAdvised(ExpressionContext[] ctxs)
          Checks if a class is advised.
 boolean isInterfaceIntroduced(ExpressionContext ctx)
          Checks if a class is advised with an interface introduction.
 boolean isIntroduced(ExpressionContext ctx)
          Checks if a class has an introduction.
 boolean isIntroduced(ExpressionContext[] ctxs)
          Checks if a class has an introduction.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PER_JVM

public static final String PER_JVM
See Also:
Constant Field Values

PER_CLASS

public static final String PER_CLASS
See Also:
Constant Field Values

PER_INSTANCE

public static final String PER_INSTANCE
See Also:
Constant Field Values

PER_THREAD

public static final String PER_THREAD
See Also:
Constant Field Values

EMPTY_HASH_MAP

public static final Map EMPTY_HASH_MAP
Empty hash map.

Constructor Detail

SystemDefinition

public SystemDefinition(String uuid)
Creates a new instance, creates and sets the system cflow aspect.

Method Detail

getUuid

public String getUuid()
Returns the UUID for the definition.

Returns:
the UUID

getIncludePackages

public Set getIncludePackages()
Returns the include packages.

Returns:
the include packages

getExcludePackages

public Set getExcludePackages()
Returns the exclude packages.

Returns:
the exclude packages

getAspectDefinitions

public Collection getAspectDefinitions()
Returns a collection with the aspect definitions registered.

Returns:
the aspect definitions

getIntroductionDefinitions

public Collection getIntroductionDefinitions()
Returns a collection with the introduction definitions registered.

Returns:
the introduction definitions

getAdviceDefinitions

public Collection getAdviceDefinitions()
Returns a collection with the advice definitions registered.

Returns:
the advice definitions

getAspectDefinition

public AspectDefinition getAspectDefinition(String name)
Returns a specific aspect definition.

Parameters:
name - the name of the aspect definition
Returns:
the aspect definition

getAdviceDefinition

public AdviceDefinition getAdviceDefinition(String name)
Returns a specific advice definition.

Parameters:
name - the name of the advice definition
Returns:
the advice definition

getIntroductionDefinitions

public List getIntroductionDefinitions(ExpressionContext ctx)
Returns the introduction definitions for a specific class.

Parameters:
ctx - the expression context
Returns:
a list with the introduction definitions

getInterfaceIntroductionDefinitions

public List getInterfaceIntroductionDefinitions(ExpressionContext ctx)
Returns the interface introductions for a certain class merged with the implementation based introductions as well.

Parameters:
ctx - the expression context
Returns:
the names

getAspectIndexByName

public int getAspectIndexByName(String aspectName)
Returns the index for a specific introduction.

Parameters:
aspectName - the name of the aspect
Returns:
the index

getMixinIndexByName

public int getMixinIndexByName(String mixinName)
Returns the index for a specific introduction.

Parameters:
mixinName - the name of the mixin
Returns:
the index

addAspect

public void addAspect(AspectDefinition aspectDef)
Adds a new aspect definition.

Parameters:
aspectDef - the aspect definition

addIntroductionDefinition

public void addIntroductionDefinition(IntroductionDefinition introDef)
Adds a new mixin definition.

Parameters:
introDef - the mixin definition

addInterfaceIntroductionDefinition

public void addInterfaceIntroductionDefinition(InterfaceIntroductionDefinition introDef)
Adds a new pure interface mixin definition.

Parameters:
introDef - the mixin definition

addIncludePackage

public void addIncludePackage(String includePackage)
Adds a new include package.

Parameters:
includePackage - the new include package

addExcludePackage

public void addExcludePackage(String excludePackage)
Adds a new exclude package.

Parameters:
excludePackage - the new exclude package

addPreparePackage

public void addPreparePackage(String preparePackage)
Adds a new prepare package.

Parameters:
preparePackage - the new prepare package

getPreparePackages

public Set getPreparePackages()
Returns the prepare packages.

Returns:

hasAdvice

public boolean hasAdvice(String name)
Checks if there exists an advice with the name specified.

Parameters:
name - the name of the advice
Returns:
boolean

hasIntroduction

public boolean hasIntroduction(String name)
Checks if there exists an introduction with the name specified.

Parameters:
name - the name of the introduction
Returns:
boolean

inIncludePackage

public boolean inIncludePackage(String className)
Checks if a class should be included.

Parameters:
className - the name or the class
Returns:
boolean

inExcludePackage

public boolean inExcludePackage(String className)
Checks if a class should be excluded.

Parameters:
className - the name or the class
Returns:
boolean

inPreparePackage

public boolean inPreparePackage(String className)
Checks if a class is in prepare declaration

Parameters:
className - the name or the class
Returns:
boolean

hasIntroduction

public boolean hasIntroduction(ExpressionContext ctx)
Checks if a class has an introduction.

Parameters:
ctx - the expression context
Returns:
boolean

hasPointcut

public boolean hasPointcut(ExpressionContext ctx)
Checks if a method has an pointcut.

Parameters:
ctx - the expression context
Returns:
boolean

hasCflowPointcut

public boolean hasCflowPointcut(ExpressionContext ctx)
Checks if a method has an cflow pointcut.

Parameters:
ctx - the expression context
Returns:
boolean

isAdvised

public boolean isAdvised(ExpressionContext[] ctxs)
Checks if a class is advised.

Parameters:
ctxs - an array with the expression contexts
Returns:
boolean

isAdvised

public boolean isAdvised(ExpressionContext ctx)
Checks if a class is advised.

Parameters:
ctx - the expression context
Returns:
boolean

isIntroduced

public boolean isIntroduced(ExpressionContext[] ctxs)
Checks if a class has an introduction.

Parameters:
ctxs - an array with the expression contexts
Returns:
boolean

isIntroduced

public boolean isIntroduced(ExpressionContext ctx)
Checks if a class has an introduction.

Parameters:
ctx - the expression context
Returns:
boolean

isInterfaceIntroduced

public boolean isInterfaceIntroduced(ExpressionContext ctx)
Checks if a class is advised with an interface introduction.

Parameters:
ctx - the expression context
Returns:
boolean

addParameter

public void addParameter(String aspectName,
                         String key,
                         String value)
Adds a new parameter for the aspect.

Parameters:
aspectName - the name of the aspect
key - the key
value - the value

getParameters

public Map getParameters(String aspectName)
Returns parameters for the aspect.

Parameters:
aspectName - the name of the aspect
Returns:
parameters


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