camel-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "james strachan (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (CAMEL-5553) support injection of Endpoint and @Produce @Consume annotations
Date Fri, 31 Aug 2012 10:14:07 GMT

     [ https://issues.apache.org/jira/browse/CAMEL-5553?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

james strachan updated CAMEL-5553:
----------------------------------

    Description: 
we don't yet support the various camel annotation injections in CDI yet; we should support
the same capabilities as we have in spring/guice

http://camel.apache.org/bean-integration.html
http://camel.apache.org/bean-injection.html

I guess a more CDI way to do endpoint injection might be to have an annotation for endpointURI
specification. Then you'd either use 

{code}
public class MyBean { 
  // named reference injection
  @Inject @Named("foo") Endpoint bar;

  // URI based injection
  @Inject @Uri("mock:whatnot") MockEndpoint foo;
...
}
{code}
Rather than using the DI-agnostic @EndpointInject annotation - though I guess we could support
it too (though having Inject twice looks a bit icky and not as DRY)...
{code}
public class MyBean { 
  // using current annotation...
  @Inject @EndpointInject(uri = "mock:whatnot") MockEndpoint bar;
...
}
{code}

Things are a bit more clear for @Consume (since using @Inject with it seems odd; its more
like a kind of @Observe annotation than an @Inject).


  was:
we don't yet support the various camel annotation injections in CDI yet; we should support
the same capabilities as we have in spring/guice

http://camel.apache.org/bean-integration.html
http://camel.apache.org/bean-injection.html



    
> support injection of Endpoint and @Produce @Consume annotations
> ---------------------------------------------------------------
>
>                 Key: CAMEL-5553
>                 URL: https://issues.apache.org/jira/browse/CAMEL-5553
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-cdi
>            Reporter: james strachan
>
> we don't yet support the various camel annotation injections in CDI yet; we should support
the same capabilities as we have in spring/guice
> http://camel.apache.org/bean-integration.html
> http://camel.apache.org/bean-injection.html
> I guess a more CDI way to do endpoint injection might be to have an annotation for endpointURI
specification. Then you'd either use 
> {code}
> public class MyBean { 
>   // named reference injection
>   @Inject @Named("foo") Endpoint bar;
>   // URI based injection
>   @Inject @Uri("mock:whatnot") MockEndpoint foo;
> ...
> }
> {code}
> Rather than using the DI-agnostic @EndpointInject annotation - though I guess we could
support it too (though having Inject twice looks a bit icky and not as DRY)...
> {code}
> public class MyBean { 
>   // using current annotation...
>   @Inject @EndpointInject(uri = "mock:whatnot") MockEndpoint bar;
> ...
> }
> {code}
> Things are a bit more clear for @Consume (since using @Inject with it seems odd; its
more like a kind of @Observe annotation than an @Inject).

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message