{
String propertyName = attr.getName();
String value = (String)attr.getValue();
Class cl = m_baseConfigBean.getClass();
ElementProperty prop;
try
{
Method method = cl.getDeclaredMethod("getElementPropertyByName", new Class[]{Class.forName("java.lang.String")});
prop = (ElementProperty)method.invoke(m_baseConfigBean, new Object[]{propertyName});
}
catch (Exception e)
{
String msg = /*localStrings.getString*/( "admin.server.core.mbean.config.setattribute_undefined_properties_in_base_element"+ propertyName );
throw new MBeanException(new MBeanConfigException( msg ));
}
if(prop==null && value!=null && (bAllowsEmptyValue || !value.equals("")))
{
prop = new ElementProperty();
prop.setName(propertyName);
prop.setValue(value);
try
{
Method method = cl.getDeclaredMethod("addElementProperty", new Class[]{prop.getClass()});
method.invoke(m_baseConfigBean, new Object[]{prop});
}
catch (Exception e)
{
String msg = /*localStrings.getString*/( "admin.server.core.mbean.config.setproperty_invoke_error"+propertyName );
throw new MBeanException(new MBeanConfigException( msg ));
}
}
else
{
if(value==null || (!bAllowsEmptyValue && value.equals("")))
{
try
{
Method method = cl.getDeclaredMethod("removeElementProperty", new Class[]{prop.getClass()});
method.invoke(m_baseConfigBean, new Object[]{prop});
}
catch (Exception e)
{
String msg = /*localStrings.getString*/( "admin.server.core.mbean.config.setproperty_could_not_remove_propery"+ propertyName );
throw new MBeanException(new MBeanConfigException( msg ));
}
}
else
prop.setValue(value);
}
/* try
{
m_configContext.flush();