org.jboss.resteasy.plugins.server.resourcefactory
Class POJOResourceFactory

java.lang.Object
  extended by org.jboss.resteasy.plugins.server.resourcefactory.POJOResourceFactory
All Implemented Interfaces:
ResourceFactory

public class POJOResourceFactory
extends java.lang.Object
implements ResourceFactory

Allocates an instance of a class at each invocation

Version:
$Revision: 1 $
Author:
Bill Burke

Constructor Summary
POJOResourceFactory(java.lang.Class<?> scannableClass)
           
 
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()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

POJOResourceFactory

public POJOResourceFactory(java.lang.Class<?> scannableClass)
Method Detail

registered

public void registered(InjectorFactory factory)
Description copied from interface: ResourceFactory
Callback after registration has been completed.

Specified by:
registered in interface ResourceFactory
Parameters:
factory - allows singleton factories to pre-inject things like @Context references into the singleton instance

createResource

public java.lang.Object createResource(HttpRequest request,
                                       HttpResponse response,
                                       InjectorFactory factory)
Description copied from interface: ResourceFactory
Called per request to obtain a resource instance to invoke http request on.

Specified by:
createResource in interface ResourceFactory
Returns:

unregistered

public void unregistered()
Specified by:
unregistered in interface ResourceFactory

getScannableClass

public java.lang.Class<?> getScannableClass()
Description copied from interface: ResourceFactory
Class to scan for jax-rs annotations

Specified by:
getScannableClass in interface ResourceFactory
Returns:

requestFinished

public void requestFinished(HttpRequest request,
                            HttpResponse response,
                            java.lang.Object resource)
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 interface ResourceFactory


Copyright © 2010. All Rights Reserved.