Top Description Fields Constructors Methods
net.sf.ehcache.statistics.beans

public Class ProxiedDynamicMBean

extends Object
implements DynamicMBean
Class Inheritance
All Implemented Interfaces
javax.management.DynamicMBean
Known Direct Subclasses
net.sf.ehcache.statistics.beans.ExtendedStatisticsMBean
Imports
java.util.ArrayList, .Collection, .Map, .TreeMap, javax.management.Attribute, .AttributeList, .AttributeNotFoundException, .DynamicMBean, .InvalidAttributeValueException, .MBeanAttributeInfo, .MBeanException, .MBeanInfo, .ReflectionException

The ProxiedDynamicMBean. Supports truly dynamic mbeans in an easy manner.
Author
cschanck

Field Summary

Modifier and TypeField and Description
private ArrayList<MBeanAttributeInfo>
private final String
private final String
private final TreeMap<String, AttributeProxy<T>>
private MBeanInfo

Constructor Summary

AccessConstructor and Description
public
ProxiedDynamicMBean(String
the bean name
beanName
,
String
the bean description
beanDescription
,
Collection<AttributeProxy<T>>
the attribute standins
attributeStandins
)

Instantiates a new proxied dynamic m bean.

Method Summary

Modifier and TypeMethod and Description
public Object
getAttribute(String
The name of the attribute to be retrieved
name
)

Implements javax.management.DynamicMBean.getAttribute.

Get a specific attribtue
public AttributeList
getAttributes(String[]
A list of the attributes to be retrieved.
names
)

Implements javax.management.DynamicMBean.getAttributes.

Get a list of attributes.
public String

Returns:

the bean name
getBeanName
()

Gets the bean name.

public MBeanInfo
getMBeanInfo()

Implements javax.management.DynamicMBean.getMBeanInfo.

Accessor for mbean info
public void
initialize(Collection<AttributeProxy<T>>
the attribute standins
attributeStandins
)

Initialize.

public Object
invoke(String
The name of the action to be invoked.
name
,
Object[]
An array containing the parameters to be set when the action is invoked.
args
,
String[]
An array containing the signature of the action. The class objects will be loaded through the same class loader as the one used for loading the MBean on which the action is invoked.
sig
)

Implements javax.management.DynamicMBean.invoke.

Not implemented.
public void
setAttribute(Attribute
The identification of the attribute to be set and the value it is to be set to.
attribute
)

Implements javax.management.DynamicMBean.setAttribute.

Set an attribtue by name
public AttributeList
setAttributes(AttributeList
A list of attributes: The identification of the attributes to be set and the values they are to be set to.
list
)

Implements javax.management.DynamicMBean.setAttributes.

Set an attribute list.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

attributeInfoListback to summary
private ArrayList<MBeanAttributeInfo> attributeInfoList
beanDescriptionback to summary
private final String beanDescription
beanNameback to summary
private final String beanName
mapback to summary
private final TreeMap<String, AttributeProxy<T>> map
mbiback to summary
private MBeanInfo mbi

Constructor Detail

ProxiedDynamicMBeanback to summary
public ProxiedDynamicMBean(String beanName, String beanDescription, Collection<AttributeProxy<T>> attributeStandins)

Instantiates a new proxied dynamic m bean.

Parameters
beanName:String

the bean name

beanDescription:String

the bean description

attributeStandins:Collection<AttributeProxy<T>>

the attribute standins

Method Detail

getAttributeback to summary
public Object getAttribute(String name) throws AttributeNotFoundException

Implements javax.management.DynamicMBean.getAttribute.

Get a specific attribtue

Parameters
name:String

Doc from javax.management.DynamicMBean.getAttribute.

The name of the attribute to be retrieved

Returns:Object

Doc from javax.management.DynamicMBean.getAttribute.

The value of the attribute retrieved.

Exceptions
AttributeNotFoundException:

Doc from javax.management.DynamicMBean.getAttribute.

if specified attribute does not exist or cannot be retrieved

getAttributesback to summary
public AttributeList getAttributes(String[] names)

Implements javax.management.DynamicMBean.getAttributes.

Get a list of attributes.

Parameters
names:String[]

Doc from javax.management.DynamicMBean.getAttributes.

A list of the attributes to be retrieved.

Returns:AttributeList

Doc from javax.management.DynamicMBean.getAttributes.

The list of attributes retrieved.

getBeanNameback to summary
public String getBeanName()

Gets the bean name.

Returns:String

the bean name

getMBeanInfoback to summary
public MBeanInfo getMBeanInfo()

Implements javax.management.DynamicMBean.getMBeanInfo.

Accessor for mbean info

Returns:MBeanInfo

Doc from javax.management.DynamicMBean.getMBeanInfo.

An instance of MBeanInfo allowing all attributes and actions exposed by this Dynamic MBean to be retrieved.

initializeback to summary
public void initialize(Collection<AttributeProxy<T>> attributeStandins)

Initialize.

Parameters
attributeStandins:Collection<AttributeProxy<T>>

the attribute standins

invokeback to summary
public Object invoke(String name, Object[] args, String[] sig) throws MBeanException, ReflectionException

Implements javax.management.DynamicMBean.invoke.

Not implemented.

Parameters
name:String

Doc from javax.management.DynamicMBean.invoke.

The name of the action to be invoked.

args:Object[]

Doc from javax.management.DynamicMBean.invoke.

An array containing the parameters to be set when the action is invoked.

sig:String[]

Doc from javax.management.DynamicMBean.invoke.

An array containing the signature of the action. The class objects will be loaded through the same class loader as the one used for loading the MBean on which the action is invoked.

Returns:Object

Doc from javax.management.DynamicMBean.invoke.

The object returned by the action, which represents the result of invoking the action on the MBean specified.

Exceptions
MBeanException:

Doc from javax.management.DynamicMBean.invoke.

Wraps a java.lang.Exception thrown by the MBean's invoked method.

ReflectionException:

Doc from javax.management.DynamicMBean.invoke.

Wraps a java.lang.Exception thrown while trying to invoke the method

setAttributeback to summary
public void setAttribute(Attribute attribute) throws InvalidAttributeValueException, MBeanException, AttributeNotFoundException

Implements javax.management.DynamicMBean.setAttribute.

Set an attribtue by name

Parameters
attribute:Attribute

Doc from javax.management.DynamicMBean.setAttribute.

The identification of the attribute to be set and the value it is to be set to.

Exceptions
InvalidAttributeValueException:

Doc from javax.management.DynamicMBean.setAttribute.

if value specified is not valid for the attribute

MBeanException:

Doc from javax.management.DynamicMBean.setAttribute.

Wraps a java.lang.Exception thrown by the MBean's setter.

AttributeNotFoundException:

Doc from javax.management.DynamicMBean.setAttribute.

if specified attribute does not exist or cannot be retrieved

setAttributesback to summary
public AttributeList setAttributes(AttributeList list)

Implements javax.management.DynamicMBean.setAttributes.

Set an attribute list.

Parameters
list:AttributeList

Doc from javax.management.DynamicMBean.setAttributes.

A list of attributes: The identification of the attributes to be set and the values they are to be set to.

Returns:AttributeList

Doc from javax.management.DynamicMBean.setAttributes.

The list of attributes that were set, with their new values.