org.jboss.as.controller.operations.common.Util.getWriteAttributeOperation()方法的使用及代码示例

x33g5p2x  于2022-01-31 转载在 其他  
字(9.7k)|赞(0)|评价(0)|浏览(134)

本文整理了Java中org.jboss.as.controller.operations.common.Util.getWriteAttributeOperation()方法的一些代码示例,展示了Util.getWriteAttributeOperation()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Util.getWriteAttributeOperation()方法的具体详情如下:
包路径:org.jboss.as.controller.operations.common.Util
类名称:Util
方法名:getWriteAttributeOperation

Util.getWriteAttributeOperation介绍

暂无

代码示例

代码示例来源:origin: wildfly/wildfly

public void execute(OperationContext context, ModelNode operation) throws OperationFailedException {

    // Log that this is deprecated
    ConnectorLogger.ROOT_LOGGER.legacyDisableEnableOperation(operation.get(OP).asString());

    // Just delegate to write-attribute.
    ModelNode writeAttributeOp = getWriteAttributeOperation(context.getCurrentAddress(), Constants.ENABLED.getName(), enabled);
    OperationStepHandler writeHandler = context.getResourceRegistration().getOperationHandler(PathAddress.EMPTY_ADDRESS, WRITE_ATTRIBUTE_OPERATION);
    // set the addFirst param to 'true' so the write-attribute runs before any other steps already registered;
    // i.e. in the logically equivalent spot in the sequence to this step
    context.addStep(writeAttributeOp, writeHandler, OperationContext.Stage.MODEL, true);
  }
}

代码示例来源:origin: wildfly/wildfly

