Package com.germinus.easyconf.jmx
Class ComponentConfigurationDynamicMBean
- java.lang.Object
-
- com.germinus.easyconf.jmx.ComponentConfigurationDynamicMBean
-
- All Implemented Interfaces:
javax.management.DynamicMBean
public class ComponentConfigurationDynamicMBean extends java.lang.Object implements javax.management.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 javax.management.MBeanAttributeInfo[]
attributesInfo
private ComponentConfiguration
componentConfiguration
private java.lang.String
componentName
private static java.lang.String
CONSTRUCTOR_DESCRIPTION_1
private javax.management.MBeanConstructorInfo[]
constructorsInfo
private java.util.Map
modifiedProperties
private static java.lang.String
NEW_PROPERTY_OPERATION_DESCRIPTION_1
private static java.lang.String
NEW_PROPERTY_OPERATION_DESCRIPTION_2
static java.lang.String
NEW_PROPERTY_OPERATION_NAME
Name of the newProperty operations.static java.lang.String[]
NEW_PROPERTY_OPERATION_SIGNATURE_1
Signature of the newProperty operation with one parameter.static java.lang.String[]
NEW_PROPERTY_OPERATION_SIGNATURE_2
Signature of the newProperty operation with two parameters.private java.util.Map
newPropeties
private javax.management.MBeanOperationInfo[]
operationInfo
private static java.lang.String
RELOAD_OPERATION_DESCRIPTION
static java.lang.String
RELOAD_OPERATION_NAME
Name of the reloadConfiguration operation.static java.lang.String[]
RELOAD_OPERATION_SIGNATURE
Signature of the reloadConfiguration operation.
-
Constructor Summary
Constructors Constructor Description ComponentConfigurationDynamicMBean(ComponentConfiguration component)
Create a MBean wraping some loaded ComponentConfigurationComponentConfigurationDynamicMBean(java.lang.String componentName)
Loads and wraps a ComponentConfiguration
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Object
getAttribute(java.lang.String attributeName)
Obtains the component attributes from the ComponentCongigurationprotected javax.management.MBeanAttributeInfo[]
getAttributeInfo()
Constructs the info of the MBean's attributes.javax.management.AttributeList
getAttributes(java.lang.String[] attributesNames)
List named attributesprotected ComponentConfiguration
getComponentConfiguration()
Returns the ComponentConfiguration associated with this MBean.protected javax.management.MBeanConstructorInfo[]
getConsturctorsInfo()
Constructs an array of the MBean's constructors.javax.management.MBeanInfo
getMBeanInfo()
Return the Information exposed by the MBean: Attributes, Operations, Constructors and Notifications.protected javax.management.MBeanOperationInfo[]
getOperationInfo()
Constructs the info of the MBean's operations.private void
init()
Some initializations common to both constructorsjava.lang.Object
invoke(java.lang.String operationName, java.lang.Object[] params, java.lang.String[] signature)
Invoke one of the operations exposed by the MBeanas.private void
newProperty(java.lang.String propertyName)
private void
newProperty(java.lang.String propertyName, java.lang.Object value)
private boolean
propertyExists(java.lang.String property)
private void
reloadConfiguration()
void
setAttribute(javax.management.Attribute attribute)
Sets an attributejavax.management.AttributeList
setAttributes(javax.management.AttributeList attributes)
Set named attributesprotected void
setComponentConfiguration(ComponentConfiguration componentConfiguration)
-
-
-
Field Detail
-
RELOAD_OPERATION_NAME
public static final java.lang.String RELOAD_OPERATION_NAME
Name of the reloadConfiguration operation. Used when invokinginvoke
method.- See Also:
- Constant Field Values
-
NEW_PROPERTY_OPERATION_NAME
public static final java.lang.String NEW_PROPERTY_OPERATION_NAME
Name of the newProperty operations. Used when invokinginvoke
method.- See Also:
- Constant Field Values
-
RELOAD_OPERATION_SIGNATURE
public static final java.lang.String[] RELOAD_OPERATION_SIGNATURE
Signature of the reloadConfiguration operation. Used when invokinginvoke
method.
-
NEW_PROPERTY_OPERATION_SIGNATURE_1
public static final java.lang.String[] NEW_PROPERTY_OPERATION_SIGNATURE_1
Signature of the newProperty operation with one parameter. Used when invokinginvoke
method.
-
NEW_PROPERTY_OPERATION_SIGNATURE_2
public static final java.lang.String[] NEW_PROPERTY_OPERATION_SIGNATURE_2
Signature of the newProperty operation with two parameters. Used when invokinginvoke
method.
-
NEW_PROPERTY_OPERATION_DESCRIPTION_1
private static final java.lang.String NEW_PROPERTY_OPERATION_DESCRIPTION_1
- See Also:
- Constant Field Values
-
NEW_PROPERTY_OPERATION_DESCRIPTION_2
private static final java.lang.String NEW_PROPERTY_OPERATION_DESCRIPTION_2
- See Also:
- Constant Field Values
-
RELOAD_OPERATION_DESCRIPTION
private static final java.lang.String RELOAD_OPERATION_DESCRIPTION
- See Also:
- Constant Field Values
-
CONSTRUCTOR_DESCRIPTION_1
private static final java.lang.String CONSTRUCTOR_DESCRIPTION_1
- See Also:
- Constant Field Values
-
componentName
private java.lang.String componentName
-
componentConfiguration
private ComponentConfiguration componentConfiguration
-
attributesInfo
private javax.management.MBeanAttributeInfo[] attributesInfo
-
modifiedProperties
private java.util.Map modifiedProperties
-
newPropeties
private java.util.Map newPropeties
-
operationInfo
private javax.management.MBeanOperationInfo[] operationInfo
-
constructorsInfo
private javax.management.MBeanConstructorInfo[] constructorsInfo
-
-
Constructor Detail
-
ComponentConfigurationDynamicMBean
public ComponentConfigurationDynamicMBean(ComponentConfiguration component)
Create a MBean wraping some loaded ComponentConfiguration- Parameters:
component
-
-
ComponentConfigurationDynamicMBean
public ComponentConfigurationDynamicMBean(java.lang.String componentName)
Loads and wraps a ComponentConfiguration- Parameters:
componentName
-
-
-
Method Detail
-
init
private void init()
Some initializations common to both constructors
-
getAttribute
public java.lang.Object getAttribute(java.lang.String attributeName) throws javax.management.AttributeNotFoundException, javax.management.MBeanException, javax.management.ReflectionException
Obtains the component attributes from the ComponentCongiguration- Specified by:
getAttribute
in interfacejavax.management.DynamicMBean
- Throws:
javax.management.AttributeNotFoundException
javax.management.MBeanException
javax.management.ReflectionException
- See Also:
DynamicMBean.getAttribute(java.lang.String)
-
setAttribute
public void setAttribute(javax.management.Attribute attribute) throws javax.management.AttributeNotFoundException, javax.management.InvalidAttributeValueException, javax.management.MBeanException, javax.management.ReflectionException
Sets an attribute- Specified by:
setAttribute
in interfacejavax.management.DynamicMBean
- Throws:
javax.management.AttributeNotFoundException
javax.management.InvalidAttributeValueException
javax.management.MBeanException
javax.management.ReflectionException
- See Also:
DynamicMBean.setAttribute(javax.management.Attribute)
-
getAttributes
public javax.management.AttributeList getAttributes(java.lang.String[] attributesNames)
List named attributes- Specified by:
getAttributes
in interfacejavax.management.DynamicMBean
- See Also:
DynamicMBean.getAttributes(java.lang.String[])
-
setAttributes
public javax.management.AttributeList setAttributes(javax.management.AttributeList attributes)
Set named attributes- Specified by:
setAttributes
in interfacejavax.management.DynamicMBean
- See Also:
DynamicMBean.setAttributes(javax.management.AttributeList)
-
invoke
public java.lang.Object invoke(java.lang.String operationName, java.lang.Object[] params, java.lang.String[] signature) throws javax.management.MBeanException, javax.management.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 interfacejavax.management.DynamicMBean
- Throws:
javax.management.MBeanException
javax.management.ReflectionException
- See Also:
DynamicMBean.invoke(java.lang.String, java.lang.Object[], java.lang.String[])
-
reloadConfiguration
private void reloadConfiguration()
-
newProperty
private void newProperty(java.lang.String propertyName) throws javax.management.MBeanException
- Throws:
javax.management.MBeanException
-
newProperty
private void newProperty(java.lang.String propertyName, java.lang.Object value) throws javax.management.MBeanException
- Throws:
javax.management.MBeanException
-
getMBeanInfo
public javax.management.MBeanInfo getMBeanInfo()
Return the Information exposed by the MBean: Attributes, Operations, Constructors and Notifications.- Specified by:
getMBeanInfo
in interfacejavax.management.DynamicMBean
- See Also:
DynamicMBean.getMBeanInfo()
-
getAttributeInfo
protected javax.management.MBeanAttributeInfo[] getAttributeInfo()
Constructs the info of the MBean's attributes.- Returns:
- Array of MBeanAttributeInfo
-
getOperationInfo
protected javax.management.MBeanOperationInfo[] getOperationInfo()
Constructs the info of the MBean's operations.- Returns:
- Array of MBeanOperationInfo
-
getConsturctorsInfo
protected javax.management.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(java.lang.String property)
-
-