My spring is a bit rusty and I am struggling to find a way to get the bean factory using scala inside a Lift app and yes once I get that then I can get the template bean as you suggest.
-- Ewan James.Strachan wrote: > > 2009/5/22 EwanH <[email protected]>: >> >> How does one get a reference to the camelcontext > > If your bean implements CamelContextAware it will be injected into you > > >> when using a spring >> ContextLoaderListener set in web.xml that configures a RouteBuilder using >> package scanning? Below I have context that on start seems to boot up >> fine: >> >> <camelContext xmlns="http://activemq.apache.org/camel/schema/spring"> >> <package>myapp.routes</package> >> </camelContext> >> >> However I now want to create a ProducerTemplate from the context which I >> was >> hoping would be via a factory method but can't find one. Any ideas? > > You should be able to just have one automatically injected into your > class for you by using the @Produces annotation... > http://camel.apache.org/pojo-producing.html > > or just create a producer template using the <template> element > > <camelContext xmlns="http://activemq.apache.org/camel/schema/spring"> > <package>myapp.routes</package> > <template id="myTemplate"/> > </camelContext> > > then look it up in Spring by id. > > > My preferred approach is to have spring inject whatever it is you want > (e.g. the ProducerTemplate) using the @Produces annotation. > > -- > James > ------- > http://macstrac.blogspot.com/ > > Open Source Integration > http://fusesource.com/ > > -- View this message in context: http://www.nabble.com/Scala-and-Spring-config-tp23667388p23668108.html Sent from the Camel - Users mailing list archive at Nabble.com.
