Class JerseyInjectionTarget<T>
- java.lang.Object
-
- org.jboss.weld.injection.producer.AbstractProducer<T>
-
- org.jboss.weld.injection.producer.BasicInjectionTarget<T>
-
- org.glassfish.jersey.inject.cdi.se.injector.JerseyInjectionTarget<T>
-
- All Implemented Interfaces:
jakarta.enterprise.inject.spi.InjectionTarget<T>,jakarta.enterprise.inject.spi.Producer<T>,org.jboss.weld.manager.api.WeldInjectionTarget<T>
public class JerseyInjectionTarget<T> extends org.jboss.weld.injection.producer.BasicInjectionTarget<T>Wrapper forInjectionTargetthat implements the functionality of injecting using JAX-RS annotations into provided instances.Delegateis a originalInjectionTargetwhich is able to inject other fields/parameters which are managed by CDI.Implementation is also able create with custom
jerseyConstructorif it is provided. This functionality allows override default instantiator and use the Jersey-specific one.- Author:
- Petr Bouda
-
-
Constructor Summary
Constructors Constructor Description JerseyInjectionTarget(org.jboss.weld.annotated.enhanced.EnhancedAnnotatedType<T> annotatedType, org.jboss.weld.injection.producer.BasicInjectionTarget<T> delegate, jakarta.enterprise.inject.spi.Bean<T> bean, Class<T> clazz, Collection<org.glassfish.jersey.internal.inject.InjectionResolver> resolvers, org.jboss.weld.injection.producer.Instantiator<T> instantiator)Creates a new injection target which is able to delegate an injection todelegate injection targetand inject the fields that are Jersey-specific.JerseyInjectionTarget(org.jboss.weld.injection.producer.BasicInjectionTarget<T> delegate, jakarta.enterprise.inject.spi.Bean<T> bean, Class<T> clazz, Collection<org.glassfish.jersey.internal.inject.InjectionResolver> resolvers)Creates a new injection target which is able to delegate an injection todelegate injection targetand inject the fields that are Jersey-specific.JerseyInjectionTarget(org.jboss.weld.injection.producer.BasicInjectionTarget<T> delegate, Class<T> clazz)Creates a new injection target which is able to delegate an injection todelegate injection targetand inject the fields that are Jersey-specific.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidcheckDelegateInjectionPoints()jakarta.enterprise.inject.spi.Bean<T>getBean()org.jboss.weld.annotated.enhanced.EnhancedAnnotatedType<T>getEnhancedAnnotatedType()voidinitializeAfterBeanDiscovery(org.jboss.weld.annotated.enhanced.EnhancedAnnotatedType<T> annotatedType)Copied method from the parent class because of a custom type ofInstantiatoris used in this implementation.voidinject(T instance, jakarta.enterprise.context.spi.CreationalContext<T> ctx)voidsetInjectionResolvers(Collection<org.glassfish.jersey.internal.inject.InjectionResolver> resolvers)In some cases Injection Resolvers cannot be provided during th creation of the object therefore must be set later on.-
Methods inherited from class org.jboss.weld.injection.producer.BasicInjectionTarget
checkType, create, createDefault, createNonCdiInterceptor, dispose, getAnnotated, getAnnotatedType, getBeanManager, getInjectionPoints, getInjector, getInstantiator, getLifecycleCallbackInvoker, getType, hasDecorators, hasInterceptors, initInstantiator, postConstruct, preDestroy, produce, setInstantiator, toString
-
-
-
-
Constructor Detail
-
JerseyInjectionTarget
public JerseyInjectionTarget(org.jboss.weld.injection.producer.BasicInjectionTarget<T> delegate, Class<T> clazz)
Creates a new injection target which is able to delegate an injection todelegate injection targetand inject the fields that are Jersey-specific. The resolvers must be set later on. CDI will select its own constructor.- Parameters:
delegate- CDI specific injection target.clazz- class that will be scanned and injected.
-
JerseyInjectionTarget
public JerseyInjectionTarget(org.jboss.weld.injection.producer.BasicInjectionTarget<T> delegate, jakarta.enterprise.inject.spi.Bean<T> bean, Class<T> clazz, Collection<org.glassfish.jersey.internal.inject.InjectionResolver> resolvers)
Creates a new injection target which is able to delegate an injection todelegate injection targetand inject the fields that are Jersey-specific. CDI will select its own constructor.- Parameters:
delegate- CDI specific injection target.bean- bean which this injection target belongs to.clazz- class that will be scanned and injected.resolvers- all resolvers that can provide a valued for Jersey-specific injection.
-
JerseyInjectionTarget
public JerseyInjectionTarget(org.jboss.weld.annotated.enhanced.EnhancedAnnotatedType<T> annotatedType, org.jboss.weld.injection.producer.BasicInjectionTarget<T> delegate, jakarta.enterprise.inject.spi.Bean<T> bean, Class<T> clazz, Collection<org.glassfish.jersey.internal.inject.InjectionResolver> resolvers, org.jboss.weld.injection.producer.Instantiator<T> instantiator)
Creates a new injection target which is able to delegate an injection todelegate injection targetand inject the fields that are Jersey-specific. This method accepts custom instantiator, if the instantiator isnulldefault one is created.- Parameters:
annotatedType- resolved type of the registered bean.delegate- CDI specific injection target.bean- bean which this injection target belongs to.clazz- class that will be scanned and injected.resolvers- all resolvers that can provide a valued for Jersey-specific injection.instantiator- default instantiator.
-
-
Method Detail
-
checkDelegateInjectionPoints
protected void checkDelegateInjectionPoints()
- Overrides:
checkDelegateInjectionPointsin classorg.jboss.weld.injection.producer.AbstractProducer<T>
-
initializeAfterBeanDiscovery
public void initializeAfterBeanDiscovery(org.jboss.weld.annotated.enhanced.EnhancedAnnotatedType<T> annotatedType)
Copied method from the parent class because of a custom type ofInstantiatoris used in this implementation.- Overrides:
initializeAfterBeanDiscoveryin classorg.jboss.weld.injection.producer.BasicInjectionTarget<T>- Parameters:
annotatedType- processed class.
-
getBean
public jakarta.enterprise.inject.spi.Bean<T> getBean()
- Overrides:
getBeanin classorg.jboss.weld.injection.producer.BasicInjectionTarget<T>
-
setInjectionResolvers
public void setInjectionResolvers(Collection<org.glassfish.jersey.internal.inject.InjectionResolver> resolvers)
In some cases Injection Resolvers cannot be provided during th creation of the object therefore must be set later on.- Parameters:
resolvers- all registered injection resolvers.
-
getEnhancedAnnotatedType
public org.jboss.weld.annotated.enhanced.EnhancedAnnotatedType<T> getEnhancedAnnotatedType()
-
-