Package org.apache.commons.modeler
Class ManagedBean
- java.lang.Object
-
- org.apache.commons.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.
- Version:
- $Revision: 480402 $ $Date: 2006-11-29 04:43:23 +0000 (Wed, 29 Nov 2006) $
- Author:
- Craig R. McClanahan
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected AttributeInfo[]attributesprotected java.lang.StringclassNameprotected ConstructorInfo[]constructorsprotected java.lang.Stringdescriptionprotected java.lang.Stringdomainprotected java.util.Listfieldsprotected java.lang.Stringgroup(package private) javax.management.modelmbean.ModelMBeanInfoinfoTheModelMBeanInfoobject that corresponds to thisManagedBeaninstance.protected java.lang.Stringnameprotected NotificationInfo[]notificationsprotected OperationInfo[]operationsprotected java.lang.Stringtype
-
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.voidaddConstructor(ConstructorInfo constructor)Add a new constructor to the set of constructors for this MBean.voidaddField(FieldInfo field)Add a new field to the fields associated with the Descriptor that will be created from this metadata.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.modelmbean.ModelMBeancreateMBean()Create and return aModelMBeanthat has been preconfigured with theModelMBeanInfoinformation for this managed bean, but is not associated with any particular managed resource.javax.management.modelmbean.ModelMBeancreateMBean(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.javax.management.modelmbean.ModelMBeanInfocreateMBeanInfo()Create and return aModelMBeanInfoobject that describes this entire managed bean.AttributeInfo[]getAttributes()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.ConstructorInfo[]getConstructors()The collection of constructors for this MBean.java.lang.StringgetDescription()The human-readable description of this MBean.java.lang.StringgetDomain()The (optional)ObjectNamedomain in which this MBean should be registered in the MBeanServer.java.util.ListgetFields()Return aListof theFieldInfoobjects for the name/value pairs that should be added to the Descriptor created from this metadata.java.lang.StringgetGroup()The (optional) group to which this MBean belongs.java.lang.StringgetName()The name of this managed bean, which must be unique among all MBeans managed by a particular MBeans server.NotificationInfo[]getNotifications()The collection of notifications for this MBean.OperationInfo[]getOperations()The collection of operations for this MBean.java.lang.StringgetType()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)voidsetDescription(java.lang.String description)voidsetDomain(java.lang.String domain)voidsetGroup(java.lang.String group)voidsetName(java.lang.String name)voidsetType(java.lang.String type)java.lang.StringtoString()Return a string representation of this managed bean.
-
-
-
Field Detail
-
info
transient javax.management.modelmbean.ModelMBeanInfo info
TheModelMBeanInfoobject that corresponds to thisManagedBeaninstance.
-
attributes
protected AttributeInfo[] attributes
-
className
protected java.lang.String className
-
constructors
protected ConstructorInfo[] constructors
-
description
protected java.lang.String description
-
domain
protected java.lang.String domain
-
group
protected java.lang.String group
-
name
protected java.lang.String name
-
fields
protected java.util.List fields
-
notifications
protected NotificationInfo[] notifications
-
operations
protected OperationInfo[] operations
-
type
protected java.lang.String type
-
-
Method Detail
-
getAttributes
public AttributeInfo[] getAttributes()
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.
-
setClassName
public void setClassName(java.lang.String className)
-
getConstructors
public ConstructorInfo[] getConstructors()
The collection of constructors for this MBean.
-
getDescription
public java.lang.String getDescription()
The human-readable description of this MBean.
-
setDescription
public void setDescription(java.lang.String description)
-
getDomain
public java.lang.String getDomain()
The (optional)ObjectNamedomain in which this MBean should be registered in the MBeanServer.
-
setDomain
public void setDomain(java.lang.String domain)
-
getFields
public java.util.List getFields()
Return a
Listof theFieldInfoobjects for the name/value pairs that should be added to the Descriptor created from this metadata.
-
getGroup
public java.lang.String getGroup()
The (optional) group to which this MBean belongs.
-
setGroup
public void setGroup(java.lang.String group)
-
getName
public java.lang.String getName()
The name of this managed bean, which must be unique among all MBeans managed by a particular MBeans server.
-
setName
public void setName(java.lang.String name)
-
getNotifications
public NotificationInfo[] getNotifications()
The collection of notifications for this MBean.
-
getOperations
public OperationInfo[] getOperations()
The collection of operations for this MBean.
-
getType
public java.lang.String getType()
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(java.lang.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
-
addConstructor
public void addConstructor(ConstructorInfo constructor)
Add a new constructor to the set of constructors for this MBean.- Parameters:
constructor- The new constructor descriptor
-
addField
public void addField(FieldInfo field)
Add a new field to the fields associated with the Descriptor that will be created from this metadata.
- Parameters:
field- The field to be added
-
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.modelmbean.ModelMBean createMBean() throws javax.management.InstanceNotFoundException, javax.management.modelmbean.InvalidTargetObjectTypeException, javax.management.MBeanException, javax.management.RuntimeOperationsExceptionCreate and return aModelMBeanthat has been preconfigured with theModelMBeanInfoinformation for this managed bean, but is not associated with any particular managed resource. The returnedModelMBeanwill NOT have been registered with ourMBeanServer.- Throws:
javax.management.InstanceNotFoundException- if the managed resource object cannot be foundjavax.management.modelmbean.InvalidTargetObjectTypeException- if our MBean cannot handle object references (should never happen)javax.management.MBeanException- if a problem occurs instantiating theModelMBeaninstancejavax.management.RuntimeOperationsException- if a JMX runtime error occurs
-
createMBean
public javax.management.modelmbean.ModelMBean createMBean(java.lang.Object instance) throws javax.management.InstanceNotFoundException, javax.management.modelmbean.InvalidTargetObjectTypeException, 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- Throws:
javax.management.InstanceNotFoundException- if the managed resource object cannot be foundjavax.management.modelmbean.InvalidTargetObjectTypeException- if our MBean cannot handle object references (should never happen)javax.management.MBeanException- if a problem occurs instantiating theModelMBeaninstancejavax.management.RuntimeOperationsException- if a JMX runtime error occurs
-
createMBeanInfo
public javax.management.modelmbean.ModelMBeanInfo createMBeanInfo()
Create and return aModelMBeanInfoobject that describes this entire managed bean.
-
toString
public java.lang.String toString()
Return a string representation of this managed bean.- Overrides:
toStringin classjava.lang.Object
-
-