|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectdynaop.Aspects
Collection of aspects. Aspects map advice to pointcuts.
Treats Object.class
as a special case interface allowing
mixins or method interceptors to implement hashCode()
,
equals(Object)
, and toString()
.
Constructor Summary | |
Aspects()
|
Method Summary | |
static Aspects |
getInstance()
Gets default instance. Defaults to BshAspects . |
void |
interceptor(ClassPointcut classPointcut,
MethodPointcut methodPointcut,
java.lang.Class interceptorClass,
Closure initializer)
Adds method interceptor instance to methods picked by pointcuts. |
void |
interceptor(ClassPointcut classPointcut,
MethodPointcut methodPointcut,
Interceptor interceptor)
Adds method interceptor instance to methods picked by pointcuts. |
void |
interceptor(ClassPointcut classPointcut,
MethodPointcut methodPointcut,
InterceptorFactory factory)
Adds custom interceptor factory to methods picked by pointcuts. |
void |
interfaces(ClassPointcut classPointcut,
java.lang.Class[] interfaces)
Adds interfaces to classes picked by pointcut. |
void |
mixin(ClassPointcut classPointcut,
java.lang.Class[] interfaces,
java.lang.Class mixinClass,
Closure initializer)
Adds mixin instance to classes picked by pointcut. |
void |
mixin(ClassPointcut classPointcut,
java.lang.Class[] interfaces,
MixinFactory mixinFactory)
Adds custom mixin factory to classes picked by pointcut. |
void |
mixin(ClassPointcut classPointcut,
java.lang.Class mixinClass,
Closure initializer)
Convenience method. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Aspects()
Method Detail |
public void interfaces(ClassPointcut classPointcut, java.lang.Class[] interfaces) throws ConfigurationException
classPointcut
- Classes to add interfaces to.interfaces
- Interfaces to add.
ConfigurationException
public void mixin(ClassPointcut classPointcut, java.lang.Class[] interfaces, java.lang.Class mixinClass, Closure initializer) throws ConfigurationException
ProxyAware
. Creates mixin instances using default
constructor. Executes initializer
against mixin instance
after creation and before usage.
classPointcut
- Classes to add mixin to.interfaces
- Interfaces mixin implements.mixinClass
- Mixin implementation.initializer
- Code that initializes mixin instance. Can be
null
.
ConfigurationException
public void mixin(ClassPointcut classPointcut, java.lang.Class mixinClass, Closure initializer) throws ConfigurationException
ConfigurationException
public void mixin(ClassPointcut classPointcut, java.lang.Class[] interfaces, MixinFactory mixinFactory) throws ConfigurationException
ConfigurationException
public void interceptor(ClassPointcut classPointcut, MethodPointcut methodPointcut, Interceptor interceptor) throws ConfigurationException
ProxyAware
.
classPointcut
- Picks target classes.methodPointcut
- Picks methods to add interceptor to.interceptor
- Interceptor instance.
ConfigurationException
public void interceptor(ClassPointcut classPointcut, MethodPointcut methodPointcut, java.lang.Class interceptorClass, Closure initializer) throws ConfigurationException
ProxyAware
. Creates interceptor instances using default
constructor. Executes initializer
against
interceptor instance after creation and before usage.
classPointcut
- Picks target classes.methodPointcut
- Picks methods to add interceptor to.interceptorClass
- Interceptor class.initializer
- Code that initializes mixin instance. Can be
null
.
ConfigurationException
public void interceptor(ClassPointcut classPointcut, MethodPointcut methodPointcut, InterceptorFactory factory) throws ConfigurationException
classPointcut
- Picks target classes.methodPointcut
- Picks methods to add interceptor to.factory
- Interceptor factory.
ConfigurationException
public static Aspects getInstance()
BshAspects
. Specify alternate implementation class
using "dynaop.aspects" system property. Creates Aspects
instance using default constructor.
BshAspects for configuration
instructions.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |