camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From georgiosgeorgiadis <georgiosgeorgia...@yahoo.co.uk>
Subject Re: Routing to a method of an object with more than one parameters
Date Tue, 04 Mar 2008 13:51:06 GMT

Thanks James, at the end, yes, I decided to do it with the type converter
which gives me more control over what is called and
what is passed around. How I have decided, as these objects that i am using
have multiple methods, is that I pass the methodName in the message's header
as "@method" and with the method parameters passed as an array of objects as
the message body.

The type converter will use reflection to resolve actual method invocations
and propagate correctly and returning correctly.

Thank you very much.

Georgios

James.Strachan wrote:
> 
> On 03/03/2008, georgiosgeorgiadis <georgiosgeorgiadis@yahoo.co.uk> wrote:
>>
>>  Thanks, yes, examples will be nice, cause I have searched around the
>> tests of
>>  camel and all
>>  the objects that are used have only one actual parameter (I am not
>> talking
>>  about the ones that pass also @Header, @Properties etc.). My problem is
>> that
>>  I have an object that i cannot modify (given to me from outside, means
>> third
>>  party class) but I have to make it available on a camel routing via the
>>  bean: or pojo: component.
> 
> Then create a converter to create a custom Processor for invoking your
> bean..
> http://activemq.apache.org/camel/type-converter.html
> 
> @Converter
> public class MyProcessorConverter {
>   @Converter
>   public Processor createAdapter(final MyBeanThatCannotBeModified bean) {
>       return new Processor() { ... }
>    }
> 
> Then you can decide how to convert the message headers/body into
> something that can be invoked on your bean.
> 
> What is sending the message btw?
> 
> -- 
> James
> -------
> http://macstrac.blogspot.com/
> 
> Open Source Integration
> http://open.iona.com
> 
> 

-- 
View this message in context: http://www.nabble.com/Routing-to-a-method-of-an-object-with-more-than-one-parameters-tp15806637s22882p15827487.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Mime
View raw message