org.codehaus.aspectwerkz
Class AspectContext

java.lang.Object
  extended by org.codehaus.aspectwerkz.AspectContext
All Implemented Interfaces:
Serializable

public final class AspectContext
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
AspectContext(String uuid, Class aspectClass, String name, DeploymentModel 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.
 DeploymentModel getDeploymentModel()
          Returns the deployment model.
 Object getMetaData(Object key)
          Returns the metadata for a specific key.
 String getName()
          Returns the name of the aspect.
 String getParameter(String name)
          Returns the value of a parameter.
 String getUuid()
          Returns the UUID for the system.
 boolean isPrototype()
          Return true if the AspectContext has not yet the AspectContainer set, that means this is the prototype init time
static AspectContext newInstance(AspectContext prototype)
          Copy constructor - creates a clone of the cross-cutting info.
 void setContainer(AspectContainer container)
          Sets the container.
 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

AspectContext

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

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

newInstance

public static AspectContext newInstance(AspectContext 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

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 DeploymentModel getDeploymentModel()
Returns the deployment model.

Returns:
the 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 specified

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

isPrototype

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



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