EJB3 is built on JBoss AOP framework. ALl the facilities you would need to do this are
built in already.
You need:
1. A service that holds your routing information and matches it up to an EJBContainer.
EJB3 containers are all registered in org.jboss.ejb3.Ejb3Registry
2. a Server-side aspect that intercepts the invocation and reroutes the invocation. You
can add this aspect to all EJB containers by adding your aspect to the
ejb3-interceptors-aop.xml file. Server side AOP bindings are defined in various aspect
domains in this file.
3. Use org.jboss.aop.metadata.ThreadMetaData class to associate contextual data with with
the calling Thread.
4. Add the MergeMetaDataInterceptor to the client interceptor chains defined in
ejb3-interceptors-aop.xml. This interceptor must be defined before
InvokeRemoteInterceptor in the interceptor stack definition. What this interceptor will
allow you to do is to pass contextual data you assigned with the ThreadMetaData class over
the wire to the server.
5. The Server-side aspect would do Invocation.getMetaData(key, value) to obtain any
contextual metadata you assigned through ThreadMetaData.
Hope this gives you some hints.
Bill
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4017099#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...