Interface ResourceFactory

All Known Implementing Classes:
JndiComponentResourceFactory, JndiResourceFactory, POJOResourceFactory, SingletonResource, VertxResourceFactory

public interface ResourceFactory
Implementations of this interface are registered through the Registry class.
Version:
$Revision: 1 $
Author:
Bill Burke
  • Method Details

    • 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 request
      response - http response
      factory - 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 request
      response - http response
      resource - resource
    • unregistered

      void unregistered()