Class MBeanUtils
java.lang.Object
org.apache.catalina.mbeans.MBeanUtils
Public utility methods in support of the server side MBeans implementation.
- Author:
- Craig R. McClanahan, Amy Roh
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic DynamicMBean
createMBean
(ContextEnvironment environment) Create, register, and return an MBean for thisContextEnvironment
object.static DynamicMBean
createMBean
(ContextResource resource) Create, register, and return an MBean for thisContextResource
object.static DynamicMBean
createMBean
(ContextResourceLink resourceLink) Create, register, and return an MBean for thisContextResourceLink
object.static ObjectName
createObjectName
(String domain, ContextEnvironment environment) Create anObjectName
for thisService
object.static ObjectName
createObjectName
(String domain, ContextResource resource) Create anObjectName
for thisContextResource
object.static ObjectName
createObjectName
(String domain, ContextResourceLink resourceLink) Create anObjectName
for thisContextResourceLink
object.static Registry
Create and configure (if necessary) and return the registry of managed object descriptions.static MBeanServer
Create and configure (if necessary) and return theMBeanServer
with which we will be registering ourDynamicMBean
implementations.static void
destroyMBean
(ContextEnvironment environment) Deregister the MBean for thisContextEnvironment
object.static void
destroyMBean
(ContextResource resource) Deregister the MBean for thisContextResource
object.static void
destroyMBean
(ContextResourceLink resourceLink) Deregister the MBean for thisContextResourceLink
object.
-
Field Details
-
sm
-
-
Constructor Details
-
MBeanUtils
public MBeanUtils()
-
-
Method Details
-
createMBean
Create, register, and return an MBean for thisContextEnvironment
object.- Parameters:
environment
- The ContextEnvironment to be managed- Returns:
- a new MBean
- Throws:
Exception
- if an MBean cannot be created or registered
-
createMBean
Create, register, and return an MBean for thisContextResource
object.- Parameters:
resource
- The ContextResource to be managed- Returns:
- a new MBean
- Throws:
Exception
- if an MBean cannot be created or registered
-
createMBean
Create, register, and return an MBean for thisContextResourceLink
object.- Parameters:
resourceLink
- The ContextResourceLink to be managed- Returns:
- a new MBean
- Throws:
Exception
- if an MBean cannot be created or registered
-
createObjectName
public static ObjectName createObjectName(String domain, ContextEnvironment environment) throws MalformedObjectNameException Create anObjectName
for thisService
object.- Parameters:
domain
- Domain in which this name is to be createdenvironment
- The ContextEnvironment to be named- Returns:
- a new object name
- Throws:
MalformedObjectNameException
- if a name cannot be created
-
createObjectName
public static ObjectName createObjectName(String domain, ContextResource resource) throws MalformedObjectNameException Create anObjectName
for thisContextResource
object.- Parameters:
domain
- Domain in which this name is to be createdresource
- The ContextResource to be named- Returns:
- a new object name
- Throws:
MalformedObjectNameException
- if a name cannot be created
-
createObjectName
public static ObjectName createObjectName(String domain, ContextResourceLink resourceLink) throws MalformedObjectNameException Create anObjectName
for thisContextResourceLink
object.- Parameters:
domain
- Domain in which this name is to be createdresourceLink
- The ContextResourceLink to be named- Returns:
- a new object name
- Throws:
MalformedObjectNameException
- if a name cannot be created
-
createRegistry
Create and configure (if necessary) and return the registry of managed object descriptions.- Returns:
- the singleton registry
-
createServer
Create and configure (if necessary) and return theMBeanServer
with which we will be registering ourDynamicMBean
implementations.- Returns:
- the singleton MBean server
-
destroyMBean
Deregister the MBean for thisContextEnvironment
object.- Parameters:
environment
- The ContextEnvironment to be managed- Throws:
Exception
- if an MBean cannot be deregistered
-
destroyMBean
Deregister the MBean for thisContextResource
object.- Parameters:
resource
- The ContextResource to be managed- Throws:
Exception
- if an MBean cannot be deregistered
-
destroyMBean
Deregister the MBean for thisContextResourceLink
object.- Parameters:
resourceLink
- The ContextResourceLink to be managed- Throws:
Exception
- if an MBean cannot be deregistered
-