class MBeanHelper {

    public void set(ObjectName bean, String attr, String value) throws Exception {
        Map<String, MBeanAttributeInfo> attrInfos = getAttributeInfos(bean, Collections.singletonList(attr), false, true);
        Object ov = convert(value, attrInfos.get(attr).getType());
        mserver.setAttribute(bean, new Attribute(attr, ov));
    }

    public  MBeanHelper(MBeanServerConnection connection);

}