|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.codehaus.aspectwerkz.aspect.AbstractAspectContainer
Abstract base class for the aspect container implementations.
| Field Summary | |
protected Object[] |
arrayWithSingleCrossCuttingInfo
An array with the single cross-cutting info, needed to save one array creation per invocation. |
static int |
ASPECT_CONSTRUCTION_TYPE_CROSS_CUTTING_INFO
|
static int |
ASPECT_CONSTRUCTION_TYPE_DEFAULT
|
static int |
ASPECT_CONSTRUCTION_TYPE_UNKNOWN
|
static Object[] |
EMPTY_OBJECT_ARRAY
|
protected Method[] |
m_adviceRepository
The advice repository. |
protected Object |
m_aspectPrototype
The aspect instance prototype. |
protected int |
m_constructionType
The aspect construction type. |
protected CrossCuttingInfo |
m_infoPrototype
The cross-cutting info prototype. |
protected Map |
m_introductionContainers
Introduction container containing introduction declared by this aspect, keys by introduction names |
protected Map |
m_perClass
Holds references to the per class aspect instances. |
protected Map |
m_perInstance
Holds references to the per instance aspect instances. |
protected Object |
m_perJvm
Holds a reference to the sole per JVM aspect instance. |
protected Map |
m_perThread
Holds references to the per thread aspect instances. |
| Constructor Summary | |
AbstractAspectContainer(CrossCuttingInfo crossCuttingInfo)
Creates a new aspect container strategy. |
|
| Method Summary | |
void |
addIntroductionContainer(String name,
IntroductionContainer introContainer)
Attach the introduction container to this aspect container to mirror the "aspect contains 0-n introduction" |
protected void |
createAdviceRepository()
Creates a repository for the advice methods. |
protected abstract Object |
createAspect()
To be implemented by the concrete aspect containers. |
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 adviceIndex,
JoinPoint joinPoint)
Invokes an advice with the index specified. |
Object |
invokeAdvice(int adviceIndex,
JoinPoint joinPoint,
int[] methodToArgIndexes)
Invokes the advice method on a per JVM basis. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final int ASPECT_CONSTRUCTION_TYPE_UNKNOWN
public static final int ASPECT_CONSTRUCTION_TYPE_DEFAULT
public static final int ASPECT_CONSTRUCTION_TYPE_CROSS_CUTTING_INFO
public static final Object[] EMPTY_OBJECT_ARRAY
protected int m_constructionType
protected final Map m_introductionContainers
protected final CrossCuttingInfo m_infoPrototype
protected final Object[] arrayWithSingleCrossCuttingInfo
protected final Object m_aspectPrototype
protected Object m_perJvm
protected final Map m_perClass
protected final Map m_perInstance
protected final Map m_perThread
protected Method[] m_adviceRepository
| Constructor Detail |
public AbstractAspectContainer(CrossCuttingInfo crossCuttingInfo)
crossCuttingInfo - the cross-cutting info| Method Detail |
public Object invokeAdvice(int adviceIndex,
JoinPoint joinPoint)
throws Throwable
invokeAdvice in interface AspectContaineradviceIndex - the advice indexjoinPoint - the join point
Throwable
public Object invokeAdvice(int adviceIndex,
JoinPoint joinPoint,
int[] methodToArgIndexes)
throws Throwable
AspectContainer
invokeAdvice in interface AspectContaineradviceIndex - the method indexjoinPoint - the join pointmethodToArgIndexes -
Throwablepublic Method getAdvice(int index)
getAdvice in interface AspectContainerindex - the index
public CrossCuttingInfo getCrossCuttingInfo()
getCrossCuttingInfo in interface AspectContainerpublic Object createPerJvmAspect()
createPerJvmAspect in interface AspectContainerpublic Object createPerClassAspect(Class callingClass)
createPerClassAspect in interface AspectContainercallingClass -
public Object createPerInstanceAspect(Object callingInstance)
createPerInstanceAspect in interface AspectContainercallingInstance -
public Object createPerThreadAspect(Thread thread)
createPerThreadAspect in interface AspectContainerthread - the thread for the aspect
public void addIntroductionContainer(String name,
IntroductionContainer introContainer)
addIntroductionContainer in interface AspectContainername - of the introductionintroContainer - introduction containerpublic IntroductionContainer getIntroductionContainer(String name)
getIntroductionContainer in interface AspectContainername - of the introduction
protected void createAdviceRepository()
protected abstract Object createAspect()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||