Uploaded image for project: 'RESTEasy'
  1. RESTEasy
  2. RESTEASY-388

Extend Providers SPI

XMLWordPrintable

    • Icon: Feature Request Feature Request
    • Resolution: Done
    • Icon: Major Major
    • 2.0-beta-3
    • 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

      {ExceptionMapper, ContextResolver, StringConverter}

      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.

            rhn-engineering-jharting Jozef Hartinger
            rhn-engineering-jharting Jozef Hartinger
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: