[JBoss AOP] - Re: Interceptors with MDBs
by bfach
The thing is that they are NOT being called from different implementations.
It is the exact same code except they are configured differently. Multiple MDBs are deployed as such in the xml
<ejb-jar>
<enterprise-beans>
<message-driven>
<ejb-name>MDBA</ejb-name>
<ejb-class>main.MDB</ejb-class>
<transaction-type>Container</transaction-type>
<acknowledge-mode>Auto-acknowledge</acknowledge-mode>
<message-driven-destination>
<destination-type>javax.jms.Queue</destination-type>
</message-driven-destination>
<env-entry>
<env-entry-name>config</env-entry-name>
<env-entry-type>java.lang.String</env-entry-type>
<env-entry-value>A</env-entry-value>
</env-entry>
</message-driven>
<message-driven>
<ejb-name>MDBB</ejb-name>
<ejb-class>main.MDB</ejb-class>
<transaction-type>Container</transaction-type>
<acknowledge-mode>Auto-acknowledge</acknowledge-mode>
<message-driven-destination>
<destination-type>javax.jms.Queue</destination-type>
</message-driven-destination>
<env-entry>
<env-entry-name>config</env-entry-name>
<env-entry-type>java.lang.String</env-entry-type>
<env-entry-value>B</env-entry-value>
</env-entry>
</message-driven>
</enterprise-beans>
<message-driven>
<ejb-name>MDBA</ejb-name>
destination-jndi-name>queue/A</destination-jndi-name>
</message-driven>
<message-driven>
<ejb-name>MDBB</ejb-name>
<destination-jndi-name>queue/B</destination-jndi-name>
</message-driven>
The difference here is that the injected "config" property is used to lookup its respective configuration.
Thanks for the help again. I have posted the original post on the EJB3 forum.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4180019#4180019
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4180019
17 years, 7 months
[EJB 3.0] - Interceptors per MDB
by bfach
Hello,
I have setup my interceptor in such a fashion:
@AroundInvoke()
public Object onMessage(InvocationContext invocationContext) throws Exception{
Object result = invocationContext.proceed();
return result;
}
@MessageDriven
class MDBclass {
@Interceptors(RHMDBInterceptor.class)
public void onMessage(Message msg) {
// do something
}
}
This works fine however I want to have a seperate INSTANCE of a interceptor for each separate deployment of the MDB class that is listed in the deployment descriptors. As it is now, the interceptor intercepts all calls to on message for all EJBs.
I want an instance of the same interceptor for each MDB ejb deployment.
I have found a few things but they are all different ways and i haven't figured out how to make them work. Any hints on how i could do this would be greatly appreciated.
Thanks,
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4180012#4180012
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4180012
17 years, 7 months