I'm having a serious regression issue in ejb3-interceptors where interceptor instances
are no longer bound to an EJB lifecycle, but to the container instead.
Basically there is no way to store the interceptors per bean instance. So to preserve the
StatelessObjectFactory API I build ejb3-attachments, which allows for attaching
interceptor instances to a bean.
(Note: that the problem does not occur in 'basic' (AOP) operation of
ejb3-interceptors, because then the 'PER_INSTANCE' advice is correctly picked up
by AOP. So in effect the 'PER_INSTANCE' advice isn't handled correctly by the
interceptor BeanContainer (or ManagedAdvisor). If we want to move more AOP then the real
fix is to have a proper instance advisor.)
The main problem with attachments is that passivation needs to be aware. Which is
precisely what I not want.
Beyond scope for this discussion: pool (which is a consumer of the bean factory) and
injection (which is a facilitator within the bean factory). The injection of interceptors
I want to handle in a separate thread.
Maybe we need an InstanceContext / BeanContext from the StatelessObjectFactory:
Factory<T> {
| BeanContext<T> create();
| };
|
| BeanContext<T> {
| T getInstance();
|
| <A> A getAttachment(Object key, Class<A> attachmentType);
| }
Does MC have such a thing?
(Note 2: the current ejb3-interceptors also calls PostConstruct on the bean, which I think
is wrong (it's JSR-250 functionality, not EJB 3 ch 8), however the ejb3-interceptors
component needs a visitor hook in bean-factory to allow for attachment / interceptors
construction (via the same bean-factory?)).
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4140136#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...