if (!oldPropValue.equals(value)) {
  ModelNode writeOp = Util.getWriteAttributeOperation(legacyAddress.append(PathElement.pathElement(PROPERTY, key)), VALUE, value);
  operations.add(writeOp);

代码示例来源:origin: wildfly/wildfly

private void testNonMapTransformersWork(KernelServices services, ModelVersion version) throws Exception {
  final PathAddress stackAddr = PathAddress.pathAddress(SUBSYSTEM, getMainSubsystemName()).append("stack", "test");
  ModelNode addStack = Util.createAddOperation(stackAddr);
  executeOpInBothControllersWithAttachments(services, version, addStack);
  final PathAddress transportAddr = stackAddr.append("transport", "tcp");
  ModelNode addTransport = Util.createAddOperation(transportAddr);
  addTransport.get(SocketBindingProtocolResourceDefinition.Attribute.SOCKET_BINDING.getName()).set("some-binding");
  addTransport.get(MODULE).set("do.reject");
  TransformedOperation op = services.executeInMainAndGetTheTransformedOperation(addTransport, version);
  Assert.assertTrue(op.rejectOperation(success()));
  final PathAddress protocolAddr = stackAddr.append("protocol", "PING");
  ModelNode addProtocol = Util.createAddOperation(protocolAddr);
  addProtocol.get(MODULE).set("do.reject");
  op = services.executeInMainAndGetTheTransformedOperation(addProtocol, version);
  Assert.assertTrue(op.rejectOperation(success()));
  op = services.executeInMainAndGetTheTransformedOperation(Util.getWriteAttributeOperation(transportAddr, MODULE, "reject.this"), version);
  Assert.assertTrue(op.rejectOperation(success()));
  op = services.executeInMainAndGetTheTransformedOperation(Util.getWriteAttributeOperation(protocolAddr, MODULE, "reject.this"), version);
  Assert.assertTrue(op.rejectOperation(success()));
}

代码示例来源:origin: org.wildfly.core/wildfly-host-controller

private void setOrganization(final ModelNode address, final List<ModelNode> operationList, final String value) {
  if (value != null && !value.isEmpty()) {
    final ModelNode update = Util.getWriteAttributeOperation(address, ORGANIZATION, value);
    operationList.add(update);
  }
}
/**

代码示例来源:origin: org.wildfly.core/wildfly-host-controller

private void setOrganization(final ModelNode address, final List<ModelNode> operationList, final String value) {
  if (value != null && !value.isEmpty()) {
    final ModelNode update = Util.getWriteAttributeOperation(address, ORGANIZATION, value);
    operationList.add(update);
  }
}
/**

代码示例来源:origin: org.wildfly.core/wildfly-server

private void setOrganization(final ModelNode address, final List<ModelNode> operationList, final ModelNode value) {
  if (value != null && value.isDefined() && value.asString().length() > 0) {
    final ModelNode update = Util.getWriteAttributeOperation(address, ORGANIZATION, value);
    operationList.add(update);
  }
}
private void setServerName(final ModelNode address, final List<ModelNode> operationList, final ModelNode value) {

代码示例来源:origin: org.wildfly.core/wildfly-server

private void setOrganization(final ModelNode address, final List<ModelNode> operationList, final ModelNode value) {
  if (value != null && value.isDefined() && value.asString().length() > 0) {
    final ModelNode update = Util.getWriteAttributeOperation(address, ORGANIZATION, value);
    operationList.add(update);
  }
}
private void setServerName(final ModelNode address, final List<ModelNode> operationList, final ModelNode value) {

代码示例来源:origin: org.wildfly.core/wildfly-server

private void setOrganization(final ModelNode address, final List<ModelNode> operationList, final ModelNode value) {
  if (value != null && value.isDefined() && value.asString().length() > 0) {
    final ModelNode update = Util.getWriteAttributeOperation(address, ORGANIZATION, value);
    operationList.add(update);
  }
}
private void setServerName(final ModelNode address, final List<ModelNode> operationList, final ModelNode value) {

代码示例来源:origin: org.wildfly.core/wildfly-server

private void setServerName(final ModelNode address, final List<ModelNode> operationList, final ModelNode value) {
  if (value != null && value.isDefined() && value.asString().length() > 0) {
    final ModelNode update = Util.getWriteAttributeOperation(address, NAME, value);
    operationList.add(update);
  }
}

代码示例来源:origin: org.wildfly.core/wildfly-server

private void setOrganization(final ModelNode address, final List<ModelNode> operationList, final ModelNode value) {
  if (value != null && value.isDefined() && value.asString().length() > 0) {
    final ModelNode update = Util.getWriteAttributeOperation(address, ORGANIZATION, value);
    operationList.add(update);
  }
}
private void setServerName(final ModelNode address, final List<ModelNode> operationList, final ModelNode value) {

代码示例来源:origin: org.wildfly.core/wildfly-server

private void setServerName(final ModelNode address, final List<ModelNode> operationList, final ModelNode value) {
  if (value != null && value.isDefined() && value.asString().length() > 0) {
    final ModelNode update = Util.getWriteAttributeOperation(address, NAME, value);
    operationList.add(update);
  }
}

代码示例来源:origin: org.wildfly.core/wildfly-server

private void setOrganization(final ModelNode address, final List<ModelNode> operationList, final ModelNode value) {
  if (value != null && value.isDefined() && value.asString().length() > 0) {
    final ModelNode update = Util.getWriteAttributeOperation(address, ORGANIZATION, value);
    operationList.add(update);
  }
}
private void setServerName(final ModelNode address, final List<ModelNode> operationList, final ModelNode value) {

代码示例来源:origin: org.wildfly.core/wildfly-server

private void setServerName(final ModelNode address, final List<ModelNode> operationList, final ModelNode value) {
  if (value != null && value.isDefined() && value.asString().length() > 0) {
    final ModelNode update = Util.getWriteAttributeOperation(address, NAME, value);
    operationList.add(update);
  }
}

代码示例来源:origin: org.wildfly.core/wildfly-server

private void setServerName(final ModelNode address, final List<ModelNode> operationList, final ModelNode value) {
  if (value != null && value.isDefined() && value.asString().length() > 0) {
    final ModelNode update = Util.getWriteAttributeOperation(address, NAME, value);
    operationList.add(update);
  }
}

代码示例来源:origin: org.wildfly.core/wildfly-server

private void setServerName(final ModelNode address, final List<ModelNode> operationList, final ModelNode value) {
  if (value != null && value.isDefined() && value.asString().length() > 0) {
    final ModelNode update = Util.getWriteAttributeOperation(address, NAME, value);
    operationList.add(update);
  }
}

代码示例来源:origin: org.wildfly.core/wildfly-server

private void setServerName(final ModelNode address, final List<ModelNode> operationList, final ModelNode value) {
  if (value != null && value.isDefined() && value.asString().length() > 0) {
    final ModelNode update = Util.getWriteAttributeOperation(address, NAME, value);
    operationList.add(update);
  }
}

代码示例来源:origin: org.wildfly.core/wildfly-server

private void setOrganization(final ModelNode address, final List<ModelNode> operationList, final ModelNode value) {
  if (value != null && value.isDefined() && value.asString().length() > 0) {
    final ModelNode update = Util.getWriteAttributeOperation(address, ORGANIZATION, value);
    operationList.add(update);
  }
}
private void setServerName(final ModelNode address, final List<ModelNode> operationList, final ModelNode value) {

代码示例来源:origin: org.wildfly.core/wildfly-server

private void setServerName(final ModelNode address, final List<ModelNode> operationList, final ModelNode value) {
  if (value != null && value.isDefined() && value.asString().length() > 0) {
    final ModelNode update = Util.getWriteAttributeOperation(address, NAME, value);
    operationList.add(update);
  }
}

代码示例来源:origin: org.jboss.as/jboss-as-server

private void setServerName(final ModelNode address, final List<ModelNode> operationList, final ModelNode value) {
  if (value != null && value.isDefined() && value.asString().length() > 0) {
    final ModelNode update = Util.getWriteAttributeOperation(address, NAME, value);
    operationList.add(update);
  }
}

代码示例来源:origin: org.jboss.eap/wildfly-connector

public void execute(OperationContext context, ModelNode operation) throws OperationFailedException {

    // Log that this is deprecated
    ConnectorLogger.ROOT_LOGGER.legacyDisableEnableOperation(operation.get(OP).asString());

    // Just delegate to write-attribute.
    ModelNode writeAttributeOp = getWriteAttributeOperation(context.getCurrentAddress(), Constants.ENABLED.getName(), enabled);
    OperationStepHandler writeHandler = context.getResourceRegistration().getOperationHandler(PathAddress.EMPTY_ADDRESS, WRITE_ATTRIBUTE_OPERATION);
    // set the addFirst param to 'true' so the write-attribute runs before any other steps already registered;
    // i.e. in the logically equivalent spot in the sequence to this step
    context.addStep(writeAttributeOp, writeHandler, OperationContext.Stage.MODEL, true);
  }
}

相关文章