All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.jboss.resteasy.spi.ResourceFactory Maven / Gradle / Ivy

There is a newer version: 4.0.0.Beta5
Show newest version
package org.jboss.resteasy.spi;

/**
 * Implementations of this interface are registered through the Registry class.
 *
 * @author Bill Burke
 * @version $Revision: 1 $
 */
public interface ResourceFactory
{
   /**
    * Class to scan for jax-rs annotations
    *
    * @return class
    */
   Class getScannableClass();

   /**
    * Callback after registration has been completed.
    *
    * @param factory allows singleton factories to pre-inject things like @Context references into the singleton instance
    */
   void registered(ResteasyProviderFactory factory);

   /**
    * Called per request to obtain a resource instance to invoke http request on.
    *
    * @param request http request
    * @param response http response
    * @param factory provider factory
    * @return resource
    */
   Object createResource(HttpRequest request, HttpResponse response, ResteasyProviderFactory factory);


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

   void unregistered();
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy