public class ResourceResolverBean extends Object implements ResourceResolver
| Modifier and Type | Field and Description |
|---|---|
static String |
DEFAULT_GLOBAL_RESOURCE_PREFIX
The default resource prefix for JNDI objects in the global scope:
java:. |
static String |
DEFAULT_RESOURCE_PREFIX
The default resource prefix for objects in a private application scope:
java:comp/env/. |
| Constructor and Description |
|---|
ResourceResolverBean() |
| Modifier and Type | Method and Description |
|---|---|
List<ApplicationResource> |
getApplicationResources()
Gets the application resources.
|
List<ApplicationResource> |
getApplicationResources(org.apache.catalina.Context context,
ContainerWrapperBean containerWrapper)
Gets the application resources.
|
List<String> |
getDatasourceMappers()
Gets the datasource mappers.
|
static Context |
getGlobalNamingContext()
Returns the Server's global naming context.
|
MBeanServer |
getMBeanServer()
Method that gets
MBeanServer instance that is "default" for the current environment. |
DataSource |
lookupDataSource(org.apache.catalina.Context context,
String resourceName,
ContainerWrapperBean containerWrapper)
Lookup data source.
|
void |
lookupResource(ApplicationResource resource,
boolean contextBound,
boolean global)
Lookup resource.
|
boolean |
resetResource(org.apache.catalina.Context context,
String resourceName,
ContainerWrapperBean containerWrapper)
Reset resource.
|
protected static String |
resolveJndiName(String name,
boolean global)
Resolves a JNDI resource name by prepending the scope-appropriate prefix.
|
void |
setDatasourceMappers(List<String> datasourceMappers)
Sets the datasource mappers.
|
boolean |
supportsDataSourceLookup()
Indicates whether this servlet container exposes datasources via
JNDI. |
boolean |
supportsGlobalResources()
Most servlet containers support global resources, but for those that do not, this returns
false.
|
boolean |
supportsPrivateResources()
Standalone Tomcat supports declaration of application-local resources.
|
public static final String DEFAULT_GLOBAL_RESOURCE_PREFIX
java:.public static final String DEFAULT_RESOURCE_PREFIX
java:comp/env/.public List<ApplicationResource> getApplicationResources() throws NamingException
ResourceResolvergetApplicationResources in interface ResourceResolverNamingException - the naming exceptionpublic List<ApplicationResource> getApplicationResources(org.apache.catalina.Context context, ContainerWrapperBean containerWrapper) throws NamingException
ResourceResolvergetApplicationResources in interface ResourceResolvercontext - the contextcontainerWrapper - the container wrapperNamingException - the naming exceptionpublic void lookupResource(ApplicationResource resource, boolean contextBound, boolean global)
resource - the resourcecontextBound - the context boundglobal - the globalpublic boolean resetResource(org.apache.catalina.Context context,
String resourceName,
ContainerWrapperBean containerWrapper)
throws NamingException
ResourceResolverresetResource in interface ResourceResolvercontext - the contextresourceName - the resource namecontainerWrapper - the container wrapperNamingException - the naming exceptionpublic DataSource lookupDataSource(org.apache.catalina.Context context, String resourceName, ContainerWrapperBean containerWrapper) throws NamingException
ResourceResolverlookupDataSource in interface ResourceResolvercontext - the contextresourceName - the resource namecontainerWrapper - the container wrapperNamingException - the naming exceptionpublic List<String> getDatasourceMappers()
public void setDatasourceMappers(List<String> datasourceMappers)
datasourceMappers - the new datasource mapperspublic boolean supportsPrivateResources()
ResourceResolversupportsPrivateResources in interface ResourceResolverResourceResolver.getApplicationResources(Context, ContainerWrapperBean)public boolean supportsGlobalResources()
ResourceResolversupportsGlobalResources in interface ResourceResolverResourceResolver.getApplicationResources()public boolean supportsDataSourceLookup()
ResourceResolverJNDI.supportsDataSourceLookup in interface ResourceResolverpublic MBeanServer getMBeanServer()
ResourceResolverMBeanServer instance that is "default" for the current environment. It
is preferably to use this method to locate the "default" MBeanServer implementation.getMBeanServer in interface ResourceResolverMBeanServer instance for the current environmentprotected static String resolveJndiName(String name, boolean global)
name - the JNDI name of the resourceglobal - whether to use the global prefixDEFAULT_GLOBAL_RESOURCE_PREFIX,
DEFAULT_RESOURCE_PREFIXpublic static Context getGlobalNamingContext()
Copyright © 2009–2020 psi-probe. All rights reserved.