Implicit bean archive support

Description

It seems that Pax CDI still supports the CDI 1.0 explicit bean archives only. Implicit bean archive support was added in CDI 1.1. An implicit bean archive is an archive that either:

  • has beans.xml file with `bean-discovery-mode="annotated"` attribute. In such archive only classes annotated with a bean defining annotation (scope, stereotype, etc.) are recognized as beans. Other classes are not recognized as CDI beans. During Weld initialization the list of such classes should be sent to Weld as bean classes using http://docs.jboss.org/weld/javadoc/3.0/weld-spi/org/jboss/weld/bootstrap/spi/BeanDeploymentArchive.html#getBeanClasses--

  • or does not have beans.xml file at all - if classes with bean defining annotations are present this archive is treated as if it had beans.xml with `bean-discovery-mode="annotated"`

http://lists.jboss.org/pipermail/weld-dev/2015-May/003336.html

Environment

None

Activity

Show:
Harald Wellmann
June 7, 2015, 2:45 PM

This is CDI 1.2 and Weld 2.2.x. The Javadoc for this version says

Gets all classes in the bean deployment archive.

http://docs.jboss.org/weld/javadoc/2.2/weld-spi/org/jboss/weld/bootstrap/spi/BeanDeploymentArchive.html#getBeanClasses

Pax CDI delivers all classes, just filtered by OSGi visibility rules.

I don't quite see the point in the 3.0 version - doesn't Weld have to inspect the scope annotations on (candidate) bean classes anyway, so what's the point of expecting the environment to do it?

Antonin Stefanutti
February 17, 2016, 4:16 PM

Note that the current state of the development seems to cause PAXCDI-212.

Assignee

Harald Wellmann

Reporter

Jozef Hartinger

Labels

None

Fix versions

Priority

Major
Configure