Class JaxrsInjectionTarget<T>

java.lang.Object
org.jboss.resteasy.cdi.JaxrsInjectionTarget<T>
All Implemented Interfaces:
jakarta.enterprise.inject.spi.InjectionTarget<T>, jakarta.enterprise.inject.spi.Producer<T>

@Deprecated(forRemoval=true, since="7.0.3") public class JaxrsInjectionTarget<T> extends Object implements jakarta.enterprise.inject.spi.InjectionTarget<T>
Deprecated, for removal: This API element is subject to removal in a future version.
this should not be used outside of this module and may be removed in a future release
An InjectionTarget wrapper for Jakarta REST components that performs property injection and validation after CDI injection.

For components not managed by CDI (e.g. EJB session beans), property injection via PropertyInjectorImpl is used to populate @Context and @*Param-annotated fields. For CDI-managed components (those registered in the ResteasyCdiExtension.beanContainer), property injection is skipped since CDI handles field injection directly through producers.

Validation is performed for all root resource classes after injection, using a GeneralValidatorCDI resolved from a ContextResolver. If the class has a @PostConstruct method, validation is deferred to the postConstruct(Object) phase.

Author:
Jozef Hartinger, James R. Perkins
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
     
    JaxrsInjectionTarget(jakarta.enterprise.inject.spi.InjectionTarget<T> delegate, Class<T> clazz)
    Deprecated, for removal: This API element is subject to removal in a future version.
    this should not be used outside of this module
    protected
    JaxrsInjectionTarget(jakarta.enterprise.inject.spi.InjectionTarget<T> delegate, Class<T> clazz, boolean usePropertyInjector)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Creates a new wrapped InjectionTarget for custom RESTEasy bean validation and optional property inject.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    dispose(T instance)
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    Set<jakarta.enterprise.inject.spi.InjectionPoint>
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    void
    inject(T instance, jakarta.enterprise.context.spi.CreationalContext<T> ctx)
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    void
    postConstruct(T instance)
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    void
    preDestroy(T instance)
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    produce(jakarta.enterprise.context.spi.CreationalContext<T> ctx)
    Deprecated, for removal: This API element is subject to removal in a future version.
     

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • JaxrsInjectionTarget

      @Deprecated(forRemoval=true, since="7.0.3") public JaxrsInjectionTarget(jakarta.enterprise.inject.spi.InjectionTarget<T> delegate, Class<T> clazz)
      Deprecated, for removal: This API element is subject to removal in a future version.
      this should not be used outside of this module
    • JaxrsInjectionTarget

      protected JaxrsInjectionTarget(jakarta.enterprise.inject.spi.InjectionTarget<T> delegate, Class<T> clazz, boolean usePropertyInjector)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Creates a new wrapped InjectionTarget for custom RESTEasy bean validation and optional property inject.

      If the usePropertyInjector is set to true, a new PropertyInjector is used to inject Jakarta REST resources. These could be @Context injection points or the

      invalid @link
      {@link @*Param
      } injection points. For full CDI managed beans, this should typically be false.

      Parameters:
      delegate - the delegate injection target
      clazz - the type of the bean
      usePropertyInjector - true if a PropertyInjector should be used and this is not a fully managed CDI bean, otherwise
      invalid @link
      {@link false
      }
  • Method Details

    • inject

      public void inject(T instance, jakarta.enterprise.context.spi.CreationalContext<T> ctx)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Specified by:
      inject in interface jakarta.enterprise.inject.spi.InjectionTarget<T>
    • postConstruct

      public void postConstruct(T instance)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Specified by:
      postConstruct in interface jakarta.enterprise.inject.spi.InjectionTarget<T>
    • preDestroy

      public void preDestroy(T instance)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Specified by:
      preDestroy in interface jakarta.enterprise.inject.spi.InjectionTarget<T>
    • dispose

      public void dispose(T instance)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Specified by:
      dispose in interface jakarta.enterprise.inject.spi.Producer<T>
    • getInjectionPoints

      public Set<jakarta.enterprise.inject.spi.InjectionPoint> getInjectionPoints()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Specified by:
      getInjectionPoints in interface jakarta.enterprise.inject.spi.Producer<T>
    • produce

      public T produce(jakarta.enterprise.context.spi.CreationalContext<T> ctx)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Specified by:
      produce in interface jakarta.enterprise.inject.spi.Producer<T>