Ive been trying to come up with a good strategy for making facilities coded in our own jboss mbean services available to the EJBs. I first used the RMI route, exporting remote objects and binding stubs in JNDI, works fine (though performance sucked) until you cycle the service, you end up with CCEs. Then I tried ObjectFactory route similar to transaction manager and others in jboss,.. performance problem solved however cycling didnt effect access to the new service, for some reason jboss jndi kept creating instances using the original object factory class. finally i tried the jmx route (concerned about the performance here though I havent measured it), looking up services through the mbeanserver and the jmx bus,... back to the CCEs on cycling. the last thing i can think of doing is to implement my own detatched invoker mechanism, whereby the stubs i register in jndi are attached to my own invocation service that routes the calls via jmx to the target service,.. i think this will solve the CCEs but geez its a lot of infrastructure that im not sure will be performant. Does anyone have any ideas on how I can solve the problems in any of these approaches? is it too much to expect to be able to cycle services in this way?
In jboss.xml add your:service=blah
to the ejb.
The ejb will recycle with the MBean.