On Tue, May 22, 2012 at 9:58 AM, cgiera <christoph.gi...@mic-cust.com> wrote:
>
> Willem.Jiang wrote
>>
>> What's the problem ?
>> I don't think passing the bean object instance will introduce any
>> further issue into camel-jms and camel-jpa components.
>>
>
> Perhaps I don't understand you correctly, but if i pass the object instance
> like
>
> I get problems with our whole implementation because the beans are only
> instantiated once.
>
> kind regards,
> Christoph
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/ClassCastException-using-cxf-bean-tp5599810p5713307.html
> Sent from the Camel - Users mailing list archive at Nabble.com.

When using .bean in the DSL, then the bean is looked up / created once
/ etc when the route is being initialized / started.
And thus there is no thread safe issue at runtime, as the beans is
already created.

When using bean with a class type, the bean is created once (eg
singleton scope).
And that is by design.

If you want prototype scope or something like that, then use a beanRef
and refer to a bean in a bean container that supports that such as
spring etc.


-- 
Claus Ibsen
-----------------
CamelOne 2012 Conference, May 15-16, 2012: http://camelone.com
FuseSource
Email: cib...@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/

Reply via email to