Class ResourceMethodRegistry

java.lang.Object
org.jboss.resteasy.core.ResourceMethodRegistry
All Implemented Interfaces:
Registry

public class ResourceMethodRegistry extends Object implements Registry
Registry of resources and methods/classes that can dispatch HTTP method requests
Version:
$Revision: 1 $
  • Field Details

  • Constructor Details

  • Method Details

    • isWiderMatching

      public boolean isWiderMatching()
    • setWiderMatching

      public void setWiderMatching(boolean widerMatching)
    • addPerRequestResource

      public void addPerRequestResource(Class clazz, String basePath)
      Description copied from interface: Registry
      Add a JAX-RS endpoint. Objects of clazz will be created and destroy and the beginning/end of every request
      Specified by:
      addPerRequestResource in interface Registry
      basePath - prefix path of resource
    • addPerRequestResource

      public void addPerRequestResource(Class clazz)
      Register a vanilla JAX-RS resource class
      Specified by:
      addPerRequestResource in interface Registry
      Parameters:
      clazz -
    • addPerRequestResource

      public void addPerRequestResource(ResourceClass clazz)
      Specified by:
      addPerRequestResource in interface Registry
    • addPerRequestResource

      public void addPerRequestResource(ResourceClass clazz, String basePath)
      Specified by:
      addPerRequestResource in interface Registry
    • addSingletonResource

      public void addSingletonResource(Object singleton)
      Description copied from interface: Registry
      Add a JAX-RS endpoint.
      Specified by:
      addSingletonResource in interface Registry
    • addSingletonResource

      public void addSingletonResource(Object singleton, String basePath)
      Description copied from interface: Registry
      Add a JAX-RS endpoint.
      Specified by:
      addSingletonResource in interface Registry
      basePath - prefix path of resource
    • addSingletonResource

      public void addSingletonResource(Object singleton, ResourceClass resourceClass)
      Specified by:
      addSingletonResource in interface Registry
    • addSingletonResource

      public void addSingletonResource(Object singleton, ResourceClass resourceClass, String basePath)
      Specified by:
      addSingletonResource in interface Registry
    • addJndiResource

      public void addJndiResource(String jndiName)
      Description copied from interface: Registry
      Add a JAX-RS endpoint that exists in JNDI
      Specified by:
      addJndiResource in interface Registry
    • addJndiResource

      public void addJndiResource(String jndiName, String basePath)
      Description copied from interface: Registry
      Add a JAX-RS endpoint that exists in JNDI.
      Specified by:
      addJndiResource in interface Registry
      basePath - prefix path of resource
    • addJndiResource

      public void addJndiResource(String jndiName, ResourceClass resourceClass)
      Specified by:
      addJndiResource in interface Registry
    • addJndiResource

      public void addJndiResource(String jndiName, ResourceClass resourceClass, String basePath)
      Specified by:
      addJndiResource in interface Registry
    • addResourceFactory

      public void addResourceFactory(ResourceFactory ref)
      Bind an endpoint ResourceFactory. ResourceFactory.getScannableClass() defines what class should be scanned for JAX-RS annotations. The class and any implemented interfaces are scanned for annotations.
      Specified by:
      addResourceFactory in interface Registry
      Parameters:
      ref -
    • addResourceFactory

      public void addResourceFactory(ResourceFactory ref, String base)
      ResourceFactory.getScannableClass() defines what class should be scanned for JAX-RS annotations. The class and any implemented interfaces are scanned for annotations.
      Specified by:
      addResourceFactory in interface Registry
      Parameters:
      ref -
      base - base URI path for any resources provided by the factory, in addition to rootPath
    • addResourceFactory

      public void addResourceFactory(ResourceFactory ref, String base, Class<?> clazz)
      ResourceFactory.getScannableClass() is not used, only the clazz parameter and not any implemented interfaces of the clazz parameter.
      Specified by:
      addResourceFactory in interface Registry
      Parameters:
      ref -
      base - base URI path for any resources provided by the factory, in addition to rootPath
      clazz - specific class
    • addResourceFactory

      public void addResourceFactory(ResourceFactory ref, String base, Class<?>[] classes)
      ResourceFactory.getScannableClass() is not used, only the clazz parameter and not any implemented interfaces of the clazz parameter.
      Specified by:
      addResourceFactory in interface Registry
      Parameters:
      ref -
      base - base URI path for any resources provided by the factory, in addition to rootPath
      classes - specific class
    • getDeclaredMethods

      private Method[] getDeclaredMethods(Class<?> clazz)
    • addResourceFactory

      public void addResourceFactory(ResourceFactory rf, String base, ResourceClass resourceClass)
      Specified by:
      addResourceFactory in interface Registry
    • register

      protected void register(ResourceFactory rf, String base, ResourceClass resourceClass)
    • checkAmbiguousUri

      public void checkAmbiguousUri()
      Resteasy 2.x does not properly handle sub-resource and sub-resource locator endpoints with the same uri. Resteasy 3.x does handle this properly. In assisting customers identify this issue during an upgrade from Resteasy 2 to 3 provides a waring when the situation is found.
      Specified by:
      checkAmbiguousUri in interface Registry
    • processMethod

      protected void processMethod(ResourceFactory rf, String base, ResourceLocator method)
    • findAnnotatedInterfaceMethod

      private Method findAnnotatedInterfaceMethod(Class<?> root, Class<?> iface, Method implementation)
    • findAnnotatedMethod

      private Method findAnnotatedMethod(Class<?> root, Method implementation)
    • removeRegistrations

      public void removeRegistrations(Class clazz)
      Find all endpoints reachable by clazz and unregister them
      Specified by:
      removeRegistrations in interface Registry
      Parameters:
      clazz -
    • removeRegistrations

      public void removeRegistrations(Class clazz, String base)
      Specified by:
      removeRegistrations in interface Registry
    • removeRegistrations

      public void removeRegistrations(ResourceClass resourceClass)
      Specified by:
      removeRegistrations in interface Registry
    • removeRegistration

      private void removeRegistration(String base, Class<?> clazz)
    • getBounded

      public Map<String,List<ResourceInvoker>> getBounded()
    • getSize

      public int getSize()
      Number of endpoints registered
      Specified by:
      getSize in interface Registry
      Returns:
    • getResourceInvoker

      public ResourceInvoker getResourceInvoker(HttpRequest request)
      Find a resource to invoke on
      Specified by:
      getResourceInvoker in interface Registry
      Returns: