5 Replies Latest reply on Sep 23, 2010 1:43 PM by Claus Ibsen

    CamelContext and OsgiBundleXmlApplicationContext and clean-up/stop

    Peter Chandler Master

      For OSGi Activator.start() I do a:

      OsgiBundleXmlApplicationContext applicationContext = new OsgiBundleXmlApplicationContext(aSpringCamelContextFile);
      applicationContext.setBundleContext(bundleContext);
      applicationContext.setPublishContextAsService(false);
      applicationContext.refresh();
      

       

      For OSGi Activator.stop() I do a:

      applicationContext.stop();
      

       

      My question is, my spring camel context file has components/endpoints that have external references (examples., JMS, JDBC connections). When I call the stop() method on the context how do all the components/endpoints  get notified?  Is there a recursive process, some type of interface to implement, registered listeners?

       

      Additionally, if I create my own camel component how do I get called/invoked when the camel context is stopped?

       

       

      Thanks in advance,

       

      Peter.