-
Feature Request
-
Resolution: Done
-
Major
-
2.0-beta-2
-
None
-
None
-
Release Notes
Currently, there are two types of methods for registering providers in ResteasyProviderFactory:
addXXX(Class<? extends XXX> clazz) // i.e. addExceptionMapper(Class<? extends ExceptionMapper> provider)
addXXX(XXX instance)
I am thinking of adding another method with the following signature
addXXX(XXX instance, Type typeParameter)
where XXX belongs to
and genericType is the type parameter of the specific interface.
This would allow ExceptionMappers, ContextResolvers and StringConverters to be created and registered at runtime. While this might not make sense for all of them, there is definitely a use case for ExceptionMappers for example. Furthermore, this would allow all types of providers to be Seam components. Note that the existing methods would need to refactored to make use of the new one.