camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claus Ibsen <claus.ib...@gmail.com>
Subject Re: Can we retrieve an endpoint using the id ?
Date Fri, 26 Jun 2009 15:53:27 GMT
Try to let your POJO implements CamelContextAware

We could like how Camel binds to Exchange, TypeConverter do the same
for Registry so you just define one parameter as Registry
public String doSomething(String body, Registry registry)

And the same for CamelContext
public String doSomething(String body, CamelContext context)



On Fri, Jun 26, 2009 at 5:33 PM, Charles Moulliard<cmoulliard@gmail.com> wrote:
> Thx.
>
> Can a java POJO/Bean obtain the camel context without using the exchange
> (exchange.getContext()) object ?
>
> Charles Moulliard
> Senior Enterprise Architect
> Apache Camel Committer
>
> *****************************
> blog : http://cmoulliard.blogspot.com
>
>
> On Fri, Jun 26, 2009 at 5:26 PM, Claus Ibsen <claus.ibsen@gmail.com> wrote:
>
>> context.getRegistry().lookup("myBeanId", Endpoint.class);
>>
>> Will lookup in the spring application context, and AFAIR the
>> <endpoint> tag will register it as a spring bean also.
>>
>>
>> On Fri, Jun 26, 2009 at 5:23 PM, Charles Moulliard<cmoulliard@gmail.com>
>> wrote:
>> > How can I get the SpringCamelBuilder in a POJO.
>> >
>> > Regards,
>> >
>> > Charles Moulliard
>> > Senior Enterprise Architect
>> > Apache Camel Committer
>> >
>> > *****************************
>> > blog : http://cmoulliard.blogspot.com
>> >
>> >
>> > On Fri, Jun 26, 2009 at 3:50 PM, Willem Jiang <willem.jiang@gmail.com
>> >wrote:
>> >
>> >> Hi Charles,
>> >>
>> >> SpringCamelBuilder has a method to look up the bean's instance from the
>> >> application context.
>> >>
>> >> Object bean(String beanName) in camel 1.x branch
>> >>
>> >> <T> T lookup(String String beanName, Class<T> type) in camel
trunk
>> >>
>> >> So I think you should have no trouble to do this job :)
>> >>
>> >> Willem
>> >>
>> >>
>> >> Charles Moulliard wrote:
>> >> > hi,
>> >> >
>> >> > Can we retrieve an endpoint using the id defined in a Spring XML file?
>> >> >
>> >> > <camel:endpoint id="QuickFixStreamEndpoint" uri="#{uriQuickFixStream}"
>> />
>> >> >
>> >> > idea : exchange.getcontext().getEndpointId()
>> >> >
>> >> > Regards,
>> >> >
>> >> > Charles Moulliard
>> >> > Senior Enterprise Architect
>> >> > Apache Camel Committer
>> >> >
>> >> > *****************************
>> >> > blog : http://cmoulliard.blogspot.com
>> >> >
>> >>
>> >>
>> >
>>
>>
>>
>> --
>> Claus Ibsen
>> Apache Camel Committer
>>
>> Open Source Integration: http://fusesource.com
>> Blog: http://davsclaus.blogspot.com/
>> Twitter: http://twitter.com/davsclaus
>>
>



-- 
Claus Ibsen
Apache Camel Committer

Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus

Mime
View raw message