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 $
- Author:
- Bill Burke
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ResteasyProviderFactorystatic final Stringprotected RootClassNodeprotected RootNodeprotected boolean -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddJndiResource(String jndiName) Add a JAX-RS endpoint that exists in JNDIvoidaddJndiResource(String jndiName, String basePath) Add a JAX-RS endpoint that exists in JNDI.voidaddJndiResource(String jndiName, ResourceClass resourceClass) voidaddJndiResource(String jndiName, ResourceClass resourceClass, String basePath) voidaddPerRequestResource(Class clazz) Register a vanilla JAX-RS resource classvoidaddPerRequestResource(Class clazz, String basePath) Add a JAX-RS endpoint.voidvoidaddPerRequestResource(ResourceClass clazz, String basePath) voidBind an endpoint ResourceFactory.voidaddResourceFactory(ResourceFactory ref, String base) ResourceFactory.getScannableClass() defines what class should be scanned for JAX-RS annotations.voidaddResourceFactory(ResourceFactory ref, String base, Class<?> clazz) ResourceFactory.getScannableClass() is not used, only the clazz parameter and not any implemented interfaces of the clazz parameter.voidaddResourceFactory(ResourceFactory ref, String base, Class<?>[] classes) ResourceFactory.getScannableClass() is not used, only the clazz parameter and not any implemented interfaces of the clazz parameter.voidaddResourceFactory(ResourceFactory rf, String base, ResourceClass resourceClass) voidaddSingletonResource(Object singleton) Add a JAX-RS endpoint.voidaddSingletonResource(Object singleton, String basePath) Add a JAX-RS endpoint.voidaddSingletonResource(Object singleton, ResourceClass resourceClass) voidaddSingletonResource(Object singleton, ResourceClass resourceClass, String basePath) voidResteasy 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 onintgetSize()Number of endpoints registeredbooleanprotected voidprocessMethod(ResourceFactory rf, String base, ResourceLocator method) protected voidregister(ResourceFactory rf, String base, ResourceClass resourceClass) voidremoveRegistrations(Class clazz) Find all endpoints reachable by clazz and unregister themvoidremoveRegistrations(Class clazz, String base) voidremoveRegistrations(ResourceClass resourceClass) voidsetWiderMatching(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:RegistryAdd a JAX-RS endpoint. Objects of clazz will be created and destroy and the beginning/end of every request- Specified by:
addPerRequestResourcein interfaceRegistry- Parameters:
clazz-basePath- prefix path of resource
-
addPerRequestResource
Register a vanilla JAX-RS resource class- Specified by:
addPerRequestResourcein interfaceRegistry- Parameters:
clazz-
-
addPerRequestResource
- Specified by:
addPerRequestResourcein interfaceRegistry
-
addPerRequestResource
- Specified by:
addPerRequestResourcein interfaceRegistry
-
addSingletonResource
Description copied from interface:RegistryAdd a JAX-RS endpoint.- Specified by:
addSingletonResourcein interfaceRegistry- Parameters:
singleton-
-
addSingletonResource
Description copied from interface:RegistryAdd a JAX-RS endpoint.- Specified by:
addSingletonResourcein interfaceRegistry- Parameters:
singleton-basePath- prefix path of resource
-
addSingletonResource
- Specified by:
addSingletonResourcein interfaceRegistry
-
addSingletonResource
- Specified by:
addSingletonResourcein interfaceRegistry
-
addJndiResource
Description copied from interface:RegistryAdd a JAX-RS endpoint that exists in JNDI- Specified by:
addJndiResourcein interfaceRegistry- Parameters:
jndiName-
-
addJndiResource
Description copied from interface:RegistryAdd a JAX-RS endpoint that exists in JNDI.- Specified by:
addJndiResourcein interfaceRegistry- Parameters:
jndiName-basePath- prefix path of resource
-
addJndiResource
- Specified by:
addJndiResourcein interfaceRegistry
-
addJndiResource
- Specified by:
addJndiResourcein 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:
addResourceFactoryin 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:
addResourceFactoryin 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:
addResourceFactoryin 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:
addResourceFactoryin interfaceRegistry- Parameters:
ref-base- base URI path for any resources provided by the factory, in addition to rootPathclasses- specific class
-
addResourceFactory
- Specified by:
addResourceFactoryin 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:
checkAmbiguousUriin interfaceRegistry
-
processMethod
-
removeRegistrations
Find all endpoints reachable by clazz and unregister them- Specified by:
removeRegistrationsin interfaceRegistry- Parameters:
clazz-
-
removeRegistrations
- Specified by:
removeRegistrationsin interfaceRegistry
-
removeRegistrations
- Specified by:
removeRegistrationsin interfaceRegistry
-
getBounded
-
getSize
public int getSize()Number of endpoints registered -
getResourceInvoker
Find a resource to invoke on- Specified by:
getResourceInvokerin interfaceRegistry- Returns:
-