Class SingletonResource
java.lang.Object
org.jboss.resteasy.plugins.server.resourcefactory.SingletonResource
- All Implemented Interfaces:
ResourceFactory
VERY simple implementation that just returns the instance the SingleResource was created with
- Version:
- $Revision: 1 $
- Author:
- Bill Burke
-
Constructor Summary
ConstructorDescriptionSingletonResource
(Object obj) Deprecated.SingletonResource
(Object obj, ResourceClass resourceClass) -
Method Summary
Modifier and TypeMethodDescriptioncreateResource
(HttpRequest request, HttpResponse response, ResteasyProviderFactory factory) Called per request to obtain a resource instance to invoke http request on.Class
<?> Class to scan for jax-rs annotationsvoid
registered
(ResteasyProviderFactory factory) Callback after registration has been completed.void
requestFinished
(HttpRequest request, HttpResponse response, Object resource) Callback when request is finished.void
-
Constructor Details
-
SingletonResource
Deprecated. -
SingletonResource
-
-
Method Details
-
registered
Description copied from interface:ResourceFactory
Callback after registration has been completed.- Specified by:
registered
in interfaceResourceFactory
- Parameters:
factory
- allows singleton factories to pre-inject things like @Context references into the singleton instance
-
createResource
public Object createResource(HttpRequest request, HttpResponse response, ResteasyProviderFactory factory) Description copied from interface:ResourceFactory
Called per request to obtain a resource instance to invoke http request on.- Specified by:
createResource
in interfaceResourceFactory
- Parameters:
request
- http requestresponse
- http responsefactory
- provider factory- Returns:
- resource object or a CompletionStage
-
unregistered
public void unregistered()- Specified by:
unregistered
in interfaceResourceFactory
-
getScannableClass
Description copied from interface:ResourceFactory
Class to scan for jax-rs annotations- Specified by:
getScannableClass
in interfaceResourceFactory
- Returns:
- class
-
requestFinished
Description copied from interface:ResourceFactory
Callback when request is finished. usable for things like @PreDestroy if the underlying factory supports it- Specified by:
requestFinished
in interfaceResourceFactory
- Parameters:
request
- http requestresponse
- http responseresource
- resource
-
traceInfo
-