throw new AttributeNotFoundException( msg );
}
if(ai!=null && !ai.isWritable())
{
String msg = localStrings.getString( "admin.server.core.mbean.config.setattribute_attribute_not_writable", externalName );
throw new MBeanException(new MBeanConfigException( msg ));
}
try
{
if(isProperty)
{
boolean bAllowsEmptyValue = true;
if(ai!=null)
{
AttrDescriptor descr = getDescriptor(externalName);
if(descr!=null)
{
bAllowsEmptyValue = descr.isEmptyValueAllowed();
}
}
// set property value
setPropertyElementValue(new Attribute(externalName.substring(ConfigAttributeName.PROPERTY_NAME_PREFIX.length()), value), bAllowsEmptyValue);
return;
}
else
{ //normal attribute
// check type (now only for exception)
// left check for Verifyer now (bug #4725686)
// MBeanEasyConfig.convertStringValueToProperType(value.toString(), ai.getType());
AttrDescriptor descr = getDescriptor(externalName);
ConfigBean bean = getConfigBean(externalName);
if(descr.isElement())
{
//it looks that now we have no Elements with values
//bean.set???Value(descr.getAttributeName(), value.toString());
String msg = localStrings.getString( "admin.server.core.mbean.config.getattribute_not_implemented_for_xml" );
throw new MBeanException(new MBeanConfigException( msg ));
// descr.getNode().setContent(value.toString());
// m_configContext.flush();
}
else
{
//descr.getNode().setAttribute(descr.getAttributeName(), value.toString());
if(value==null || (value.equals("") && !descr.isEmptyValueAllowed()) )
bean.setAttributeValue(descr.getAttributeName(), null);
else
bean.setAttributeValue(descr.getAttributeName(), value.toString());
m_configContext.flush();
}
}
}
// catch (MBeanConfigException mce)
// {
// String msg = localStrings.getString( "admin.server.core.mbean.config.setattribute_attribute_exception", externalName, mce.getMessage() );
// throw new MBeanException(new MBeanConfigException( msg ));
// }
catch (ConfigException e)
{
String msg = localStrings.getString( "admin.server.core.mbean.config.setAttribute_exception_for_externalname_basexpath", externalName, m_BasePath, e.getMessage() );
throw new MBeanException(new MBeanConfigException( msg ));
}
}