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 for
InjectionTarget
that implements the functionality of injecting using JAX-RS annotations into provided
instances. Delegate
is a original InjectionTarget
which is able to inject other fields/parameters which
are managed by CDI.
Implementation is also able create with custom jerseyConstructor
if it is provided. This functionality allows override
default instantiator and use the Jersey-specific one.
- Author:
- Petr Bouda
-
Field Summary
Fields inherited from class org.jboss.weld.injection.producer.BasicInjectionTarget
beanManager
-
Constructor Summary
ConstructorDescriptionJerseyInjectionTarget
(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 target
and 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 target
and 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 target
and inject the fields that are Jersey-specific. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
jakarta.enterprise.inject.spi.Bean<T>
getBean()
org.jboss.weld.annotated.enhanced.EnhancedAnnotatedType<T>
void
initializeAfterBeanDiscovery
(org.jboss.weld.annotated.enhanced.EnhancedAnnotatedType<T> annotatedType) Copied method from the parent class because of a custom type ofInstantiator
is used in this implementation.void
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.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
Methods inherited from class org.jboss.weld.injection.producer.AbstractProducer
equals, hashCode
-
Constructor Details
-
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 target
and 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 target
and 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 target
and inject the fields that are Jersey-specific. This method accepts custom instantiator, if the instantiator isnull
default 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 Details
-
checkDelegateInjectionPoints
protected void checkDelegateInjectionPoints()- Overrides:
checkDelegateInjectionPoints
in classorg.jboss.weld.injection.producer.AbstractProducer<T>
-
inject
-
initializeAfterBeanDiscovery
public void initializeAfterBeanDiscovery(org.jboss.weld.annotated.enhanced.EnhancedAnnotatedType<T> annotatedType) Copied method from the parent class because of a custom type ofInstantiator
is used in this implementation.- Overrides:
initializeAfterBeanDiscovery
in classorg.jboss.weld.injection.producer.BasicInjectionTarget<T>
- Parameters:
annotatedType
- processed class.
-
getBean
- Overrides:
getBean
in 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
-