Package org.jboss.resteasy.spi
Interface ResourceFactory
-
- All Known Implementing Classes:
GuiceResourceFactory
,JndiComponentResourceFactory
,JndiResourceFactory
,POJOResourceFactory
,SingletonResource
,SpringResourceFactory
,VertxResourceFactory
public interface ResourceFactory
Implementations of this interface are registered through the Registry class.- Version:
- $Revision: 1 $
- Author:
- Bill Burke
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Object
createResource(HttpRequest request, HttpResponse response, ResteasyProviderFactory factory)
Called per request to obtain a resource instance to invoke http request on.Class<?>
getScannableClass()
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
unregistered()
-
-
-
Method Detail
-
getScannableClass
Class<?> getScannableClass()
Class to scan for jax-rs annotations- Returns:
- class
-
registered
void registered(ResteasyProviderFactory factory)
Callback after registration has been completed.- Parameters:
factory
- allows singleton factories to pre-inject things like @Context references into the singleton instance
-
createResource
Object createResource(HttpRequest request, HttpResponse response, ResteasyProviderFactory factory)
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
void requestFinished(HttpRequest request, HttpResponse response, Object resource)
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()
-
-