[ 
https://issues.apache.org/jira/browse/CXF-5576?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13949237#comment-13949237
 ] 

Andriy Redko commented on CXF-5576:
-----------------------------------

Hi Sergey,

Sorry, now I am  confused :)  

The managed beans 
(http://docs.oracle.com/javaee/6/tutorial/doc/bnawq.html#bnawr) is part of JSF 
/ JSR-316.   We may definitely look into it but it is not a part of core CDI. 
What I was actually trying to finalize is the usage of Application class as the 
single entry point of the application (we have touched it a bit as part of 
zero-config). 

Let me give you an example:
{noformat}
@ApplicationPath( "/myapp" )
public MyApplication extends Application {
     @Inject private JsonProvider provider;
     @Inject private JaxRsResource resource;

     public Set<?> getSingletons() {
         return [ provider, resource, new ExceptionMapper(), new Feature(), ... 
] 
     }    

     public Map< ?, ? > getPoperties() {
        // return some properties to be passed to factory bean
     }
}
{noformat}
And that's basically it. Benefits: all dependencies are wired up, users can 
define own features, providers, services, properties ... Our CDI extension 
takes this and bootstrap the JAXRSServerFactoryBean without users to notice 
that.  Do you think it has sense?

Thanks.
Andriy



> Initital support for CDI integration
> ------------------------------------
>
>                 Key: CXF-5576
>                 URL: https://issues.apache.org/jira/browse/CXF-5576
>             Project: CXF
>          Issue Type: Improvement
>          Components: Core
>    Affects Versions: 3.0.0
>            Reporter: Andriy Redko
>            Assignee: Andriy Redko
>              Labels: cdi
>         Attachments: weld-one-jar.zip, weld-one-war.zip
>
>
> A per section 10.2.3 Context and Dependency Injection (CDI) of JAX-RS 2.0 
> specification, in a product that supports CDI, the implementations MUST 
> support the use of CDI-style Beans as root resource classes, providers and 
> Application subclasses. Providers and Application subclasses MUST be 
> singletons or use application scope.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to