Package org.apache.tomcat.util.modeler
Class ManagedBean
java.lang.Object
org.apache.tomcat.util.modeler.ManagedBean
- All Implemented Interfaces:
Serializable
Internal configuration information for a managed bean (MBean) descriptor.
- Author:
- Craig R. McClanahan
- See Also:
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addAttribute
(AttributeInfo attribute) Add a new attribute to the set of attributes for this MBean.void
addNotification
(NotificationInfo notification) Add a new notification to the set of notifications for this MBean.void
addOperation
(OperationInfo operation) Add a new operation to the set of operations for this MBean.createMBean
(Object instance) Create and return aModelMBean
that has been preconfigured with theModelMBeanInfo
information for this managed bean, and is associated with the specified managed object instance.The fully qualified name of the Java class of the MBean described by this descriptor.getGroup()
getName()
getSetter
(String aname, BaseModelMBean bean, Object resource) getType()
void
setClassName
(String className) void
setDescription
(String description) void
void
void
void
toString()
Return a string representation of this managed bean.
-
Field Details
-
className
-
description
-
domain
-
group
-
name
-
type
-
-
Constructor Details
-
ManagedBean
public ManagedBean()Constructor. Will add default attributes.
-
-
Method Details
-
getAttributes
- Returns:
- the collection of attributes for this MBean.
-
getClassName
The fully qualified name of the Java class of the MBean described by this descriptor. If not specified, the standard JMX class (javax.management.modelmbean.RequiredModeLMBean
) will be utilized.- Returns:
- the class name
-
setClassName
-
getDescription
- Returns:
- the human-readable description of this MBean.
-
setDescription
-
getDomain
- Returns:
- the (optional)
ObjectName
domain in which this MBean should be registered in the MBeanServer.
-
setDomain
-
getGroup
- Returns:
- the (optional) group to which this MBean belongs.
-
setGroup
-
getName
- Returns:
- the name of this managed bean, which must be unique among all MBeans managed by a particular MBeans server.
-
setName
-
getNotifications
- Returns:
- the collection of notifications for this MBean.
-
getOperations
- Returns:
- the collection of operations for this MBean.
-
getType
- Returns:
- the fully qualified name of the Java class of the resource implementation class described by the managed bean described by this descriptor.
-
setType
-
addAttribute
Add a new attribute to the set of attributes for this MBean.- Parameters:
attribute
- The new attribute descriptor
-
addNotification
Add a new notification to the set of notifications for this MBean.- Parameters:
notification
- The new notification descriptor
-
addOperation
Add a new operation to the set of operations for this MBean.- Parameters:
operation
- The new operation descriptor
-
createMBean
public DynamicMBean createMBean(Object instance) throws InstanceNotFoundException, MBeanException, RuntimeOperationsException Create and return aModelMBean
that has been preconfigured with theModelMBeanInfo
information for this managed bean, and is associated with the specified managed object instance. The returnedModelMBean
will NOT have been registered with ourMBeanServer
.- Parameters:
instance
- Instanced of the managed object, ornull
for no associated instance- Returns:
- the MBean
- Throws:
InstanceNotFoundException
- if the managed resource object cannot be foundMBeanException
- if a problem occurs instantiating theModelMBean
instanceRuntimeOperationsException
- if a JMX runtime error occurs
-
toString
-
getSetter
public Method getSetter(String aname, BaseModelMBean bean, Object resource) throws AttributeNotFoundException, ReflectionException -
getInvoke
public Method getInvoke(String aname, Object[] params, String[] signature, BaseModelMBean bean, Object resource) throws MBeanException, ReflectionException - Throws:
MBeanException
ReflectionException
-