Alexander Pakhunov wrote:
Is it possible to add remoting-ejb-receiver at runtime (e.g. using jboss-ejb-client api http://docs.jboss.org/ejbclient/1.0.5.Final/, using code similar to one in DescriptorBasedEJBClientContextService)?
Yes it is possible. Once you create the remoting connection (with the appropriate remoting APIs) within your application, you can register it as a receiver within the EJB client context as follows:
// this will return the EJB client context that's applicable for your application final EJBClientContext ejbClientContext = EJBClientContext.requireCurrent(); // let's assume you have create a connection dynamically. Let's now add it to the EJB client context so that it gets registered as a receiver ejbClientContext.registerConnection(connectionThatYouCreated);
That's one way of doing it.
Thank you for your answer. It helped a lot, I made it work. I grabbed a piece of code from ConfigBasedEJBClientContextSelector.setupEJBReceivers to initialize connection and registered this connection in
EJBClientContext.requireCurrent()as you suggested.
Could you please provide me pointers on how to create remoting connections from inside my application ? Which are these remoting APIs that I can use to add remote-outboud-connections programmatically ?
Thanks in advance.