org.codehaus.aspectwerkz.introduction
Class DefaultIntroductionContainerStrategy

java.lang.Object
  extended byorg.codehaus.aspectwerkz.introduction.DefaultIntroductionContainerStrategy
All Implemented Interfaces:
IntroductionContainer

public class DefaultIntroductionContainerStrategy
extends java.lang.Object
implements IntroductionContainer

Implements the default introduction container strategy.

Author:
Jonas Bonér

Constructor Summary
DefaultIntroductionContainerStrategy(java.lang.Class implClass)
          Creates a new default introduction container.
 
Method Summary
 ContainerType getContainerType()
          Returns the container type.
 java.lang.reflect.Method getMethod(int index)
          Returns a specific method by the method index.
 java.lang.reflect.Method[] getMethods()
          Returns all the methods for this introduction.
 java.lang.Object invokePerClass(java.lang.Object callingObject, int methodIndex, java.lang.Object[] parameters)
          Invokes the method on a per class basis.
 java.lang.Object invokePerInstance(java.lang.Object callingObject, int methodIndex, java.lang.Object[] parameters)
          Invokes the method on a per instance basis.
 java.lang.Object invokePerJvm(int methodIndex, java.lang.Object[] parameters)
          Invokes the method on a per JVM basis.
 java.lang.Object invokePerThread(int methodIndex, java.lang.Object[] parameters)
          Invokes the method on a per thread basis.
 void swapImplementation(java.lang.Class implClass)
          Swaps the current introduction implementation.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultIntroductionContainerStrategy

public DefaultIntroductionContainerStrategy(java.lang.Class implClass)
Creates a new default introduction container.

Parameters:
implClass - the implementation class
Method Detail

invokePerJvm

public java.lang.Object invokePerJvm(int methodIndex,
                                     java.lang.Object[] parameters)
Invokes the method on a per JVM basis.

Specified by:
invokePerJvm in interface IntroductionContainer
Parameters:
methodIndex - the method index
parameters - the parameters for the invocation
Returns:
the result from the method invocation

invokePerClass

public java.lang.Object invokePerClass(java.lang.Object callingObject,
                                       int methodIndex,
                                       java.lang.Object[] parameters)
Invokes the method on a per class basis.

Specified by:
invokePerClass in interface IntroductionContainer
Parameters:
callingObject - a reference to the calling object
methodIndex - the method index
parameters - the parameters for the invocation
Returns:
the result from the method invocation

invokePerInstance

public java.lang.Object invokePerInstance(java.lang.Object callingObject,
                                          int methodIndex,
                                          java.lang.Object[] parameters)
Invokes the method on a per instance basis.

Specified by:
invokePerInstance in interface IntroductionContainer
Parameters:
callingObject - a reference to the calling object
methodIndex - the method index
parameters - the parameters for the invocation
Returns:
the result from the method invocation

invokePerThread

public java.lang.Object invokePerThread(int methodIndex,
                                        java.lang.Object[] parameters)
Invokes the method on a per thread basis.

Specified by:
invokePerThread in interface IntroductionContainer
Parameters:
methodIndex - the method index
parameters - the parameters for the invocation
Returns:
the result from the method invocation

swapImplementation

public void swapImplementation(java.lang.Class implClass)
Swaps the current introduction implementation.

Specified by:
swapImplementation in interface IntroductionContainer
Parameters:
implClass - the class of the new implementation to use

getContainerType

public ContainerType getContainerType()
Returns the container type.

Specified by:
getContainerType in interface IntroductionContainer
Returns:
the container type

getMethod

public java.lang.reflect.Method getMethod(int index)
Returns a specific method by the method index.

Specified by:
getMethod in interface IntroductionContainer
Parameters:
index - the method index
Returns:
the method

getMethods

public java.lang.reflect.Method[] getMethods()
Returns all the methods for this introduction.

Specified by:
getMethods in interface IntroductionContainer
Returns:
the methods


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