Class ManagedBean
java.lang.Object
org.apache.tomcat.util.modeler.ManagedBean
- All Implemented Interfaces:
Serializable
Internal configuration information for a managed bean (MBean) descriptor.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected StringThe fully qualified name of the Java class of the MBean.protected StringThe human-readable description of this MBean.protected StringThe ObjectName domain in which this MBean should be registered.protected StringThe group to which this MBean belongs.protected StringThe name of this managed bean.protected StringThe fully qualified name of the Java class of the resource implementation class. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddAttribute(AttributeInfo attribute) Add a new attribute to the set of attributes for this MBean.voidaddNotification(NotificationInfo notification) Add a new notification to the set of notifications for this MBean.voidaddOperation(OperationInfo operation) Add a new operation to the set of operations for this MBean.createMBean(Object instance) Create and return aModelMBeanthat has been preconfigured with theModelMBeanInfoinformation for this managed bean, and is associated with the specified managed object instance.Return the collection of attributes for this MBean.The fully qualified name of the Java class of the MBean described by this descriptor.Return the human-readable description of this MBean.Return the (optional)ObjectNamedomain in which this MBean should be registered in the MBeanServer.getGroup()Return the (optional) group to which this MBean belongs.Get the method to invoke for the given operation.getName()Return the name of this managed bean, which must be unique among all MBeans managed by a particular MBeans server.Return the collection of notifications for this MBean.Return the collection of operations for this MBean.getSetter(String aname, BaseModelMBean bean, Object resource) Get the setter method for the given attribute.getType()Return the fully qualified name of the Java class of the resource implementation class described by the managed bean described by this descriptor.voidsetClassName(String className) Set the fully qualified name of the Java class of the MBean.voidsetDescription(String description) Set the human-readable description of this MBean.voidSet the (optional)ObjectNamedomain in which this MBean should be registered.voidSet the (optional) group to which this MBean belongs.voidSet the name of this managed bean.voidSet the fully qualified name of the Java class of the resource implementation class.toString()Return a string representation of this managed bean.
-
Field Details
-
className
The fully qualified name of the Java class of the MBean. -
description
The human-readable description of this MBean. -
domain
The ObjectName domain in which this MBean should be registered. -
group
The group to which this MBean belongs. -
name
The name of this managed bean. -
type
The fully qualified name of the Java class of the resource implementation class.
-
-
Constructor Details
-
ManagedBean
public ManagedBean()Constructor. Will add default attributes.
-
-
Method Details
-
getAttributes
Return the collection of attributes for this MBean.- 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
Set the fully qualified name of the Java class of the MBean.- Parameters:
className- the className to set
-
getDescription
Return the human-readable description of this MBean.- Returns:
- the human-readable description of this MBean
-
setDescription
Set the human-readable description of this MBean.- Parameters:
description- the description to set
-
getDomain
Return the (optional)ObjectNamedomain in which this MBean should be registered in the MBeanServer.- Returns:
- the (optional)
ObjectNamedomain in which this MBean should be registered
-
setDomain
Set the (optional)ObjectNamedomain in which this MBean should be registered.- Parameters:
domain- the domain to set
-
getGroup
Return the (optional) group to which this MBean belongs.- Returns:
- the (optional) group to which this MBean belongs
-
setGroup
Set the (optional) group to which this MBean belongs.- Parameters:
group- the group to set
-
getName
Return the name of this managed bean, which must be unique among all MBeans managed by a particular MBeans server.- Returns:
- the name of this managed bean
-
setName
Set the name of this managed bean.- Parameters:
name- the name to set
-
getNotifications
Return the collection of notifications for this MBean.- Returns:
- the collection of notifications for this MBean
-
getOperations
Return the collection of operations for this MBean.- Returns:
- the collection of operations for this MBean
-
getType
Return the fully qualified name of the Java class of the resource implementation class described by the managed bean described by this descriptor.- Returns:
- the fully qualified name of the Java class of the resource implementation class
-
setType
Set the fully qualified name of the Java class of the resource implementation class.- Parameters:
type- the type to set
-
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 aModelMBeanthat has been preconfigured with theModelMBeanInfoinformation for this managed bean, and is associated with the specified managed object instance. The returnedModelMBeanwill NOT have been registered with ourMBeanServer.- Parameters:
instance- Instanced of the managed object, ornullfor no associated instance- Returns:
- the MBean
- Throws:
InstanceNotFoundException- if the managed resource object cannot be foundMBeanException- if a problem occurs instantiating theModelMBeaninstanceRuntimeOperationsException- if a JMX runtime error occurs
-
toString
-
getSetter
public Method getSetter(String aname, BaseModelMBean bean, Object resource) throws AttributeNotFoundException, ReflectionException Get the setter method for the given attribute.- Parameters:
aname- The attribute namebean- The MBeanresource- The resource- Returns:
- the setter method
- Throws:
AttributeNotFoundException- if the attribute is not foundReflectionException- if a reflection error occurs
-
getInvoke
public Method getInvoke(String aname, Object[] params, String[] signature, BaseModelMBean bean, Object resource) throws MBeanException, ReflectionException Get the method to invoke for the given operation.- Parameters:
aname- The operation nameparams- The parameterssignature- The parameter signaturebean- The MBeanresource- The resource- Returns:
- the method to invoke
- Throws:
MBeanException- if the operation is not foundReflectionException- if a reflection error occurs
-