Package org.apache.commons.modeler
Class ManagedBean
java.lang.Object
org.apache.commons.modeler.ManagedBean
- All Implemented Interfaces:
Serializable
Internal 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:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected AttributeInfo[]protected Stringprotected ConstructorInfo[]protected Stringprotected Stringprotected Listprotected String(package private) ModelMBeanInfoTheModelMBeanInfoobject that corresponds to thisManagedBeaninstance.protected Stringprotected NotificationInfo[]protected OperationInfo[]protected String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddAttribute(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.voidAdd 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.Create and return aModelMBeanthat has been preconfigured with theModelMBeanInfoinformation for this managed bean, but is not associated with any particular managed resource.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.Create and return aModelMBeanInfoobject that describes this entire managed bean.The collection of attributes for this MBean.The fully qualified name of the Java class of the MBean described by this descriptor.The collection of constructors for this MBean.The human-readable description of this MBean.The (optional)ObjectNamedomain in which this MBean should be registered in the MBeanServer.Return aListof theFieldInfoobjects for the name/value pairs that should be added to the Descriptor created from this metadata.getGroup()The (optional) group to which this MBean belongs.getName()The name of this managed bean, which must be unique among all MBeans managed by a particular MBeans server.The collection of notifications for this MBean.The collection of operations for this MBean.getType()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) voidsetDescription(String description) voidvoidvoidvoidtoString()Return a string representation of this managed bean.
-
Field Details
-
info
TheModelMBeanInfoobject that corresponds to thisManagedBeaninstance. -
attributes
-
className
-
constructors
-
description
-
domain
-
group
-
name
-
fields
-
notifications
-
operations
-
type
-
-
Constructor Details
-
ManagedBean
public ManagedBean()Constructor. Will add default attributes.
-
-
Method Details
-
getAttributes
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. -
setClassName
-
getConstructors
The collection of constructors for this MBean. -
getDescription
The human-readable description of this MBean. -
setDescription
-
getDomain
The (optional)ObjectNamedomain in which this MBean should be registered in the MBeanServer. -
setDomain
-
getFields
Return a
Listof theFieldInfoobjects for the name/value pairs that should be added to the Descriptor created from this metadata. -
getGroup
The (optional) group to which this MBean belongs. -
setGroup
-
getName
The name of this managed bean, which must be unique among all MBeans managed by a particular MBeans server. -
setName
-
getNotifications
The collection of notifications for this MBean. -
getOperations
The collection of operations for this MBean. -
getType
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
-
addConstructor
Add a new constructor to the set of constructors for this MBean.- Parameters:
constructor- The new constructor descriptor
-
addField
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
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 ModelMBean createMBean() throws InstanceNotFoundException, InvalidTargetObjectTypeException, MBeanException, 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:
InstanceNotFoundException- if the managed resource object cannot be foundInvalidTargetObjectTypeException- if our MBean cannot handle object references (should never happen)MBeanException- if a problem occurs instantiating theModelMBeaninstanceRuntimeOperationsException- if a JMX runtime error occurs
-
createMBean
public ModelMBean createMBean(Object instance) throws InstanceNotFoundException, InvalidTargetObjectTypeException, 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- Throws:
InstanceNotFoundException- if the managed resource object cannot be foundInvalidTargetObjectTypeException- if our MBean cannot handle object references (should never happen)MBeanException- if a problem occurs instantiating theModelMBeaninstanceRuntimeOperationsException- if a JMX runtime error occurs
-
createMBeanInfo
Create and return aModelMBeanInfoobject that describes this entire managed bean. -
toString
Return a string representation of this managed bean.
-