Package org.apache.tomcat.util.modeler
Class ManagedBean
- java.lang.Object
-
- org.apache.tomcat.util.modeler.ManagedBean
-
- All Implemented Interfaces:
java.io.Serializable
public class ManagedBean extends java.lang.Object implements java.io.SerializableInternal configuration information for a managed bean (MBean) descriptor.
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.StringclassNameThe fully qualified name of the Java class of the MBean.protected java.lang.StringdescriptionThe human-readable description of this MBean.protected java.lang.StringdomainThe ObjectName domain in which this MBean should be registered.protected java.lang.StringgroupThe group to which this MBean belongs.protected java.lang.StringnameThe name of this managed bean.protected java.lang.StringtypeThe fully qualified name of the Java class of the resource implementation class.
-
Constructor Summary
Constructors Constructor Description ManagedBean()Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddAttribute(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.javax.management.DynamicMBeancreateMBean(java.lang.Object instance)Create and return aModelMBeanthat has been preconfigured with theModelMBeanInfoinformation for this managed bean, and is associated with the specified managed object instance.AttributeInfo[]getAttributes()Return the collection of attributes for this MBean.java.lang.StringgetClassName()The fully qualified name of the Java class of the MBean described by this descriptor.java.lang.StringgetDescription()Return the human-readable description of this MBean.java.lang.StringgetDomain()Return the (optional)ObjectNamedomain in which this MBean should be registered in the MBeanServer.java.lang.StringgetGroup()Return the (optional) group to which this MBean belongs.java.lang.reflect.MethodgetInvoke(java.lang.String aname, java.lang.Object[] params, java.lang.String[] signature, BaseModelMBean bean, java.lang.Object resource)Get the method to invoke for the given operation.java.lang.StringgetName()Return the name of this managed bean, which must be unique among all MBeans managed by a particular MBeans server.NotificationInfo[]getNotifications()Return the collection of notifications for this MBean.OperationInfo[]getOperations()Return the collection of operations for this MBean.java.lang.reflect.MethodgetSetter(java.lang.String aname, BaseModelMBean bean, java.lang.Object resource)Get the setter method for the given attribute.java.lang.StringgetType()Return the fully qualified name of the Java class of the resource implementation class described by the managed bean described by this descriptor.voidsetClassName(java.lang.String className)Set the fully qualified name of the Java class of the MBean.voidsetDescription(java.lang.String description)Set the human-readable description of this MBean.voidsetDomain(java.lang.String domain)Set the (optional)ObjectNamedomain in which this MBean should be registered.voidsetGroup(java.lang.String group)Set the (optional) group to which this MBean belongs.voidsetName(java.lang.String name)Set the name of this managed bean.voidsetType(java.lang.String type)Set the fully qualified name of the Java class of the resource implementation class.java.lang.StringtoString()Return a string representation of this managed bean.
-
-
-
Field Detail
-
className
protected java.lang.String className
The fully qualified name of the Java class of the MBean.
-
description
protected java.lang.String description
The human-readable description of this MBean.
-
domain
protected java.lang.String domain
The ObjectName domain in which this MBean should be registered.
-
group
protected java.lang.String group
The group to which this MBean belongs.
-
name
protected java.lang.String name
The name of this managed bean.
-
type
protected java.lang.String type
The fully qualified name of the Java class of the resource implementation class.
-
-
Method Detail
-
getAttributes
public AttributeInfo[] getAttributes()
Return the collection of attributes for this MBean.- Returns:
- the collection of attributes for this MBean
-
getClassName
public java.lang.String 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
public void setClassName(java.lang.String className)
Set the fully qualified name of the Java class of the MBean.- Parameters:
className- the className to set
-
getDescription
public java.lang.String getDescription()
Return the human-readable description of this MBean.- Returns:
- the human-readable description of this MBean
-
setDescription
public void setDescription(java.lang.String description)
Set the human-readable description of this MBean.- Parameters:
description- the description to set
-
getDomain
public java.lang.String 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
public void setDomain(java.lang.String domain)
Set the (optional)ObjectNamedomain in which this MBean should be registered.- Parameters:
domain- the domain to set
-
getGroup
public java.lang.String getGroup()
Return the (optional) group to which this MBean belongs.- Returns:
- the (optional) group to which this MBean belongs
-
setGroup
public void setGroup(java.lang.String group)
Set the (optional) group to which this MBean belongs.- Parameters:
group- the group to set
-
getName
public java.lang.String 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
public void setName(java.lang.String name)
Set the name of this managed bean.- Parameters:
name- the name to set
-
getNotifications
public NotificationInfo[] getNotifications()
Return the collection of notifications for this MBean.- Returns:
- the collection of notifications for this MBean
-
getOperations
public OperationInfo[] getOperations()
Return the collection of operations for this MBean.- Returns:
- the collection of operations for this MBean
-
getType
public java.lang.String 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
public void setType(java.lang.String type)
Set the fully qualified name of the Java class of the resource implementation class.- Parameters:
type- the type to set
-
addAttribute
public void addAttribute(AttributeInfo attribute)
Add a new attribute to the set of attributes for this MBean.- Parameters:
attribute- The new attribute descriptor
-
addNotification
public void addNotification(NotificationInfo notification)
Add a new notification to the set of notifications for this MBean.- Parameters:
notification- The new notification descriptor
-
addOperation
public void addOperation(OperationInfo operation)
Add a new operation to the set of operations for this MBean.- Parameters:
operation- The new operation descriptor
-
createMBean
public javax.management.DynamicMBean createMBean(java.lang.Object instance) throws javax.management.InstanceNotFoundException, javax.management.MBeanException, javax.management.RuntimeOperationsExceptionCreate 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:
javax.management.InstanceNotFoundException- if the managed resource object cannot be foundjavax.management.MBeanException- if a problem occurs instantiating theModelMBeaninstancejavax.management.RuntimeOperationsException- if a JMX runtime error occurs
-
toString
public java.lang.String toString()
Return a string representation of this managed bean.- Overrides:
toStringin classjava.lang.Object
-
getSetter
public java.lang.reflect.Method getSetter(java.lang.String aname, BaseModelMBean bean, java.lang.Object resource) throws javax.management.AttributeNotFoundException, javax.management.ReflectionExceptionGet the setter method for the given attribute.- Parameters:
aname- The attribute namebean- The MBeanresource- The resource- Returns:
- the setter method
- Throws:
javax.management.AttributeNotFoundException- if the attribute is not foundjavax.management.ReflectionException- if a reflection error occurs
-
getInvoke
public java.lang.reflect.Method getInvoke(java.lang.String aname, java.lang.Object[] params, java.lang.String[] signature, BaseModelMBean bean, java.lang.Object resource) throws javax.management.MBeanException, javax.management.ReflectionExceptionGet 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:
javax.management.MBeanException- if the operation is not foundjavax.management.ReflectionException- if a reflection error occurs
-
-