You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by techybolek <te...@yahoo.com> on 2014/05/15 04:04:41 UTC

Camel OSGI: how do I get the spring application context?

Below is a snippet from the camle-osgi example. I can obtain the camel
context but how do I get the original spring application context? Or how am
I supposed to get a reference to "mybean"?

MyRouteBuilder.java:

    public class MyRouteBuilder extends RouteBuilder {
      public static void main(String[] args) throws Exception{
        new Main().run(args);
      }

      public void configure() {
        // set up the transform bean
        ModelCamelContext mc = getContext();//ok, I can get the camel
context fine
        //but how to get the spring context to get to "mybean"???
        
        //set up routes
      }
    }

beans.xml:

    <beans>
     <camel:camelContext xmlns="http://camel.apache.org/schema/spring">
        <package>org.apache.servicemix.examples.camel</package>
                  -----
     </route>
     </camel:camelContext>

     <bean id="mybean" class="myclass"/>

    </beans>




--
View this message in context: http://camel.465427.n5.nabble.com/Camel-OSGI-how-do-I-get-the-spring-application-context-tp5751145.html
Sent from the Camel - Users mailing list archive at Nabble.com.