Package org.jboss.resteasy.core
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 $
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ResteasyProviderFactory
static final String
protected RootClassNode
protected RootNode
protected boolean
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addJndiResource
(String jndiName) Add a JAX-RS endpoint that exists in JNDIvoid
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 classvoid
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
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.private Method
findAnnotatedInterfaceMethod
(Class<?> root, Class<?> iface, Method implementation) private Method
findAnnotatedMethod
(Class<?> root, Method implementation) private Method[]
getDeclaredMethods
(Class<?> clazz) getResourceInvoker
(HttpRequest request) Find a resource to invoke onint
getSize()
Number of endpoints registeredboolean
protected void
processMethod
(ResourceFactory rf, String base, ResourceLocator method) protected void
register
(ResourceFactory rf, String base, ResourceClass resourceClass) private void
removeRegistration
(String base, Class<?> clazz) void
removeRegistrations
(Class clazz) Find all endpoints reachable by clazz and unregister themvoid
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
-
-
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
basePath
- prefix path of resource
-
addPerRequestResource
Register a vanilla JAX-RS resource class- Specified by:
addPerRequestResource
in interfaceRegistry
- Parameters:
clazz
-
-
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
-
addSingletonResource
Description copied from interface:Registry
Add a JAX-RS endpoint.- Specified by:
addSingletonResource
in interfaceRegistry
basePath
- 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
-
addJndiResource
Description copied from interface:Registry
Add a JAX-RS endpoint that exists in JNDI.- Specified by:
addJndiResource
in interfaceRegistry
basePath
- 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
-
-
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
-base
- base URI path for any resources provided by the factory, in addition to rootPath
-
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
-base
- base URI path for any resources provided by the factory, in addition to rootPathclazz
- specific class
-
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
-base
- base URI path for any resources provided by the factory, in addition to rootPathclasses
- specific class
-
getDeclaredMethods
-
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
-
findAnnotatedInterfaceMethod
-
findAnnotatedMethod
-
removeRegistrations
Find all endpoints reachable by clazz and unregister them- Specified by:
removeRegistrations
in interfaceRegistry
- Parameters:
clazz
-
-
removeRegistrations
- Specified by:
removeRegistrations
in interfaceRegistry
-
removeRegistrations
- Specified by:
removeRegistrations
in interfaceRegistry
-
removeRegistration
-
getBounded
-
getSize
public int getSize()Number of endpoints registered -
getResourceInvoker
Find a resource to invoke on- Specified by:
getResourceInvoker
in interfaceRegistry
- Returns:
-