}
public Object execute(ControlContext context) throws ControlException {
Object target = context.retrieve(instanceId);
if (target == null) throw new ControlException("Missing instance: " + instanceId);
try {
Class clazz = target.getClass();
Method setter = clazz.getMethod("set" + attributeName, new Class[]{attributeValue.getClass()});
setter = clazz.getMethod("set" + attributeName, new Class[]{attributeValue.getClass()});
setter.invoke(target, new Object[]{attributeValue});
return null;
} catch (NoSuchMethodException e) {
throw new ControlException("Trying to set an attribute", e);
} catch (IllegalAccessException e) {
throw new ControlException("Trying to set an attribute", e);
} catch (InvocationTargetException e) {
throw new ControlException("Trying to set an attribute", e);
}
}