org.jboss.resteasy.core

## 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 $
  Author:
    Bill Burke

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected ResteasyProviderFactory` | `providerFactory`
    `static String` | `REGISTRY_MATCHING_EXCEPTION`
    `protected RootClassNode` | `root`
    `protected RootNode` | `rootNode`
    `protected boolean` | `widerMatching`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ResourceMethodRegistry(ResteasyProviderFactory providerFactory)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addJndiResource(String jndiName)` Add a JAX-RS endpoint that exists in JNDI
    `void` | `addJndiResource(String jndiName, ResourceClass resourceClass)`
    `void` | `addJndiResource(String jndiName, ResourceClass resourceClass, String basePath)`
    `void` | `addJndiResource(String jndiName, String basePath)` Add a JAX-RS endpoint that exists in JNDI.
    `void` | `addPerRequestResource(Class clazz)` Register a vanilla JAX-RS resource class
    `void` | `addPerRequestResource(Class clazz, String basePath)` Add a JAX-RS endpoint.
    `void` | `addPerRequestResource(ResourceClass clazz)`
    `void` | `addPerRequestResource(ResourceClass clazz, String basePath)`
    `void` | `addResourceFactory(ResourceFactory ref)` Bind an endpoint ResourceFactory.
    `void` | `addResourceFactory(ResourceFactory ref, String base)` ResourceFactory.getScannableClass() defines what class should be scanned for JAX-RS annotations.
    `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.
    `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.
    `void` | `addResourceFactory(ResourceFactory rf, String base, ResourceClass resourceClass)`
    `void` | `addSingletonResource(Object singleton)` Add a JAX-RS endpoint.
    `void` | `addSingletonResource(Object singleton, ResourceClass resourceClass)`
    `void` | `addSingletonResource(Object singleton, ResourceClass resourceClass, String basePath)`
    `void` | `addSingletonResource(Object singleton, String basePath)` Add a JAX-RS endpoint.
    `Map<String,List<ResourceInvoker>>` | `getBounded()`
    `ResourceInvoker` | `getResourceInvoker(HttpRequest request)` Find a resource to invoke on
    `int` | `getSize()` Number of endpoints registered
    `boolean` | `isWiderMatching()`
    `protected void` | `processMethod(ResourceFactory rf, String base, ResourceLocator method)`
    `protected void` | `register(ResourceFactory rf, String base, ResourceClass resourceClass)`
    `void` | `removeRegistrations(Class clazz)` Find all endpoints reachable by clazz and unregister them
    `void` | `removeRegistrations(Class clazz, String base)`
    `void` | `removeRegistrations(ResourceClass resourceClass)`
    `void` | `setWiderMatching(boolean widerMatching)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### REGISTRY_MATCHING_EXCEPTION

          public static final String REGISTRY_MATCHING_EXCEPTION

      See Also:
        Constant Field Values

    - #### providerFactory

          protected ResteasyProviderFactory providerFactory

    - #### root

          protected RootClassNode root

    - #### widerMatching

          protected boolean widerMatching

    - #### rootNode

          protected RootNode rootNode

  - ### Constructor Detail

    - #### ResourceMethodRegistry

          public ResourceMethodRegistry(ResteasyProviderFactory providerFactory)

  - ### Method Detail

    - #### 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

    - #### 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)

    - #### processMethod

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

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

    - #### 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:

Copyright © 2014. All Rights Reserved.