Package org.apache.tomcat.util.modeler
Class ManagedBean
- java.lang.Object
-
- org.apache.tomcat.util.modeler.ManagedBean
-
- All Implemented Interfaces:
Serializable
public class ManagedBean extends Object implements Serializable
Internal configuration information for a managed bean (MBean) descriptor.
- Author:
- Craig R. McClanahan
- See Also:
- Serialized Form
-
-
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.DynamicMBeancreateMBean(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()StringgetClassName()The fully qualified name of the Java class of the MBean described by this descriptor.StringgetDescription()StringgetDomain()StringgetGroup()MethodgetInvoke(String aname, Object[] params, String[] signature, BaseModelMBean bean, Object resource)StringgetName()NotificationInfo[]getNotifications()OperationInfo[]getOperations()MethodgetSetter(String aname, BaseModelMBean bean, Object resource)StringgetType()voidsetClassName(String className)voidsetDescription(String description)voidsetDomain(String domain)voidsetGroup(String group)voidsetName(String name)voidsetType(String type)StringtoString()Return a string representation of this managed bean.
-
-
-
Method Detail
-
getAttributes
public AttributeInfo[] getAttributes()
- Returns:
- the collection of attributes for this MBean.
-
getClassName
public 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(String className)
-
getDescription
public String getDescription()
- Returns:
- the human-readable description of this MBean.
-
setDescription
public void setDescription(String description)
-
getDomain
public String getDomain()
- Returns:
- the (optional)
ObjectNamedomain in which this MBean should be registered in the MBeanServer.
-
setDomain
public void setDomain(String domain)
-
getGroup
public String getGroup()
- Returns:
- the (optional) group to which this MBean belongs.
-
setGroup
public void setGroup(String group)
-
getName
public String getName()
- Returns:
- the name of this managed bean, which must be unique among all MBeans managed by a particular MBeans server.
-
setName
public void setName(String name)
-
getNotifications
public NotificationInfo[] getNotifications()
- Returns:
- the collection of notifications for this MBean.
-
getOperations
public OperationInfo[] getOperations()
- Returns:
- the collection of operations for this MBean.
-
getType
public String 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
public void setType(String type)
-
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 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
public String toString()
Return a string representation of this managed bean.
-
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:
MBeanExceptionReflectionException
-
-