Class ResourceMethodRegistry
java.lang.Object
org.jboss.resteasy.core.ResourceMethodRegistry
- All Implemented Interfaces:
Registry
Registry of resources and methods/classes that can dispatch HTTP method requests.
- Version:
- $Revision: 1 $
- Author:
- Bill Burke
-
Field Summary
Modifier and TypeFieldDescriptionprotected ResteasyProviderFactory
static final String
protected ResourceBuilder
protected RootClassNode
protected RootNode
protected StatisticsController
protected boolean
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addJndiResource
(String jndiName) Add a JAX-RS endpoint that exists in JNDI.void
addJndiResource
(String jndiName, String basePath) Add a JAX-RS endpoint that exists in JNDI.void
addJndiResource
(String jndiName, ResourceClass resourceClass) void
addJndiResource
(String jndiName, ResourceClass resourceClass, String basePath) void
addPerRequestResource
(Class clazz) Register a vanilla JAX-RS resource class.void
addPerRequestResource
(Class<?> clazz, ResourceBuilder resourceBuilder) void
addPerRequestResource
(Class clazz, String basePath) Add a JAX-RS endpoint.void
void
addPerRequestResource
(ResourceClass clazz, String basePath) void
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
addResourceFactory
(ResourceFactory ref, ResourceBuilder resourceBuilder) void
addResourceFactory
(ResourceFactory ref, ResourceBuilder resourceBuilder, String base) void
addResourceFactory
(ResourceFactory ref, ResourceBuilder resourceBuilder, String base, Class<?> clazz) void
addResourceFactory
(ResourceFactory ref, ResourceBuilder resourceBuilder, String base, Class<?>[] classes) void
addSingletonResource
(Object singleton) Add a JAX-RS endpoint.void
addSingletonResource
(Object singleton, String basePath) Add a JAX-RS endpoint.void
addSingletonResource
(Object singleton, ResourceClass resourceClass) void
addSingletonResource
(Object singleton, ResourceClass resourceClass, String basePath) void
Resteasy 2.x does not properly handle sub-resource and sub-resource locator endpoints with the same uri.getResourceInvoker
(HttpRequest request) Find a resource to invoke on.int
getSize()
Number of endpoints registered.boolean
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)
-
Field Details
-
REGISTRY_MATCHING_EXCEPTION
- See Also:
-
providerFactory
-
root
-
widerMatching
protected boolean widerMatching -
rootNode
-
resourceBuilder
-
statisticsController
-
-
Constructor Details
-
ResourceMethodRegistry
-
-
Method Details
-
isWiderMatching
public boolean isWiderMatching() -
setWiderMatching
public void setWiderMatching(boolean widerMatching) -
addPerRequestResource
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 interfaceRegistry
- Parameters:
clazz
- classbasePath
- prefix path of resource
-
addPerRequestResource
Register a vanilla JAX-RS resource class.- Specified by:
addPerRequestResource
in interfaceRegistry
- Parameters:
clazz
- class
-
addPerRequestResource
- Specified by:
addPerRequestResource
in interfaceRegistry
-
addPerRequestResource
- Specified by:
addPerRequestResource
in interfaceRegistry
-
addPerRequestResource
- Specified by:
addPerRequestResource
in interfaceRegistry
-
addSingletonResource
Description copied from interface:Registry
Add a JAX-RS endpoint.- Specified by:
addSingletonResource
in interfaceRegistry
- Parameters:
singleton
- resource
-
addSingletonResource
Description copied from interface:Registry
Add a JAX-RS endpoint.- Specified by:
addSingletonResource
in interfaceRegistry
- Parameters:
singleton
- resourcebasePath
- prefix path of resource
-
addSingletonResource
- Specified by:
addSingletonResource
in interfaceRegistry
-
addSingletonResource
- Specified by:
addSingletonResource
in interfaceRegistry
-
addJndiResource
Description copied from interface:Registry
Add a JAX-RS endpoint that exists in JNDI.- Specified by:
addJndiResource
in interfaceRegistry
- Parameters:
jndiName
- JNDI name
-
addJndiResource
Description copied from interface:Registry
Add a JAX-RS endpoint that exists in JNDI.- Specified by:
addJndiResource
in interfaceRegistry
- Parameters:
jndiName
- JNDI namebasePath
- prefix path of resource
-
addJndiResource
- Specified by:
addJndiResource
in interfaceRegistry
-
addJndiResource
- Specified by:
addJndiResource
in interfaceRegistry
-
addResourceFactory
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 interfaceRegistry
- Parameters:
ref
- resource factory
-
addResourceFactory
- Specified by:
addResourceFactory
in interfaceRegistry
-
addResourceFactory
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 interfaceRegistry
- Parameters:
ref
- resource factorybase
- base URI path for any resources provided by the factory, in addition to rootPath
-
addResourceFactory
- Specified by:
addResourceFactory
in interfaceRegistry
-
addResourceFactory
ResourceFactory.getScannableClass() is not used, only the clazz parameter and not any implemented interfaces of the clazz parameter.- Specified by:
addResourceFactory
in interfaceRegistry
- Parameters:
ref
- resource factorybase
- base URI path for any resources provided by the factory, in addition to rootPathclazz
- specific class
-
addResourceFactory
public void addResourceFactory(ResourceFactory ref, ResourceBuilder resourceBuilder, String base, Class<?> clazz) - Specified by:
addResourceFactory
in interfaceRegistry
-
addResourceFactory
ResourceFactory.getScannableClass() is not used, only the clazz parameter and not any implemented interfaces of the clazz parameter.- Specified by:
addResourceFactory
in interfaceRegistry
- Parameters:
ref
- resource factorybase
- base URI path for any resources provided by the factory, in addition to rootPathclasses
- specific class
-
addResourceFactory
public void addResourceFactory(ResourceFactory ref, ResourceBuilder resourceBuilder, String base, Class<?>[] classes) - Specified by:
addResourceFactory
in interfaceRegistry
-
addResourceFactory
- Specified by:
addResourceFactory
in interfaceRegistry
-
register
-
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 interfaceRegistry
-
processMethod
-
removeRegistrations
Find all endpoints reachable by clazz and unregister them.- Specified by:
removeRegistrations
in interfaceRegistry
- Parameters:
clazz
- class
-
removeRegistrations
- Specified by:
removeRegistrations
in interfaceRegistry
-
removeRegistrations
- Specified by:
removeRegistrations
in interfaceRegistry
-
getBounded
-
getSize
-
getResourceInvoker
Find a resource to invoke on.- Specified by:
getResourceInvoker
in interfaceRegistry
- Returns:
- resource invoker
-