// 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());
wrapAndThrowMBeanException(null, "not_supported_attribute_type", externalName );
// descr.getNode().setContent(value.toString());
// m_configContext.flush();
}
else
{
if(ai.getType().startsWith("[")) //array
{
bean.setValue(ConfigBean.camelize(descr.getAttributeName()), (Object[])value);
/* Class cl = bean.getClass();
try
{
Method method = cl.getMethod("setValue", new Class[]{Class.forName("java.lang.String"),(new Object[0]).getClass()});
method.invoke(bean, new Object[]{ConfigBean.camelize(descr.getAttributeName()),value});
}
catch (Exception e)
{
String msg = localStrings.getString( "admin.server.core.mbean.config.setattribute_invocation_error", externalName );
throw MBeanHelper.extractAndWrapTargetException(e, msg);
}
*/
}
else
{
try {
//descr.getNode().setAttribute(descr.getAttributeName(), value.toString());
if(value==null || (value.equals("") && !isEmptyValueAllowed(ai)) )
bean.setAttributeValue(descr.getAttributeName(), null);
else
bean.setAttributeValue(descr.getAttributeName(), value.toString());
// m_configContext.flush();
} catch (IllegalArgumentException e) {
bean.setValue(ConfigBean.camelize(descr.getAttributeName()), value);
}
}
}
}