You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Application getClasses() and getSingletons() return the classes and instances used by the application. Should they not be registered, they would not be used by the application.
However, in the CDI, should the providers be CDI beans, no matter whether they are registered or not, they are known to CDI.
Hence, getting all providers from CDI will include them.
The questions:
Should the CDI bean providers be included just when registered in the Application? Or is it ok to have the provider be a bean and it no longer needs to be registered (using the META-INF/services/jakarta.ws.rs.core.Feature for instance)?
If so, does it matter that the behaviour could be potentially different in the CDI-managed environment and non-cdi env using the non-cdi injection?
The text was updated successfully, but these errors were encountered:
This is a good question and is relevant to both 3.2 and 4.0.
The Application.getSingletons() is deprecated which helps us out a bit. We can't really use CDI for anything returned from this method as it returns already instantiated objects.
For Application.getClasses(), I think those should be usable in that you could use the BeanManager to lookup those types.
With regards to the service loading, that's a great question. Without creating some kind of custom ServiceLoader which returns only class types, there really isn't a good way to make those providers a CDI bean. Therefore, IMO, we should state anything loaded from a service loader will not work with CDI. Not sure on the exact wording we should use though.
That said, from an implementation point of view, I could see creating a service loader which registers those as CDI beans in an CDI extension.
Application getClasses() and getSingletons() return the classes and instances used by the application. Should they not be registered, they would not be used by the application.
However, in the CDI, should the providers be CDI beans, no matter whether they are registered or not, they are known to CDI.
Hence, getting all providers from CDI will include them.
The questions:
The text was updated successfully, but these errors were encountered: