org.codehaus.aspectwerkz.advice
Interface Advice

All Superinterfaces:
java.io.Serializable
All Known Implementing Classes:
AbstractAdvice

public interface Advice
extends java.io.Serializable

Implements the Advice concept.
I.e.a function object that can be defined to be invoked before, after or instead of specific points in the execution flow of the program.

Author:
Jonas Bonér

Method Summary
 java.lang.Object doExecute(JoinPoint joinPoint)
          Executes the current advice A then redirects to the next advice in the chain.

Callback method for the framework.

 java.lang.Class getAdviceClass()
          Returns the class for the advice.
 AdviceContainer getContainer()
          Returns the distribution strategy.
 int getDeploymentModel()
          Returns the deployment model for the advice.
 ContainerType getMemoryType()
          Returns the distribution type.
 java.lang.String getName()
          Returns the name of the advice.
 java.lang.String getParameter(java.lang.String name)
          Returns the value of a parameter with the name specified.
 java.util.Map getParameters()
          Returns the parameters for the advice.
 void setAdviceClass(java.lang.Class adviceClass)
          Sets the class for the advice.
 void setContainer(AdviceContainer memoryStrategy)
          Sets the memory strategy.
 void setDeploymentModel(int deploymentModel)
          Sets the deployment model for the advice.
Possible models are PER_JVM, PER_CLASS, PER_INSTANCE A PER_THREAD
 void setName(java.lang.String name)
          Sets the name of the advice.
 void setParameter(java.lang.String name, java.lang.String value)
          Sets a parameter for the advice.
 void setParameters(java.util.Map parameters)
          Sets the parameters for the advice.
 

Method Detail

doExecute

public java.lang.Object doExecute(JoinPoint joinPoint)
                           throws java.lang.Throwable
Executes the current advice A then redirects to the next advice in the chain.

Callback method for the framework.

Parameters:
joinPoint - the join point the advice is executing at
Returns:
the result from the next invocation
Throws:
java.lang.Throwable

setName

public void setName(java.lang.String name)
Sets the name of the advice.

Parameters:
name - the name of the advice

getName

public java.lang.String getName()
Returns the name of the advice.

Returns:
the name of the advice

setDeploymentModel

public void setDeploymentModel(int deploymentModel)
Sets the deployment model for the advice.
Possible models are PER_JVM, PER_CLASS, PER_INSTANCE A PER_THREAD

Parameters:
deploymentModel - the deployment model for the advice

getDeploymentModel

public int getDeploymentModel()
Returns the deployment model for the advice.

Returns:
the deployment model for the advice

setContainer

public void setContainer(AdviceContainer memoryStrategy)
Sets the memory strategy.

Parameters:
memoryStrategy - the memory strategy

getContainer

public AdviceContainer getContainer()
Returns the distribution strategy.

Returns:
the distribution strategy

getMemoryType

public ContainerType getMemoryType()
Returns the distribution type.

Returns:
the distribution type

setAdviceClass

public void setAdviceClass(java.lang.Class adviceClass)
Sets the class for the advice.

Parameters:
adviceClass - the class

getAdviceClass

public java.lang.Class getAdviceClass()
Returns the class for the advice.

Returns:
the class

setParameter

public void setParameter(java.lang.String name,
                         java.lang.String value)
Sets a parameter for the advice.

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

getParameter

public java.lang.String getParameter(java.lang.String name)
Returns the value of a parameter with the name specified.

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

setParameters

public void setParameters(java.util.Map parameters)
Sets the parameters for the advice.

Parameters:
parameters - the parameters as a map

getParameters

public java.util.Map getParameters()
Returns the parameters for the advice.

Returns:
the parameters as a map


Copyright (c) 2002-2004 The AspectWerkz Team. All Rights Reserved.