org.apache.commons.modeler
Class ManagedBean

java.lang.Object
  extended by org.apache.commons.modeler.ManagedBean
All Implemented Interfaces:
Serializable

public class ManagedBean
extends Object
implements Serializable

Internal configuration information for a managed bean (MBean) descriptor.

Version:
$Revision$ $Date$
Author:
Craig R. McClanahan
See Also:
Serialized Form

Field Summary
protected  org.apache.commons.modeler.AttributeInfo[] attributes
           
protected  String className
           
protected  org.apache.commons.modeler.ConstructorInfo[] constructors
           
protected  String description
           
protected  String domain
           
protected  List fields
           
protected  String group
           
protected  String name
           
protected  org.apache.commons.modeler.NotificationInfo[] notifications
           
protected  org.apache.commons.modeler.OperationInfo[] operations
           
protected  String type
           
 
Constructor Summary
ManagedBean()
          Constructor.
 
Method Summary
 void addAttribute(org.apache.commons.modeler.AttributeInfo attribute)
          Add a new attribute to the set of attributes for this MBean.
 void addConstructor(org.apache.commons.modeler.ConstructorInfo constructor)
          Add a new constructor to the set of constructors for this MBean.
 void addField(org.apache.commons.modeler.FieldInfo field)
          Add a new field to the fields associated with the Descriptor that will be created from this metadata.
 void addNotification(org.apache.commons.modeler.NotificationInfo notification)
          Add a new notification to the set of notifications for this MBean.
 void addOperation(org.apache.commons.modeler.OperationInfo operation)
          Add a new operation to the set of operations for this MBean.
 ModelMBean createMBean()
          Create and return a ModelMBean that has been preconfigured with the ModelMBeanInfo information for this managed bean, but is not associated with any particular managed resource.
 ModelMBean createMBean(Object instance)
          Create and return a ModelMBean that has been preconfigured with the ModelMBeanInfo information for this managed bean, and is associated with the specified managed object instance.
 ModelMBeanInfo createMBeanInfo()
          Create and return a ModelMBeanInfo object that describes this entire managed bean.
 org.apache.commons.modeler.AttributeInfo[] getAttributes()
          The collection of attributes for this MBean.
 String getClassName()
          The fully qualified name of the Java class of the MBean described by this descriptor.
 org.apache.commons.modeler.ConstructorInfo[] getConstructors()
          The collection of constructors for this MBean.
 String getDescription()
          The human-readable description of this MBean.
 String getDomain()
          The (optional) ObjectName domain in which this MBean should be registered in the MBeanServer.
 List getFields()
          Return a List of the FieldInfo objects for the name/value pairs that should be added to the Descriptor created from this metadata.
 String getGroup()
          The (optional) group to which this MBean belongs.
 String getName()
          The name of this managed bean, which must be unique among all MBeans managed by a particular MBeans server.
 org.apache.commons.modeler.NotificationInfo[] getNotifications()
          The collection of notifications for this MBean.
 org.apache.commons.modeler.OperationInfo[] getOperations()
          The collection of operations for this MBean.
 String getType()
          The fully qualified name of the Java class of the resource implementation class described by the managed bean described by this descriptor.
 void setClassName(String className)
           
 void setDescription(String description)
           
 void setDomain(String domain)
           
 void setGroup(String group)
           
 void setName(String name)
           
 void setType(String type)
           
 String toString()
          Return a string representation of this managed bean.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

attributes

protected org.apache.commons.modeler.AttributeInfo[] attributes

className

protected String className

constructors

protected org.apache.commons.modeler.ConstructorInfo[] constructors

description

protected String description

domain

protected String domain

group

protected String group

name

protected String name

fields

protected List fields

notifications

protected org.apache.commons.modeler.NotificationInfo[] notifications

operations

protected org.apache.commons.modeler.OperationInfo[] operations

type

protected String type
Constructor Detail

ManagedBean

public ManagedBean()
Constructor. Will add default attributes.

Method Detail

getAttributes

public org.apache.commons.modeler.AttributeInfo[] getAttributes()
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.


setClassName

public void setClassName(String className)

getConstructors

public org.apache.commons.modeler.ConstructorInfo[] getConstructors()
The collection of constructors for this MBean.


getDescription

public String getDescription()
The human-readable description of this MBean.


setDescription

public void setDescription(String description)

getDomain

public String getDomain()
The (optional) ObjectName domain in which this MBean should be registered in the MBeanServer.


setDomain

public void setDomain(String domain)

getFields

public List getFields()

Return a List of the FieldInfo objects for the name/value pairs that should be added to the Descriptor created from this metadata.


getGroup

public String getGroup()
The (optional) group to which this MBean belongs.


setGroup

public void setGroup(String group)

getName

public 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(String name)

getNotifications

public org.apache.commons.modeler.NotificationInfo[] getNotifications()
The collection of notifications for this MBean.


getOperations

public org.apache.commons.modeler.OperationInfo[] getOperations()
The collection of operations for this MBean.


getType

public 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(String type)

addAttribute

public void addAttribute(org.apache.commons.modeler.AttributeInfo attribute)
Add a new attribute to the set of attributes for this MBean.

Parameters:
attribute - The new attribute descriptor

addConstructor

public void addConstructor(org.apache.commons.modeler.ConstructorInfo constructor)
Add a new constructor to the set of constructors for this MBean.

Parameters:
constructor - The new constructor descriptor

addField

public void addField(org.apache.commons.modeler.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(org.apache.commons.modeler.NotificationInfo notification)
Add a new notification to the set of notifications for this MBean.

Parameters:
notification - The new notification descriptor

addOperation

public void addOperation(org.apache.commons.modeler.OperationInfo operation)
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,
                              RuntimeOperationsException
Create and return a ModelMBean that has been preconfigured with the ModelMBeanInfo information for this managed bean, but is not associated with any particular managed resource. The returned ModelMBean will NOT have been registered with our MBeanServer.

Throws:
InstanceNotFoundException - if the managed resource object cannot be found
InvalidTargetObjectTypeException - if our MBean cannot handle object references (should never happen)
MBeanException - if a problem occurs instantiating the ModelMBean instance
RuntimeOperationsException - if a JMX runtime error occurs

createMBean

public ModelMBean createMBean(Object instance)
                       throws InstanceNotFoundException,
                              InvalidTargetObjectTypeException,
                              MBeanException,
                              RuntimeOperationsException
Create and return a ModelMBean that has been preconfigured with the ModelMBeanInfo information for this managed bean, and is associated with the specified managed object instance. The returned ModelMBean will NOT have been registered with our MBeanServer.

Parameters:
instance - Instanced of the managed object, or null for no associated instance
Throws:
InstanceNotFoundException - if the managed resource object cannot be found
InvalidTargetObjectTypeException - if our MBean cannot handle object references (should never happen)
MBeanException - if a problem occurs instantiating the ModelMBean instance
RuntimeOperationsException - if a JMX runtime error occurs

createMBeanInfo

public ModelMBeanInfo createMBeanInfo()
Create and return a ModelMBeanInfo object that describes this entire managed bean.


toString

public String toString()
Return a string representation of this managed bean.

Overrides:
toString in class Object


Copyright © 2010 OW2 Consortium. All Rights Reserved.