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: PropertyInject in a standard class
Date Thu, 11 Aug 2016 13:24:52 GMT
The class/bean has to be created from the IoC framework you use such
as spring / cdi / guice / etc. Or standalone Camel.
If you create it manually using new XXX then there is no dependency injection.

On Thu, Aug 11, 2016 at 3:21 PM, souciance
<souciance.eqdam.rashti@gmail.com> wrote:
> Hello,
>
> Does Camel's @PropertyInject annotation work in a standard java class? Say,
> you want to define a utility class and you define some private variables and
> use that annotation to inject some environment variables using
> @PropertyInject("{{env:hostname}}"). Then you have some method as a public
> interface in order to refer to them from outside the class.
>
> So far I only get null values.
>
> If I do the some injection from inside a RouteBuilder class it works.
>
> Best
> Souciance
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/PropertyInject-in-a-standard-class-tp5786317.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2

Mime
View raw message