2012-10-13

Java Connector Architecture (JCA) 1.6 and CDI on Glassfish 3.1

Context and Dependency Injection (CDI) is different if used in a Java Connector Architecture (JCA) 1.6 Resource Adapter.
If there is a beans.xml in the META-INF directory of a resource adapter (RAR), the beans.xml file is read and the resource adapter is recognized as a CDI module correctly.
This way CDI can be used for all beans inside the resource adapter.

But remember:
However it is not possible to inject CDI bean classes contained in a resource adapter RAR into other web applications or EJBs.