code: public void onSaveResource(final AddressTemplate addressTemplate, final String name,
                                 Map<String, Object> changedValues, final Callback... callback) {
  
          final ResourceAddress address = addressTemplate.resolve(statementContext, name);
          final ModelNodeAdapter adapter = new ModelNodeAdapter();
          ModelNode op = adapter.fromChangeSet(address, changedValues);
  
          dispatcher.execute(new DMRAction(op), new AsyncCallback<DMRResponse>() {
              @Override
              public void onFailure(Throwable caught) {
                  for (Callback cb : callback) {
                      cb.onFailure(addressTemplate, name, caught);
                  }
              }
  
              @Override
              public void onSuccess(DMRResponse dmrResponse) {
                  ModelNode response = dmrResponse.get();
                  if (response.isFailure()) {
                      Console.error(Console.MESSAGES.saveFailed(name), response.getFailureDescription());
                      for (Callback cb : callback) {
                          cb.onFailure(addressTemplate, name,
                                  new RuntimeException(Console.MESSAGES.saveFailed(
                                          addressTemplate.replaceWildcards(name).toString()) + ":" + response.getFailureDescription()));
                      }
                  } else {
                      for (Callback cb : callback) {
                          cb.onSuccess(addressTemplate, name);
                      }
                  }
              }
          });
      }
docs: Updates an existing resource using the given address, name and changed values.
  @param addressTemplate The address template for the resource. Might end with a wildcard,
  in that case the name is mandatory.
  @param name the name of the new resource. Might be null if the address template already contains the name.
  @param changedValues the changed values
  @param callback the callbacks