|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Represents the collection of aspects (pointuts + advice) to be applied to a Pico container. Provides methods for registering mixin and interceptor advice. Advice can be applied to all components in the container that match a pointcut, or advice can be applied to just one component. Advice objects may themselves be components in the container, with dependencies on other components.
Method Summary | |
PointcutsFactory |
getPointcutsFactory()
Produces a pointcuts factory that can be used to create pointcuts to be used in aspects registered with this AspectsContainer . |
void |
registerInterceptor(ClassPointcut classPointcut,
MethodPointcut methodPointcut,
org.aopalliance.intercept.MethodInterceptor interceptor)
Registers container scoped interceptor advice. |
void |
registerInterceptor(ClassPointcut classPointcut,
MethodPointcut methodPointcut,
java.lang.Object interceptorComponentKey)
Registers container supplied container scoped interceptor advice. |
void |
registerInterceptor(ComponentPointcut componentPointcut,
MethodPointcut methodPointcut,
org.aopalliance.intercept.MethodInterceptor interceptor)
Registers component scoped interceptor advice. |
void |
registerInterceptor(ComponentPointcut componentPointcut,
MethodPointcut methodPointcut,
java.lang.Object interceptorComponentKey)
Registers component scoped interceptor advice. |
void |
registerInterfaces(ClassPointcut classPointcut,
java.lang.Class[] interfaces)
Adds interfaces to classes picked by the class pointcut. |
void |
registerInterfaces(ComponentPointcut componentPointcut,
java.lang.Class[] interfaces)
Adds interfaces to components picked by the component pointcut. |
void |
registerMixin(ClassPointcut classPointcut,
java.lang.Class mixinClass)
Registers container scoped mixin advice. |
void |
registerMixin(ClassPointcut classPointcut,
java.lang.Class[] interfaces,
java.lang.Class mixinClass)
Registers container scoped mixin advice. |
void |
registerMixin(ComponentPointcut componentPointcut,
java.lang.Class mixinClass)
Registers component scoped mixin advice. |
void |
registerMixin(ComponentPointcut componentPointcut,
java.lang.Class[] interfaces,
java.lang.Class mixinClass)
Registers component scoped mixin advice. |
Method Detail |
public void registerInterceptor(ClassPointcut classPointcut, MethodPointcut methodPointcut, org.aopalliance.intercept.MethodInterceptor interceptor)
classPointcut
. The interceptor will only intercept
methods that match the methodPointcut
.
classPointcut
- classes to apply the interceptor to.methodPointcut
- methods to apply the interceptor to.interceptor
- the interceptor advice object.public void registerInterceptor(ComponentPointcut componentPointcut, MethodPointcut methodPointcut, org.aopalliance.intercept.MethodInterceptor interceptor)
componentPointcut
. The interceptor will only intercept
methods that match the methodPointcut
.
componentPointcut
- components to apply the interceptor to.methodPointcut
- methods to apply the interceptor to.interceptor
- the interceptor advice object.public void registerInterceptor(ClassPointcut classPointcut, MethodPointcut methodPointcut, java.lang.Object interceptorComponentKey)
interceptorComponentKey
. The advice will be
applied to all components in the container whose class satisfies the
classPointcut
. The interceptor will only intercept
methods that match the methodPointcut
.
classPointcut
- classes to apply the interceptor to.methodPointcut
- methods to apply the interceptor to.interceptorComponentKey
- the interceptor component key.public void registerInterceptor(ComponentPointcut componentPointcut, MethodPointcut methodPointcut, java.lang.Object interceptorComponentKey)
interceptorComponentKey
. The advice will be applied to
all components in the container whose key satisfies
componentPointcut
. The interceptor will only intercept
methods that match the methodPointcut
.
componentPointcut
- components to apply the interceptor to.methodPointcut
- methods to apply the interceptor to.interceptorComponentKey
- the interceptor component key.public void registerMixin(ClassPointcut classPointcut, java.lang.Class[] interfaces, java.lang.Class mixinClass)
classPointcut
.
If a component of type mixinClass
has been registered in
the container, that component will be used as the mixin. Otherwise a new
object of type mixinClass
will be instantiated each time
the mixin is applied to a component. Any dependencies the mixin has will
be supplied from components in the container, or, if there are no
dependencies, the default constructor will be invoked to instantiate the
mixin.
classPointcut
- classes to add mixin to.interfaces
- interfaces the mixin implements.mixinClass
- the mixin implementation.public void registerMixin(ComponentPointcut componentPointcut, java.lang.Class[] interfaces, java.lang.Class mixinClass)
componentPointcut
.
componentPointcut
- classes to add mixin to.interfaces
- interfaces the mixin implements.mixinClass
- the mixin implementation.for
details on how mixinClass
gets instantiated.
public void registerMixin(ClassPointcut classPointcut, java.lang.Class mixinClass)
classPointcut
. Convenience method that uses all
interfaces implemented by the mixin class.
classPointcut
- classes to add mixin to.mixinClass
- the mixin implementation.for
details on how mixinClass
gets instantiated.
public void registerMixin(ComponentPointcut componentPointcut, java.lang.Class mixinClass)
componentPointcut
. Convenience method that uses all
interfaces implemented by the mixin class.
componentPointcut
- classes to add mixin to.mixinClass
- the mixin implementation.for
details on how mixinClass
gets instantiated.
public void registerInterfaces(ClassPointcut classPointcut, java.lang.Class[] interfaces)
classPointcut
- classes to add interfaces to.interfaces
- the interfaces to add.public void registerInterfaces(ComponentPointcut componentPointcut, java.lang.Class[] interfaces)
componentPointcut
- components to add interfaces to.interfaces
- the interfaces to add.for
notes on using this method.
public PointcutsFactory getPointcutsFactory()
AspectsContainer
.
Note that you are not limited to pointcuts produced by this factory; any
pointcut that implements the appropriate ClassPointcut
,
MethodPointcut
or ComponentPointcut
will
work.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |