Class CdiConstructorInjector
java.lang.Object
org.jboss.resteasy.cdi.CdiConstructorInjector
- All Implemented Interfaces:
ConstructorInjector
This ConstructorInjector implementation uses CDI's BeanManager to obtain
a contextual instance of a bean.
- Author:
- Jozef Hartinger
-
Constructor Summary
ConstructorDescriptionCdiConstructorInjector
(Type type, jakarta.enterprise.inject.spi.BeanManager manager) -
Method Summary
Modifier and TypeMethodDescriptionconstruct
(boolean unwrapAsync) Construct outside the scope of an HTTP request.construct
(HttpRequest request, HttpResponse response, boolean unwrapAsync) Construct inside the scope of an HTTP request.injectableArguments
(boolean unwrapAsync) Create an arguments list from injectable tings outside the scope of an HTTP request.injectableArguments
(HttpRequest request, HttpResponse response, boolean unwrapAsync) Create an argument list inside the scope of an HTTP request.
-
Constructor Details
-
CdiConstructorInjector
-
-
Method Details
-
construct
Description copied from interface:ConstructorInjector
Construct outside the scope of an HTTP request. Useful for singleton factories.- Specified by:
construct
in interfaceConstructorInjector
- Parameters:
unwrapAsync
- unwrap async- Returns:
- constructed object or a CompletionStage
-
construct
public Object construct(HttpRequest request, HttpResponse response, boolean unwrapAsync) throws Failure, jakarta.ws.rs.WebApplicationException, ApplicationException Description copied from interface:ConstructorInjector
Construct inside the scope of an HTTP request.- Specified by:
construct
in interfaceConstructorInjector
- Parameters:
request
- http requestresponse
- http responseunwrapAsync
- unwrap async- Returns:
- constructed object or a CompletionStage
- Throws:
Failure
- if failure occurredjakarta.ws.rs.WebApplicationException
- if application exception occurredApplicationException
- if application exception occurred
-
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 interfaceConstructorInjector
- Parameters:
unwrapAsync
- unwrap async- Returns:
- array of arguments or a CompletionStageinvalid input: '<'Object[]> if args is async
-
injectableArguments
public Object injectableArguments(HttpRequest request, HttpResponse response, boolean unwrapAsync) 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 interfaceConstructorInjector
- Parameters:
request
- http requestresponse
- http responseunwrapAsync
- unwrap async- Returns:
- array of arguments or a CompletionStageinvalid input: '<'Object[]> if args is async
- Throws:
Failure
- if failure occurred
-