org.jboss.resteasy.cdi
Class CdiConstructorInjector

java.lang.Object
  extended by org.jboss.resteasy.cdi.CdiConstructorInjector
All Implemented Interfaces:
ConstructorInjector

public class CdiConstructorInjector
extends java.lang.Object
implements ConstructorInjector

This ConstructorInjector implementation uses CDI's BeanManager to obtain a contextual instance of a bean.

Author:
Jozef Hartinger

Constructor Summary
CdiConstructorInjector(java.lang.Class<?> clazz, javax.enterprise.inject.spi.BeanManager manager)
           
 
Method Summary
 java.lang.Object construct()
          construct outside the scope of an HTTP request.
 java.lang.Object construct(HttpRequest request, HttpResponse response)
          construct inside the scope of an HTTP request.
 java.lang.Object[] injectableArguments()
          Create an arguments list from injectable tings outside the scope of an HTTP request.
 java.lang.Object[] injectableArguments(HttpRequest request, HttpResponse response)
          Create an argument list inside the scope of an HTTP request.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CdiConstructorInjector

public CdiConstructorInjector(java.lang.Class<?> clazz,
                              javax.enterprise.inject.spi.BeanManager manager)
Method Detail

construct

public java.lang.Object construct()
Description copied from interface: ConstructorInjector
construct outside the scope of an HTTP request. Useful for singleton factories

Specified by:
construct in interface ConstructorInjector
Returns:

construct

public java.lang.Object construct(HttpRequest request,
                                  HttpResponse response)
                           throws Failure,
                                  WebApplicationException,
                                  ApplicationException
Description copied from interface: ConstructorInjector
construct inside the scope of an HTTP request.

Specified by:
construct in interface ConstructorInjector
Returns:
Throws:
Failure
WebApplicationException
ApplicationException

injectableArguments

public java.lang.Object[] injectableArguments()
Description copied from interface: ConstructorInjector
Create an arguments list from injectable tings outside the scope of an HTTP request. Useful for singleton factories in cases where the resource factory wants to allocate the object itself, but wants resteasy to populate the arguments

Specified by:
injectableArguments in interface ConstructorInjector
Returns:

injectableArguments

public java.lang.Object[] injectableArguments(HttpRequest request,
                                              HttpResponse response)
                                       throws Failure
Description copied from interface: ConstructorInjector
Create an argument list inside the scope of an HTTP request. Useful in cases where the resource factory wants to allocate the object itself, but wants resteasy to populate the arguments

Specified by:
injectableArguments in interface ConstructorInjector
Returns:
Throws:
Failure


Copyright © 2010. All Rights Reserved.