class BaseSubsystem extends AnnotatedSubsystem<M> {

   @Request(Capability.CMD_SET_ATTRIBUTES)
   public MessageBody setAttributes(PlatformMessage message, SubsystemContext<M> context) {
      MessageBody request = message.getValue();
      List<Map<String, Object>> errors = new ArrayList<> ();
      for(Map.Entry<String, Object> entry: request.getAttributes().entrySet()) {
         try {
            setAttribute(entry.getKey(), entry.getValue(), context);
         }
         catch(ErrorEventException e) {
         	context.logger().warn("Error setting attribute [{}]", entry.getKey(), e);
            errors.add(e.toErrorEvent().getAttributes());
         }
         catch(Exception e) {
            // TODO this should really be invalid parameter-value
         	context.logger().warn("Error setting attribute [{}]", entry.getKey(), e);
            errors.add(Errors.invalidParam(entry.getKey()).getAttributes());
         }
      }
      if(errors.isEmpty()) {
         return MessageBody.emptyMessage();
      }
      else {
         return MessageBody.buildMessage(Capability.EVENT_SET_ATTRIBUTES_ERROR, ImmutableMap.<String, Object>of("errors", errors));
      }
   }

}