camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From techybolek <techy_bo...@yahoo.com>
Subject Camel OSGI: how do I get the spring application context?
Date Thu, 15 May 2014 02:04:41 GMT
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.

Mime
View raw message