org.codehaus.aspectwerkz.aspect
Interface AspectContainer

All Known Implementing Classes:
AbstractAspectContainer

public interface AspectContainer

Interface for that all aspect container implementations must implement.

Author:
Jonas Bonér

Method Summary
 void addIntroductionContainer(String name, IntroductionContainer introContainer)
          Attach the introduction container to this aspect container to mirror the "aspect contains 0-n introduction"
 Object createPerClassAspect(Class callingClass)
          Creates a new perClass cross-cutting instance, if it already exists then return it.
 Object createPerInstanceAspect(Object callingInstance)
          Creates a new perInstance cross-cutting instance, if it already exists then return it.
 Object createPerJvmAspect()
          Creates a new perJVM cross-cutting instance, if it already exists then return it.
 Object createPerThreadAspect(Thread thread)
          Creates a new perThread cross-cutting instance, if it already exists then return it.
 Method getAdvice(int index)
          Returns a specific advice by index.
 CrossCuttingInfo getCrossCuttingInfo()
          Returns the cross-cutting info.
 IntroductionContainer getIntroductionContainer(String name)
          Returns the introduction container of given name (introduction name) or null if not linked.
 Object invokeAdvice(int methodIndex, JoinPoint joinPoint)
          Invokes the advice method on a per JVM basis.
 Object invokeAdvice(int methodIndex, JoinPoint joinPoint, int[] methodToArgsIndexes)
          Invokes the advice method on a per JVM basis.
 

Method Detail

invokeAdvice

public Object invokeAdvice(int methodIndex,
                           JoinPoint joinPoint)
                    throws Throwable
Invokes the advice method on a per JVM basis.

Parameters:
methodIndex - the method index
joinPoint - the join point
Returns:
the result from the method invocation
Throws:
Throwable

invokeAdvice

public Object invokeAdvice(int methodIndex,
                           JoinPoint joinPoint,
                           int[] methodToArgsIndexes)
                    throws Throwable
Invokes the advice method on a per JVM basis.

Parameters:
methodIndex - the method index
joinPoint - the join point
methodToArgsIndexes -
Returns:
the result from the method invocation
Throws:
Throwable

getAdvice

public Method getAdvice(int index)
Returns a specific advice by index.

Parameters:
index - the index
Returns:
the advice

createPerJvmAspect

public Object createPerJvmAspect()
Creates a new perJVM cross-cutting instance, if it already exists then return it.

Returns:
the cross-cutting instance

createPerClassAspect

public Object createPerClassAspect(Class callingClass)
Creates a new perClass cross-cutting instance, if it already exists then return it.

Parameters:
callingClass -
Returns:
the cross-cutting instance

createPerInstanceAspect

public Object createPerInstanceAspect(Object callingInstance)
Creates a new perInstance cross-cutting instance, if it already exists then return it.

Parameters:
callingInstance -
Returns:
the cross-cutting instance

createPerThreadAspect

public Object createPerThreadAspect(Thread thread)
Creates a new perThread cross-cutting instance, if it already exists then return it.

Parameters:
thread - the thread for the aspect
Returns:
the cross-cutting instance

getCrossCuttingInfo

public CrossCuttingInfo getCrossCuttingInfo()
Returns the cross-cutting info.

Returns:
the cross-cutting info

addIntroductionContainer

public void addIntroductionContainer(String name,
                                     IntroductionContainer introContainer)
Attach the introduction container to this aspect container to mirror the "aspect contains 0-n introduction"

Parameters:
name - of the introduction
introContainer - introduction container

getIntroductionContainer

public IntroductionContainer getIntroductionContainer(String name)
Returns the introduction container of given name (introduction name) or null if not linked.

Parameters:
name - of the introduction
Returns:
introduction container


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