Hi All,

i am trying to use camel in my spring based  web-application here is the
entries from my web.xml

 <?xml version="1.0" encoding="UTF-8"?>
    <web-app version="2.4">
    <servlet>
        <servlet-name>dispatcher</servlet-name>
        <servlet-class>
            org.springframework.web.servlet.DispatcherServlet
        </servlet-class>
        <load-on-startup>2</load-on-startup>
    </servlet>
<listener>

<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
  </listener>

    <servlet-mapping>
        <servlet-name>dispatcher</servlet-name>
        <url-pattern>*.*</url-pattern>
    </servlet-mapping>
</web-app>
my applicationContext.xml file is something like this

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans";
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
       xmlns:context="http://www.springframework.org/schema/context";
       xsi:schemaLocation="
       http://www.springframework.org/schema/beans
       http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
       http://www.springframework.org/schema/context
       http://www.springframework.org/schema/context/spring-context-2.5.xsd
       http://camel.apache.org/schema/spring
       http://camel.apache.org/schema/spring/camel-spring.xsd";>
  <camelContext xmlns="http://camel.apache.org/schema/spring";>
    <route>
      <from uri="seda:foo"/>
      <to uri="mock:results"/>
    </route>
  </camelContext>
</beans>

when i am starting my application it is showing that camel context has been
started and it has detected one route,now i want to execute a process where
camel should read this route and than start
process and complete the route as per configuration.But i am not sure how
can i get regrence of the camel context since if i create a new instance of
camelContext inside my java class
that means i am creating a new context and not the one i initiated using
spring,can any one suggest me a way to do it so that i can get refrence of
the existing camelContext being created by the Spring
so that i can take advantage of it.
Thanks in advance

Reply via email to