Package com.germinus.easyconf.jmx
Class ComponentConfigurationDynamicMBean
java.lang.Object
com.germinus.easyconf.jmx.ComponentConfigurationDynamicMBean
- All Implemented Interfaces:
DynamicMBean
MBean wrapper for a ComponentConfiguration. View Source
- Version:
- $Revision: 1.4 $
- Author:
- Alvaro Gonz�lez
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate MBeanAttributeInfo[]private ComponentConfigurationprivate Stringprivate static final Stringprivate MBeanConstructorInfo[]private Mapprivate static final Stringprivate static final Stringstatic final StringName of the newProperty operations.static final String[]Signature of the newProperty operation with one parameter.static final String[]Signature of the newProperty operation with two parameters.private Mapprivate MBeanOperationInfo[]private static final Stringstatic final StringName of the reloadConfiguration operation.static final String[]Signature of the reloadConfiguration operation. -
Constructor Summary
ConstructorsConstructorDescriptionCreate a MBean wraping some loaded ComponentConfigurationComponentConfigurationDynamicMBean(String componentName) Loads and wraps a ComponentConfiguration -
Method Summary
Modifier and TypeMethodDescriptiongetAttribute(String attributeName) Obtains the component attributes from the ComponentCongigurationprotected MBeanAttributeInfo[]Constructs the info of the MBean's attributes.getAttributes(String[] attributesNames) List named attributesprotected ComponentConfigurationReturns the ComponentConfiguration associated with this MBean.protected MBeanConstructorInfo[]Constructs an array of the MBean's constructors.Return the Information exposed by the MBean: Attributes, Operations, Constructors and Notifications.protected MBeanOperationInfo[]Constructs the info of the MBean's operations.private voidinit()Some initializations common to both constructorsInvoke one of the operations exposed by the MBeanas.private voidnewProperty(String propertyName) private voidnewProperty(String propertyName, Object value) private booleanpropertyExists(String property) private voidvoidsetAttribute(Attribute attribute) Sets an attributesetAttributes(AttributeList attributes) Set named attributesprotected voidsetComponentConfiguration(ComponentConfiguration componentConfiguration)
-
Field Details
-
RELOAD_OPERATION_NAME
Name of the reloadConfiguration operation. Used when invokinginvokemethod.- See Also:
-
NEW_PROPERTY_OPERATION_NAME
Name of the newProperty operations. Used when invokinginvokemethod.- See Also:
-
RELOAD_OPERATION_SIGNATURE
Signature of the reloadConfiguration operation. Used when invokinginvokemethod. -
NEW_PROPERTY_OPERATION_SIGNATURE_1
Signature of the newProperty operation with one parameter. Used when invokinginvokemethod. -
NEW_PROPERTY_OPERATION_SIGNATURE_2
Signature of the newProperty operation with two parameters. Used when invokinginvokemethod. -
NEW_PROPERTY_OPERATION_DESCRIPTION_1
- See Also:
-
NEW_PROPERTY_OPERATION_DESCRIPTION_2
- See Also:
-
RELOAD_OPERATION_DESCRIPTION
- See Also:
-
CONSTRUCTOR_DESCRIPTION_1
- See Also:
-
componentName
-
componentConfiguration
-
attributesInfo
-
modifiedProperties
-
newPropeties
-
operationInfo
-
constructorsInfo
-
-
Constructor Details
-
ComponentConfigurationDynamicMBean
Create a MBean wraping some loaded ComponentConfiguration- Parameters:
component-
-
ComponentConfigurationDynamicMBean
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:
getAttributein interfaceDynamicMBean- Throws:
AttributeNotFoundExceptionMBeanExceptionReflectionException- See Also:
-
setAttribute
public void setAttribute(Attribute attribute) throws AttributeNotFoundException, InvalidAttributeValueException, MBeanException, ReflectionException Sets an attribute- Specified by:
setAttributein interfaceDynamicMBean- Throws:
AttributeNotFoundExceptionInvalidAttributeValueExceptionMBeanExceptionReflectionException- See Also:
-
getAttributes
List named attributes- Specified by:
getAttributesin interfaceDynamicMBean- See Also:
-
setAttributes
Set named attributes- Specified by:
setAttributesin interfaceDynamicMBean- See Also:
-
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:
invokein interfaceDynamicMBean- Throws:
MBeanExceptionReflectionException- See Also:
-
reloadConfiguration
private void reloadConfiguration() -
newProperty
- Throws:
MBeanException
-
newProperty
- Throws:
MBeanException
-
getMBeanInfo
Return the Information exposed by the MBean: Attributes, Operations, Constructors and Notifications.- Specified by:
getMBeanInfoin interfaceDynamicMBean- See Also:
-
getAttributeInfo
Constructs the info of the MBean's attributes.- Returns:
- Array of MBeanAttributeInfo
-
getOperationInfo
Constructs the info of the MBean's operations.- Returns:
- Array of MBeanOperationInfo
-
getConsturctorsInfo
Constructs an array of the MBean's constructors.- Returns:
- Array of MBeanConstructorInfo
-
getComponentConfiguration
Returns the ComponentConfiguration associated with this MBean.- Returns:
- ComponentConfiguration.
-
setComponentConfiguration
- Parameters:
componentConfiguration- The componentConfiguration to set.
-
propertyExists
-