Top Description Fields Constructors Methods
org.apache.tomcat.util.modeler

public Class ManagedBean

extends Object
implements Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable
Known Direct Subclasses
org.apache.tomcat.util.modeler.NoDescriptorRegistry.PassthroughMBean
Imports
java.lang.reflect.Method, java.util.HashMap, .Map, java.util.concurrent.locks.ReadWriteLock, .ReentrantReadWriteLock, javax.management.AttributeNotFoundException, .DynamicMBean, .InstanceNotFoundException, .MBeanAttributeInfo, .MBeanConstructorInfo, .MBeanException, .MBeanInfo, .MBeanNotificationInfo, .MBeanOperationInfo, .ReflectionException, .RuntimeOperationsException, .ServiceNotFoundException, org.apache.tomcat.util.buf.StringUtils, org.apache.tomcat.util.res.StringManager

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

Author
Craig R. McClanahan

Field Summary

Modifier and TypeField and Description
private Map<String, AttributeInfo>
private static final String
protected String
protected String
protected String
protected String
private transient volatile MBeanInfo
info

The ModelMBeanInfo object that corresponds to this ManagedBean instance.

private final ReadWriteLock
protected String
pack-priv static final Class<?>[]
private NotificationInfo[]
private Map<String, OperationInfo>
private static final long
private static final StringManager
protected String

Constructor Summary

AccessConstructor and Description
public
ManagedBean()

Constructor.

Method Summary

Modifier and TypeMethod and Description
public void
addAttribute(AttributeInfo
The new attribute descriptor
attribute
)

Add a new attribute to the set of attributes for this MBean.

public void
addNotification(NotificationInfo
The new notification descriptor
notification
)

Add a new notification to the set of notifications for this MBean.

public void
addOperation(OperationInfo
The new operation descriptor
operation
)

Add a new operation to the set of operations for this MBean.

public DynamicMBean

Returns:

the MBean
createMBean
(Object
Instanced of the managed object, or null for no associated instance
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.

private String
private String
createOperationKey(String methodName, String[] parameterTypes)

public AttributeInfo[]

Returns:

the collection of attributes for this MBean.
getAttributes
()

public String

Returns:

the class name
getClassName
()

The fully qualified name of the Java class of the MBean described by this descriptor.

public String

Returns:

the human-readable description of this MBean.
getDescription
()

public String

Returns:

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

pack-priv Method
getGetter(String aname, BaseModelMBean mbean, Object resource)

public String

Returns:

the (optional) group to which this MBean belongs.
getGroup
()

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

pack-priv MBeanInfo

Returns:

the MBean info
getMBeanInfo
()

Create and return a ModelMBeanInfo object that describes this entire managed bean.

public String

Returns:

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

public NotificationInfo[]

Returns:

the collection of notifications for this MBean.
getNotifications
()

public OperationInfo[]

Returns:

the collection of operations for this MBean.
getOperations
()

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

public String

Returns:

the fully qualified name of the Java class of the resource implementation class described by the managed bean described by this descriptor.
getType
()

public void
setClassName(String className)

public void
setDescription(String description)

public void
setDomain(String domain)

public void
public void
public void
public String
toString()

Overrides java.lang.Object.toString.

Return a string representation of this managed bean.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

attributesback to summary
private Map<String, AttributeInfo> attributes
BASE_MBEANback to summary
private static final String BASE_MBEAN
classNameback to summary
protected String className
descriptionback to summary
protected String description
domainback to summary
protected String domain
groupback to summary
protected String group
infoback to summary
private transient volatile MBeanInfo info

The ModelMBeanInfo object that corresponds to this ManagedBean instance.

mBeanInfoLockback to summary
private final ReadWriteLock mBeanInfoLock
nameback to summary
protected String name
NO_ARGS_PARAM_SIGback to summary
pack-priv static final Class<?>[] NO_ARGS_PARAM_SIG
notificationsback to summary
private NotificationInfo[] notifications
operationsback to summary
private Map<String, OperationInfo> operations
serialVersionUIDback to summary
private static final long serialVersionUID
smback to summary
private static final StringManager sm
typeback to summary
protected String type

Constructor Detail

ManagedBeanback to summary
public ManagedBean()

Constructor. Will add default attributes.

Method Detail

addAttributeback to summary
public void addAttribute(AttributeInfo attribute)

Add a new attribute to the set of attributes for this MBean.

Parameters
attribute:AttributeInfo

The new attribute descriptor

addNotificationback to summary
public void addNotification(NotificationInfo notification)

Add a new notification to the set of notifications for this MBean.

Parameters
notification:NotificationInfo

The new notification descriptor

addOperationback to summary
public void addOperation(OperationInfo operation)

Add a new operation to the set of operations for this MBean.

Parameters
operation:OperationInfo

The new operation descriptor

createMBeanback to summary
public DynamicMBean createMBean(Object instance) throws InstanceNotFoundException, 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:Object

Instanced of the managed object, or null for no associated instance

Returns:DynamicMBean

the MBean

Exceptions
InstanceNotFoundException:
if the managed resource object cannot be found
MBeanException:
if a problem occurs instantiating the ModelMBean instance
RuntimeOperationsException:
if a JMX runtime error occurs
createOperationKeyback to summary
private String createOperationKey(OperationInfo operation)
createOperationKeyback to summary
private String createOperationKey(String methodName, String[] parameterTypes)
getAttributesback to summary
public AttributeInfo[] getAttributes()
Returns:AttributeInfo[]

the collection of attributes for this MBean.

getClassNameback to summary
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:String

the class name

getDescriptionback to summary
public String getDescription()
Returns:String

the human-readable description of this MBean.

getDomainback to summary
public String getDomain()
Returns:String

the (optional) ObjectName domain in which this MBean should be registered in the MBeanServer.

getGetterback to summary
pack-priv Method getGetter(String aname, BaseModelMBean mbean, Object resource) throws AttributeNotFoundException, ReflectionException
getGroupback to summary
public String getGroup()
Returns:String

the (optional) group to which this MBean belongs.

getInvokeback to summary
public Method getInvoke(String aname, Object[] params, String[] signature, BaseModelMBean bean, Object resource) throws MBeanException, ReflectionException
getMBeanInfoback to summary
pack-priv MBeanInfo getMBeanInfo()

Create and return a ModelMBeanInfo object that describes this entire managed bean.

Returns:MBeanInfo

the MBean info

getNameback to summary
public String getName()
Returns:String

the name of this managed bean, which must be unique among all MBeans managed by a particular MBeans server.

getNotificationsback to summary
public NotificationInfo[] getNotifications()
Returns:NotificationInfo[]

the collection of notifications for this MBean.

getOperationsback to summary
public OperationInfo[] getOperations()
Returns:OperationInfo[]

the collection of operations for this MBean.

getSetterback to summary
public Method getSetter(String aname, BaseModelMBean bean, Object resource) throws AttributeNotFoundException, ReflectionException
getTypeback to summary
public String getType()
Returns:String

the fully qualified name of the Java class of the resource implementation class described by the managed bean described by this descriptor.

setClassNameback to summary
public void setClassName(String className)
setDescriptionback to summary
public void setDescription(String description)
setDomainback to summary
public void setDomain(String domain)
setGroupback to summary
public void setGroup(String group)
setNameback to summary
public void setName(String name)
setTypeback to summary
public void setType(String type)
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Return a string representation of this managed bean.

Returns:String

Doc from java.lang.Object.toString.

a string representation of the object

Annotations
@Override