Package com.germinus.easyconf.jmx

# Class ComponentConfigurationDynamicMBean

java.lang.Object
com.germinus.easyconf.jmx.ComponentConfigurationDynamicMBean

All Implemented Interfaces:
  `DynamicMBean`

public class ComponentConfigurationDynamicMBean extends Object implements DynamicMBean
MBean wrapper for a ComponentConfiguration. View Source

Version:
  $Revision: 1.4 $
Author:
  Alvaro Gonz�lez

## Field Summary

Fields
Modifier and Type
Field
Description
`private MBeanAttributeInfo[]`
`attributesInfo`
`private ComponentConfiguration`
`componentConfiguration`
`private String`
`componentName`
`private static final String`
`CONSTRUCTOR_DESCRIPTION_1`
`private MBeanConstructorInfo[]`
`constructorsInfo`
`private Map`
`modifiedProperties`
`private static final String`
`NEW_PROPERTY_OPERATION_DESCRIPTION_1`
`private static final String`
`NEW_PROPERTY_OPERATION_DESCRIPTION_2`
`static final String`
`NEW_PROPERTY_OPERATION_NAME`
Name of the newProperty operations.
`static final String[]`
`NEW_PROPERTY_OPERATION_SIGNATURE_1`
Signature of the newProperty operation with one parameter.
`static final String[]`
`NEW_PROPERTY_OPERATION_SIGNATURE_2`
Signature of the newProperty operation with two parameters.
`private Map`
`newPropeties`
`private MBeanOperationInfo[]`
`operationInfo`
`private static final String`
`RELOAD_OPERATION_DESCRIPTION`
`static final String`
`RELOAD_OPERATION_NAME`
Name of the reloadConfiguration operation.
`static final String[]`
`RELOAD_OPERATION_SIGNATURE`
Signature of the reloadConfiguration operation.

## Constructor Summary

Constructors
Constructor
Description
`ComponentConfigurationDynamicMBean(ComponentConfiguration component)`
Create a MBean wraping some loaded ComponentConfiguration
`ComponentConfigurationDynamicMBean(String componentName)`
Loads and wraps a ComponentConfiguration

## Method Summary

Modifier and Type
Method
Description
`Object`
`getAttribute(String attributeName)`
Obtains the component attributes from the ComponentCongiguration
`protected MBeanAttributeInfo[]`
`getAttributeInfo()`
Constructs the info of the MBean's attributes.
`AttributeList`
`getAttributes(String[] attributesNames)`
List named attributes
`protected ComponentConfiguration`
`getComponentConfiguration()`
Returns the ComponentConfiguration associated with this MBean.
`protected MBeanConstructorInfo[]`
`getConsturctorsInfo()`
Constructs an array of the MBean's constructors.
`MBeanInfo`
`getMBeanInfo()`
Return the Information exposed by the MBean: Attributes, Operations, Constructors and Notifications.
`protected MBeanOperationInfo[]`
`getOperationInfo()`
Constructs the info of the MBean's operations.
`private void`
`init()`
Some initializations common to both constructors
`Object`
`invoke(String operationName, Object[] params, String[] signature)`
Invoke one of the operations exposed by the MBeanas.
`private void`
`newProperty(String propertyName)`
`private void`
`newProperty(String propertyName, Object value)`
`private boolean`
`propertyExists(String property)`
`private void`
`reloadConfiguration()`
`void`
`setAttribute(Attribute attribute)`
Sets an attribute
`AttributeList`
`setAttributes(AttributeList attributes)`
Set named attributes
`protected void`
`setComponentConfiguration(ComponentConfiguration componentConfiguration)`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Field Details

### RELOAD_OPERATION_NAME

public static final String RELOAD_OPERATION_NAME
Name of the reloadConfiguration operation. Used when invoking `invoke` method.

See Also:
  - Constant Field Values

### NEW_PROPERTY_OPERATION_NAME

public static final String NEW_PROPERTY_OPERATION_NAME
Name of the newProperty operations. Used when invoking `invoke` method.

See Also:
  - Constant Field Values

### RELOAD_OPERATION_SIGNATURE

public static final String[] RELOAD_OPERATION_SIGNATURE
Signature of the reloadConfiguration operation. Used when invoking `invoke` method.

### NEW_PROPERTY_OPERATION_SIGNATURE_1

public static final String[] NEW_PROPERTY_OPERATION_SIGNATURE_1
Signature of the newProperty operation with one parameter. Used when invoking `invoke` method.

### NEW_PROPERTY_OPERATION_SIGNATURE_2

public static final String[] NEW_PROPERTY_OPERATION_SIGNATURE_2
Signature of the newProperty operation with two parameters. Used when invoking `invoke` method.

### NEW_PROPERTY_OPERATION_DESCRIPTION_1

private static final String NEW_PROPERTY_OPERATION_DESCRIPTION_1

