org.apache.tomcat.util.modeler

Class ManagedBean

public class ManagedBean extends Object implements Serializable

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

Version: $Revision: 610929 $ $Date: 2008-01-10 22:04:31 +0100 (Thu, 10 Jan 2008) $

Author: Craig R. McClanahan

Field Summary
protected StringclassName
protected Stringdescription
protected Stringdomain
protected Stringgroup
protected Stringname
protected NotificationInfo[]notifications
protected Stringtype
Constructor Summary
ManagedBean()
Constructor.
Method Summary
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()
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.
DynamicMBeancreateMBean(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.
AttributeInfo[]getAttributes()
The collection of attributes for this MBean.
StringgetClassName()
The fully qualified name of the Java class of the MBean described by this descriptor.
StringgetDescription()
The human-readable description of this MBean.
StringgetDomain()
The (optional) ObjectName domain in which this MBean should be registered in the MBeanServer.
StringgetGroup()
The (optional) group to which this MBean belongs.
MethodgetInvoke(String aname, Object[] params, String[] signature, BaseModelMBean bean, Object resource)
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.
MethodgetSetter(String aname, BaseModelMBean bean, Object resource)
StringgetType()
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)
voidsetDomain(String domain)
voidsetGroup(String group)
voidsetName(String name)
voidsetType(String type)
StringtoString()
Return a string representation of this managed bean.

Field Detail

className

protected String className

description

protected String description

domain

protected String domain

group

protected String group

name

protected String name

notifications

protected NotificationInfo[] notifications

type

protected String type

Constructor Detail

ManagedBean

public ManagedBean()
Constructor. Will add default attributes.

Method Detail

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()
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 DynamicMBean 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. 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

getAttributes

public 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.

getDescription

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

getDomain

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

getGroup

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

getInvoke

public Method getInvoke(String aname, Object[] params, String[] signature, BaseModelMBean bean, Object resource)

getName

public String getName()
The name of this managed bean, which must be unique among all MBeans managed by a particular MBeans server.

getNotifications

public NotificationInfo[] getNotifications()
The collection of notifications for this MBean.

getOperations

public OperationInfo[] getOperations()
The collection of operations for this MBean.

getSetter

public Method getSetter(String aname, BaseModelMBean bean, Object resource)

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.

setClassName

public void setClassName(String className)

setDescription

public void setDescription(String description)

setDomain

public void setDomain(String domain)

setGroup

public void setGroup(String group)

setName

public void setName(String name)

setType

public void setType(String type)

toString

public String toString()
Return a string representation of this managed bean.
Copyright © 2000-2011 Apache Software Foundation. All Rights Reserved.