org.jboss.resteasy.spi
Interface ResourceFactory

All Known Implementing Classes:
GuiceResourceFactory, JndiComponentResourceFactory, JndiResourceFactory, POJOResourceFactory, SingletonResource, SpringResourceFactory

public interface ResourceFactory

Implementations of this interface are registered through the Registry class.

Version:
$Revision: 1 $
Author:
Bill Burke

Method Summary
 java.lang.Object createResource(HttpRequest request, HttpResponse response, InjectorFactory factory)
          Called per request to obtain a resource instance to invoke http request on.
 java.lang.Class<?> getScannableClass()
          Class to scan for jax-rs annotations
 void registered(InjectorFactory factory)
          Callback after registration has been completed.
 void requestFinished(HttpRequest request, HttpResponse response, java.lang.Object resource)
          Callback when request is finished.
 void unregistered()
           
 

Method Detail

getScannableClass

java.lang.Class<?> getScannableClass()
Class to scan for jax-rs annotations

Returns:

registered

void registered(InjectorFactory factory)
Callback after registration has been completed.

Parameters:
factory - allows singleton factories to pre-inject things like @Context references into the singleton instance

createResource

java.lang.Object createResource(HttpRequest request,
                                HttpResponse response,
                                InjectorFactory factory)
Called per request to obtain a resource instance to invoke http request on.

Parameters:
request -
response -
factory -
Returns:

requestFinished

void requestFinished(HttpRequest request,
                     HttpResponse response,
                     java.lang.Object resource)
Callback when request is finished. usable for things like @PreDestroy if the underlying factory supports it

Parameters:
request -
response -
resource -

unregistered

void unregistered()


Copyright © 2010. All Rights Reserved.