Bean Scanning

Pax CDI builds a CDI container for each bean bundle, using a bean scanner to find candidate classes for managed beans. A candidate class may be discarded by the CDI implementation if the given class does not satisfy all requirements for a managed bean (e.g. a default constructor and no final methods, among others).

The bean scanner does not actually load any classes. It only scans entries of the bean bundle and any other bundles wired to the given bean bundle (using Bundle.findEntries()) . The following locations are scanned in the given order:

  • The bundle classpath, including embedded directories and archives.
  • Each imported package, if the bundle providing the package is a bean bundle.
  • Each required bundle, if the required bundle is a bean bundle.
  • Each bundle providing a required CDI extension, if the providing bundle is a bean bundle.