org.codehaus.aspectwerkz
Class CrossCuttingInfo

java.lang.Object
  extended byorg.codehaus.aspectwerkz.CrossCuttingInfo
All Implemented Interfaces:
Serializable

public final class CrossCuttingInfo
extends Object
implements Serializable

Contains information about and for classes that has been defined as cross-cutting.

Author:
Jonas Bonér
See Also:
Serialized Form

Field Summary
static Object[] EMPTY_OBJECT_ARRAY
          An empty Object array.
 
Constructor Summary
CrossCuttingInfo(String uuid, Class aspectClass, String name, int deploymentModel, AspectDefinition aspectDef, Map parameters)
          Creates a new cross-cutting info instance.
 
Method Summary
 void addMetaData(Object key, Object value)
          Adds metadata.
 Class getAspectClass()
          Returns the cross-cuttable class.
 AspectDefinition getAspectDefinition()
          Returns the aspect definition.
 AspectContainer getContainer()
          Returns the container.
 int getDeploymentModel()
          Returns the deployment model.
 Object getMetaData(Object key)
          Returns the metadata for a specific key.
 Class getMixinTargetClass(Object mixinImpl)
          Returns the target class for the mixin of given name which is defined from within this aspect (mixin can have different deployment model from aspect)
 Class getMixinTargetClass(String mixinName, Object mixinImpl)
          Returns the target class for the mixin of given name which is defined from within this aspect (mixin can have different deployment model from aspect)
 Object getMixinTargetInstance(Object mixinImpl)
          Returns the target instance for the mixin of given name which is defined from within this aspect (mixin can have different deployment model from aspect)
 Object getMixinTargetInstance(String mixinName, Object mixinImpl)
          Returns the target instance for the mixin of given name which is defined from within this aspect (mixin can have different deployment model from aspect)
 String getName()
          Returns the name of the aspect.
 String getParameter(String name)
          Returns the value of a parameter.
 AspectSystem getSystem()
          Returns the AspectWerkz system housing this cross-cuttable class.
 String getUuid()
          Returns the UUID for the system.
 boolean isPrototype()
          Return true if the CrossCuttingInfo has not yet the AspectContainer set, that means this is the prototype init time
static CrossCuttingInfo newInstance(CrossCuttingInfo prototype)
          Copy constructor - creates a clone of the cross-cutting info.
 void setContainer(AspectContainer container)
          Sets the container.
 void setDeploymentModel(int deploymentModel)
          Changes the deployment model.
 void setParameter(String name, String value)
          Sets a parameter.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EMPTY_OBJECT_ARRAY

public static final Object[] EMPTY_OBJECT_ARRAY
An empty Object array.

Constructor Detail

CrossCuttingInfo

public CrossCuttingInfo(String uuid,
                        Class aspectClass,
                        String name,
                        int deploymentModel,
                        AspectDefinition aspectDef,
                        Map parameters)
Creates a new cross-cutting info instance.

Parameters:
uuid -
aspectClass -
deploymentModel -
aspectDef -
parameters -
Method Detail

newInstance

public static CrossCuttingInfo newInstance(CrossCuttingInfo prototype)
Copy constructor - creates a clone of the cross-cutting info. Creates a new instance of the cross-cutting class it holds.

Returns:
a clone of the cross-cutting info

getSystem

public AspectSystem getSystem()
Returns the AspectWerkz system housing this cross-cuttable class.

Returns:
the system

getUuid

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

Returns:
the UUID for the system

getName

public String getName()
Returns the name of the aspect.

Returns:
the name of the aspect

getDeploymentModel

public int getDeploymentModel()
Returns the deployment model.

Returns:
the deployment model

setDeploymentModel

public void setDeploymentModel(int deploymentModel)
Changes the deployment model.

Parameters:
deploymentModel - the new deployment model

getAspectClass

public Class getAspectClass()
Returns the cross-cuttable class.

Returns:
the cross-cuttable class

setContainer

public void setContainer(AspectContainer container)
Sets the container.

Parameters:
container - the container

getContainer

public AspectContainer getContainer()
Returns the container.

Returns:
the container

getAspectDefinition

public AspectDefinition getAspectDefinition()
Returns the aspect definition.

Will return null after deserialization.

Returns:
the aspect definition

setParameter

public void setParameter(String name,
                         String value)
Sets a parameter.

Parameters:
name - the name of the parameter
value - the value of the parameter

getParameter

public String getParameter(String name)
Returns the value of a parameter.

Parameters:
name - the name of the parameter
Returns:
the value of the parameter or null if not found

addMetaData

public void addMetaData(Object key,
                        Object value)
Adds metadata.

Parameters:
key - the key
value - the value

getMetaData

public Object getMetaData(Object key)
Returns the metadata for a specific key.

Parameters:
key - the key
Returns:
the value

getMixinTargetInstance

public Object getMixinTargetInstance(Object mixinImpl)
Returns the target instance for the mixin of given name which is defined from within this aspect (mixin can have different deployment model from aspect)

Parameters:
mixinImpl - miximImplementation aka "this" when called from within the mixin impl
Returns:
the target instance or null if not compliant deployment model

getMixinTargetClass

public Class getMixinTargetClass(Object mixinImpl)
Returns the target class for the mixin of given name which is defined from within this aspect (mixin can have different deployment model from aspect)

Parameters:
mixinImpl - miximImplementation aka "this" when called from within the mixin impl
Returns:
the target class or null if not compliant deployment model

getMixinTargetInstance

public Object getMixinTargetInstance(String mixinName,
                                     Object mixinImpl)
Returns the target instance for the mixin of given name which is defined from within this aspect (mixin can have different deployment model from aspect)

Parameters:
mixinName - of the mixin
mixinImpl - miximImplementation aka "this" when called from within the mixin impl
Returns:
the target instance or null if not compliant deployment model

getMixinTargetClass

public Class getMixinTargetClass(String mixinName,
                                 Object mixinImpl)
Returns the target class for the mixin of given name which is defined from within this aspect (mixin can have different deployment model from aspect)

Parameters:
mixinName - of the mixin
mixinImpl - miximImplementation aka "this" when called from within the mixin impl
Returns:
the target class or null if not compliant deployment model

isPrototype

public boolean isPrototype()
Return true if the CrossCuttingInfo has not yet the AspectContainer set, that means this is the prototype init time



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