See Also:
  - Constant Field Values

### NEW_PROPERTY_OPERATION_DESCRIPTION_2

private static final String NEW_PROPERTY_OPERATION_DESCRIPTION_2

See Also:
  - Constant Field Values

### RELOAD_OPERATION_DESCRIPTION

private static final String RELOAD_OPERATION_DESCRIPTION

See Also:
  - Constant Field Values

### CONSTRUCTOR_DESCRIPTION_1

private static final String CONSTRUCTOR_DESCRIPTION_1

See Also:
  - Constant Field Values

### componentName

private String componentName

### componentConfiguration

private ComponentConfiguration componentConfiguration

### attributesInfo

private MBeanAttributeInfo[] attributesInfo

### modifiedProperties

private Map modifiedProperties

### newPropeties

private Map newPropeties

### operationInfo

private MBeanOperationInfo[] operationInfo

### constructorsInfo

private MBeanConstructorInfo[] constructorsInfo

## Constructor Details

### ComponentConfigurationDynamicMBean

public ComponentConfigurationDynamicMBean(ComponentConfiguration component)
Create a MBean wraping some loaded ComponentConfiguration

Parameters:
  `component` -

### ComponentConfigurationDynamicMBean

public ComponentConfigurationDynamicMBean(String componentName)
Loads and wraps a ComponentConfiguration

Parameters:
  `componentName` -

## Method Details

### init

private void init()
Some initializations common to both constructors

### getAttribute

public Object getAttribute(String attributeName) throws AttributeNotFoundException, MBeanException, ReflectionException
Obtains the component attributes from the ComponentCongiguration

Specified by:
  `getAttribute` in interface `DynamicMBean`
Throws:
  `AttributeNotFoundException`
  `MBeanException`
  `ReflectionException`
See Also:
  - `DynamicMBean.getAttribute(java.lang.String)`

### setAttribute

public void setAttribute(Attribute attribute) throws AttributeNotFoundException, InvalidAttributeValueException, MBeanException, ReflectionException
Sets an attribute

Specified by:
  `setAttribute` in interface `DynamicMBean`
Throws:
  `AttributeNotFoundException`
  `InvalidAttributeValueException`
  `MBeanException`
  `ReflectionException`
See Also:
  - `DynamicMBean.setAttribute(javax.management.Attribute)`

### getAttributes

public AttributeList getAttributes(String[] attributesNames)
List named attributes

Specified by:
  `getAttributes` in interface `DynamicMBean`
See Also:
  - `DynamicMBean.getAttributes(java.lang.String[])`

### setAttributes

public AttributeList setAttributes(AttributeList attributes)
Set named attributes

Specified by:
  `setAttributes` in interface `DynamicMBean`
See Also:
  - `DynamicMBean.setAttributes(javax.management.AttributeList)`

### invoke

public Object invoke(String operationName, Object[] params, String[] signature) throws MBeanException, ReflectionException
Invoke one of the operations exposed by the MBeanas. This Operations could be one of:

- `void newProperty(String propertyName)`
- `void newProperty(String propertyName, String initialValue)`
- `void reloadConfiguration()`

Specified by:
  `invoke` in interface `DynamicMBean`
Throws:
  `MBeanException`
  `ReflectionException`
See Also:
  - `DynamicMBean.invoke(java.lang.String, java.lang.Object[], java.lang.String[])`

### reloadConfiguration

private void reloadConfiguration()

### newProperty

private void newProperty(String propertyName) throws MBeanException

Throws:
  `MBeanException`

### newProperty

private void newProperty(String propertyName, Object value) throws MBeanException

Throws:
  `MBeanException`

### getMBeanInfo

public MBeanInfo getMBeanInfo()
Return the Information exposed by the MBean: Attributes, Operations, Constructors and Notifications.

Specified by:
  `getMBeanInfo` in interface `DynamicMBean`
See Also:
  - `DynamicMBean.getMBeanInfo()`

### getAttributeInfo

protected MBeanAttributeInfo[] getAttributeInfo()
Constructs the info of the MBean's attributes.

Returns:
  Array of MBeanAttributeInfo

### getOperationInfo

protected MBeanOperationInfo[] getOperationInfo()
Constructs the info of the MBean's operations.

Returns:
  Array of MBeanOperationInfo

### getConsturctorsInfo

protected MBeanConstructorInfo[] getConsturctorsInfo()
Constructs an array of the MBean's constructors.

Returns:
  Array of MBeanConstructorInfo

### getComponentConfiguration

protected ComponentConfiguration getComponentConfiguration()
Returns the ComponentConfiguration associated with this MBean.

Returns:
  ComponentConfiguration.

### setComponentConfiguration

protected void setComponentConfiguration(ComponentConfiguration componentConfiguration)

Parameters:
  `componentConfiguration` - The componentConfiguration to set.

### propertyExists

private boolean propertyExists(String property)