org.jboss.resteasy.cdi
Class ResteasyCdiExtension
java.lang.Object
org.jboss.resteasy.cdi.ResteasyCdiExtension
- All Implemented Interfaces:
- javax.enterprise.inject.spi.Extension
public class ResteasyCdiExtension
- extends java.lang.Object
- implements javax.enterprise.inject.spi.Extension
This Extension handles default scopes for discovered JAX-RS components. It also observes ProcessInjectionTarget
event and wraps InjectionTargets representing JAX-RS components within JaxrsInjectionTarget. Furthermore, it builds
the sessionBeanInterface map which maps Session Bean classes to a local interface. This map is used in CdiInjectorFactory
during lookup of Sesion Bean JAX-RS components.
- Author:
- Jozef Hartinger
Method Summary |
java.util.Map<java.lang.Class<?>,java.lang.Class<?>> |
getSessionBeanInterface()
|
|
observeInjectionTarget(javax.enterprise.inject.spi.ProcessInjectionTarget<T> event)
Wrap InjectionTarget of JAX-RS components within JaxrsInjectionTarget which
takes care of JAX-RS property injection. |
|
observeResources(javax.enterprise.inject.spi.ProcessAnnotatedType<T> event)
Set a default scope for each CDI bean which is a JAX-RS Resource,
Provider or Application subclass. |
|
observeSessionBeans(javax.enterprise.inject.spi.ProcessSessionBean<T> event)
Observes ProcessSessionBean events and creates a (Bean class -> Local interface) map for
Session beans with local interfaces. |
protected
<T> javax.enterprise.inject.spi.AnnotatedType<T> |
|
wrapAnnotatedType(javax.enterprise.inject.spi.AnnotatedType<T> type,
java.lang.annotation.Annotation scope)
|
protected
<T> javax.enterprise.inject.spi.InjectionTarget<T> |
|
wrapInjectionTarget(javax.enterprise.inject.spi.ProcessInjectionTarget<T> event)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
requestScopedLiteral
public static final java.lang.annotation.Annotation requestScopedLiteral
applicationScopedLiteral
public static final java.lang.annotation.Annotation applicationScopedLiteral
ResteasyCdiExtension
public ResteasyCdiExtension()
observeResources
public <T> void observeResources(@Observes
javax.enterprise.inject.spi.ProcessAnnotatedType<T> event)
- Set a default scope for each CDI bean which is a JAX-RS Resource,
Provider or Application subclass.
wrapAnnotatedType
protected <T> javax.enterprise.inject.spi.AnnotatedType<T> wrapAnnotatedType(javax.enterprise.inject.spi.AnnotatedType<T> type,
java.lang.annotation.Annotation scope)
observeInjectionTarget
public <T> void observeInjectionTarget(@Observes
javax.enterprise.inject.spi.ProcessInjectionTarget<T> event)
- Wrap InjectionTarget of JAX-RS components within JaxrsInjectionTarget which
takes care of JAX-RS property injection.
wrapInjectionTarget
protected <T> javax.enterprise.inject.spi.InjectionTarget<T> wrapInjectionTarget(javax.enterprise.inject.spi.ProcessInjectionTarget<T> event)
observeSessionBeans
public <T> void observeSessionBeans(@Observes
javax.enterprise.inject.spi.ProcessSessionBean<T> event)
- Observes ProcessSessionBean events and creates a (Bean class -> Local interface) map for
Session beans with local interfaces. This map is necessary since RESTEasy identifies a bean
class as JAX-RS components while CDI requires a local interface to be used for lookup.
getSessionBeanInterface
public java.util.Map<java.lang.Class<?>,java.lang.Class<?>> getSessionBeanInterface()
Copyright © 2010. All Rights Reserved.