Package org.jboss.resteasy.spi
Interface ResourceFactory
- All Known Implementing Classes:
JndiComponentResourceFactory
,JndiResourceFactory
,POJOResourceFactory
,SingletonResource
,VertxResourceFactory
public interface ResourceFactory
Implementations of this interface are registered through the Registry class.
- Version:
- $Revision: 1 $
- Author:
- Bill Burke
-
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
-
Method Details
-
getScannableClass
Class<?> getScannableClass()Class to scan for jax-rs annotations- Returns:
- class
-
registered
Callback after registration has been completed.- Parameters:
factory
- allows singleton factories to pre-inject things like @Context references into the singleton instance
-
createResource
Called per request to obtain a resource instance to invoke http request on.- Parameters:
request
- http requestresponse
- http responsefactory
- provider factory- Returns:
- resource object or a CompletionStage
-
requestFinished
Callback when request is finished. usable for things like @PreDestroy if the underlying factory supports it- Parameters:
request
- http requestresponse
- http responseresource
- resource
-
unregistered
void unregistered()
-