Object newValue = value;
if (attribute.getDataType().equals(Long.class.getName()))
{
if (MAX_LONG.compareTo(new BigInteger(value)) == -1)
{
throw new ManagementConsoleException("Entered value is too big for \"" +
ViewUtility.getDisplayText(attribute.getName()) + "\"");
}
newValue = new Long(Long.parseLong(value));
}
else if (attribute.getDataType().equals(Integer.class.getName()))
{
if (MAX_INT.compareTo(new BigInteger(value)) == -1)
{
throw new ManagementConsoleException("Entered value is too big for " + attribute.getName());
}
newValue = new Integer(Integer.parseInt(value));
}
mbsc.setAttribute(jmxbean.getObjectName(), new Attribute(attribute.getName(), newValue));