Package psiprobe.beans
Class JBossResourceResolverBean
- java.lang.Object
-
- psiprobe.beans.JBossResourceResolverBean
-
- All Implemented Interfaces:
ResourceResolver
public class JBossResourceResolverBean extends Object implements ResourceResolver
An Adapter to convert information retrieved from JBoss JMX beans into internal resource model.
-
-
Field Summary
Fields Modifier and Type Field Description private static org.slf4j.Logger
logger
The Constant logger.
-
Constructor Summary
Constructors Constructor Description JBossResourceResolverBean()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<ApplicationResource>
getApplicationResources()
Gets the application resources.List<ApplicationResource>
getApplicationResources(org.apache.catalina.Context context)
Gets the application resources.List<ApplicationResource>
getApplicationResources(org.apache.catalina.Context context, ContainerWrapperBean containerWrapper)
Gets the application resources.MBeanServer
getMBeanServer()
Method that getsMBeanServer
instance that is "default" for the current environment.DataSource
lookupDataSource(org.apache.catalina.Context context, String resourceName, ContainerWrapperBean containerWrapper)
Lookup data source.boolean
resetResource(org.apache.catalina.Context context, String resourceName, ContainerWrapperBean containerWrapper)
Reset resource.boolean
supportsDataSourceLookup()
Indicates whether this servlet container exposes datasources viaJNDI
.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.
-
-
-
Method Detail
-
getMBeanServer
public MBeanServer getMBeanServer()
Description copied from interface:ResourceResolver
Method that getsMBeanServer
instance that is "default" for the current environment. It is preferably to use this method to locate the "default"MBeanServer
implementation.- Specified by:
getMBeanServer
in interfaceResourceResolver
- Returns:
- "default"
MBeanServer
instance for the current environment
-
supportsPrivateResources
public boolean supportsPrivateResources()
Description copied from interface:ResourceResolver
Standalone Tomcat supports declaration of application-local resources. In that case it makes sense to associate display of resource/datasource information with the owner application. JBoss on other hand can only declare "global" resources, which alters the way resource information is displayed (and accessed).- Specified by:
supportsPrivateResources
in interfaceResourceResolver
- Returns:
- true if datasources can be associated with applications, otherwise false.
- See Also:
ResourceResolver.getApplicationResources(Context, ContainerWrapperBean)
-
supportsGlobalResources
public boolean supportsGlobalResources()
Description copied from interface:ResourceResolver
Most servlet containers support global resources, but for those that do not, this returns false.- Specified by:
supportsGlobalResources
in interfaceResourceResolver
- Returns:
- true if the servlet container supports global resources, otherwise false.
- See Also:
ResourceResolver.getApplicationResources()
-
supportsDataSourceLookup
public boolean supportsDataSourceLookup()
Description copied from interface:ResourceResolver
Indicates whether this servlet container exposes datasources viaJNDI
.- Specified by:
supportsDataSourceLookup
in interfaceResourceResolver
- Returns:
- true if the servlet container supports datasource lookup
-
getApplicationResources
public List<ApplicationResource> getApplicationResources() throws NamingException
Description copied from interface:ResourceResolver
Gets the application resources.- Specified by:
getApplicationResources
in interfaceResourceResolver
- Returns:
- the application resources
- Throws:
NamingException
- the naming exception
-
getApplicationResources
public List<ApplicationResource> getApplicationResources(org.apache.catalina.Context context) throws NamingException
Gets the application resources.- Parameters:
context
- the context- Returns:
- the application resources
- Throws:
NamingException
- the naming exception
-
getApplicationResources
public List<ApplicationResource> getApplicationResources(org.apache.catalina.Context context, ContainerWrapperBean containerWrapper) throws NamingException
Description copied from interface:ResourceResolver
Gets the application resources.- Specified by:
getApplicationResources
in interfaceResourceResolver
- Parameters:
context
- the contextcontainerWrapper
- the container wrapper- Returns:
- the application resources
- Throws:
NamingException
- the naming exception
-
resetResource
public boolean resetResource(org.apache.catalina.Context context, String resourceName, ContainerWrapperBean containerWrapper) throws NamingException
Description copied from interface:ResourceResolver
Reset resource.- Specified by:
resetResource
in interfaceResourceResolver
- Parameters:
context
- the contextresourceName
- the resource namecontainerWrapper
- the container wrapper- Returns:
- true, if successful
- Throws:
NamingException
- the naming exception
-
lookupDataSource
public DataSource lookupDataSource(org.apache.catalina.Context context, String resourceName, ContainerWrapperBean containerWrapper) throws NamingException
Description copied from interface:ResourceResolver
Lookup data source.- Specified by:
lookupDataSource
in interfaceResourceResolver
- Parameters:
context
- the contextresourceName
- the resource namecontainerWrapper
- the container wrapper- Returns:
- the data source
- Throws:
NamingException
- the naming exception
-
-