Dnia Tue, 01 Nov 2005 19:11:06 -0500, Raman Gupta napisaĆ(a): > Guillaume Nodet wrote: > >> Raman Gupta wrote: > >> > >> Hi, is there a way to start/stop a JCAConnector at runtime? > > > > The only way to stop a connector in jca, afaik, is to activate / > > deactivate the endpoint. This is what is done when you create / > > detroy a JCAConnector. This object is light weight, and you should > > create / destroy them when needed. > > Normally this would be fine, but my JCAConnector's are created by Spring > as singletons when the application context loads. So it would be nice to > be able to active/deactive the endpoint by calling methods on the connector. > > I'll also investigate the use of a factory bean to create JCAConnector's > on demand... >
Maybe it's not exactly the same use case, but it may be helpful.. I solved the problem by exporting JCAConnector as JMX bean (via Spring MBeanExporter). I can call destroy() method which deactivates endpoint and afterPropertiesSet() method which activates it. However, I had to modify ActiveMQResourceAdapter class (I'm using AMQ 3.1), because I was unable to activate previously deactivated endpoint - there is a workers map which wasn't cleaned after deactivation. Regards Bartek
