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

    Methods
    Modifier and Type | Method and 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 annotations
    `void` | `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:

    - #### 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` -
        `response` -
        `factory` -
      Returns:

    - #### 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` -
        `response` -
        `resource` -

    - #### unregistered

          void unregistered()

Copyright © 2014. All Rights Reserved.