本文整理了Java中org.jboss.as.controller.operations.common.Util.createEmptyOperation()
方法的一些代码示例,展示了Util.createEmptyOperation()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Util.createEmptyOperation()
方法的具体详情如下:
包路径:org.jboss.as.controller.operations.common.Util
类名称:Util
方法名:createEmptyOperation
暂无
代码示例来源:origin: wildfly/wildfly
void refreshParticipant(OperationContext context) {
final ModelNode operation = Util.createEmptyOperation("refresh-log-store", context.getCurrentAddress().getParent().getParent());
context.addStep(operation, new OperationStepHandler() {
@Override
public void execute(OperationContext context, ModelNode operation) throws OperationFailedException {
probeHandler.execute(context, operation);
}
}, OperationContext.Stage.MODEL);
}
}
代码示例来源:origin: wildfly/wildfly
public static void checkMapModels(KernelServices services, ModelVersion version, PathAddress address, String... properties) throws Exception {
final ModelNode readResource = Util.createEmptyOperation(READ_RESOURCE_OPERATION, address);
readResource.get(RECURSIVE).set(true);
readResource.get(INCLUDE_DEFAULTS).set(false);
ModelNode mainModel = services.executeForResult(readResource.clone());
checkMainMapModel(mainModel, properties);
final ModelNode legacyModel;
if (address.getLastElement().getKey().equals("transport")) {
//TODO get rid of this once the PathAddress transformer works properly
//Temporary workaround
readResource.get(OP_ADDR).set(address.subAddress(0, address.size() - 1).append("transport", "TRANSPORT").toModelNode());
legacyModel = services.getLegacyServices(version).executeForResult(readResource);
} else {
legacyModel = ModelTestUtils.checkResultAndGetContents(services.executeOperation(version, services.transformOperation(version, readResource.clone())));
}
checkLegacyChildResourceModel(legacyModel, properties);
}
代码示例来源:origin: org.wildfly.core/wildfly-controller
public static ModelNode getReadAttributeOperation(final PathAddress address, String attributeName) {
ModelNode op = createEmptyOperation(READ_ATTRIBUTE_OPERATION, address);
op.get(NAME).set(attributeName);
return op;
}
代码示例来源:origin: org.wildfly.core/wildfly-controller
public static ModelNode getUndefineAttributeOperation(final PathAddress address, String attributeName) {
ModelNode op = createEmptyOperation(UNDEFINE_ATTRIBUTE_OPERATION, address);
op.get(NAME).set(attributeName);
return op;
}
代码示例来源:origin: org.jboss.as/jboss-as-controller
public static ModelNode getReadAttributeOperation(final PathAddress address, String attributeName) {
ModelNode op = createEmptyOperation(READ_ATTRIBUTE_OPERATION, address);
op.get(NAME).set(attributeName);
return op;
}
代码示例来源:origin: org.jboss.as/jboss-as-controller
public static ModelNode getUndefineAttributeOperation(final PathAddress address, String attributeName) {
ModelNode op = createEmptyOperation(UNDEFINE_ATTRIBUTE_OPERATION, address);
op.get(NAME).set(attributeName);
return op;
}
代码示例来源:origin: org.wildfly/wildfly-controller
public static ModelNode getUndefineAttributeOperation(final PathAddress address, String attributeName) {
ModelNode op = createEmptyOperation(UNDEFINE_ATTRIBUTE_OPERATION, address);
op.get(NAME).set(attributeName);
return op;
}
代码示例来源:origin: org.wildfly.core/wildfly-controller
public static ModelNode getWriteAttributeOperation(final PathAddress address, String attributeName, ModelNode value) {
ModelNode op = createEmptyOperation(WRITE_ATTRIBUTE_OPERATION, address);
op.get(NAME).set(attributeName);
op.get(VALUE).set(value);
return op;
}
代码示例来源:origin: wildfly/wildfly-core
public static ModelNode getWriteAttributeOperation(final PathAddress address, String attributeName, ModelNode value) {
ModelNode op = createEmptyOperation(WRITE_ATTRIBUTE_OPERATION, address);
op.get(NAME).set(attributeName);
op.get(VALUE).set(value);
return op;
}
代码示例来源:origin: org.wildfly.core/wildfly-controller
public static ModelNode getOperation(final String operationName, final PathAddress address, final ModelNode params) {
ModelNode op = createEmptyOperation(operationName, address);
Set<String> keys = params.keys();
keys.remove(OP);
keys.remove(OP_ADDR);
for (String key : keys) {
op.get(key).set(params.get(key));
}
return op;
}
代码示例来源:origin: wildfly/wildfly-core
public static ModelNode getOperation(final String operationName, final PathAddress address, final ModelNode params) {
ModelNode op = createEmptyOperation(operationName, address);
Set<String> keys = params.keys();
keys.remove(OP);
keys.remove(OP_ADDR);
for (String key : keys) {
op.get(key).set(params.get(key));
}
return op;
}
代码示例来源:origin: org.jboss.as/jboss-as-controller
public static ModelNode getOperation(final String operationName, final PathAddress address, final ModelNode params) {
ModelNode op = createEmptyOperation(operationName, address);
Set<String> keys = params.keys();
keys.remove(OP);
keys.remove(OP_ADDR);
for (String key : keys) {
op.get(key).set(params.get(key));
}
return op;
}
代码示例来源:origin: wildfly/wildfly-core
private static ModelNode getPropertyValue(ModelControllerClient client, PathAddress baseAddress, String propertyName) throws IOException, MgmtOperationException {
ModelNode op = Util.createEmptyOperation(ModelDescriptionConstants.READ_ATTRIBUTE_OPERATION, baseAddress.append(RESOURCE_ADDRESS));
op.get(ModelDescriptionConstants.NAME).set("system-properties");
ModelNode result = ManagementOperations.executeOperation(client, op);
return result.get(propertyName);
}
代码示例来源:origin: wildfly/wildfly-core
@Override
public TransformedOperation transformOperation(TransformationContext context, PathAddress address, ModelNode operation) throws OperationFailedException {
ModelNode transformedOp = Util.createEmptyOperation(READ_RESOURCE_OPERATION, address);
transformedOp.get(INCLUDE_RUNTIME).set(true);
ResultTransformer rt = new ResultTransformer(operation, address);
return new TransformedOperation(transformedOp, rt);
}
};
代码示例来源:origin: org.wildfly.core/wildfly-controller
@Override
public TransformedOperation transformOperation(TransformationContext context, PathAddress address, ModelNode operation) throws OperationFailedException {
ModelNode transformedOp = Util.createEmptyOperation(READ_RESOURCE_OPERATION, address);
transformedOp.get(INCLUDE_RUNTIME).set(true);
ResultTransformer rt = new ResultTransformer(operation, address);
return new TransformedOperation(transformedOp, rt);
}
};
代码示例来源:origin: org.wildfly.core/wildfly-host-controller
private void setServerGroupHost(ModelNodeList updates) {
ModelNode op = Util.createEmptyOperation(SetServerGroupHostHandler.OPERATION_NAME, null);
op.get(SERVER_GROUP).set(serverGroupName);
LocalHostControllerInfo lhci = domainController.getLocalHostInfo();
op.get(HOST).set(lhci.getLocalHostName());
updates.add(op);
}
代码示例来源:origin: wildfly/wildfly-core
private void setServerGroupHost(ModelNodeList updates) {
ModelNode op = Util.createEmptyOperation(SetServerGroupHostHandler.OPERATION_NAME, null);
op.get(SERVER_GROUP).set(serverGroupName);
LocalHostControllerInfo lhci = domainController.getLocalHostInfo();
op.get(HOST).set(lhci.getLocalHostName());
updates.add(op);
}
代码示例来源:origin: wildfly/wildfly-core
static void addOperation(OperationContext context, String roleName) {
ModelNode operation = Util.createEmptyOperation("scoped-role-check", PathAddress.pathAddress(
CoreManagementResourceDefinition.PATH_ELEMENT, AccessAuthorizationResourceDefinition.PATH_ELEMENT));
context.addStep(operation, new ScopedRoleRequiredHandler(roleName), Stage.MODEL);
}
代码示例来源:origin: org.wildfly/wildfly-transactions
void refreshParticipant(OperationContext context) {
final ModelNode operation = Util.createEmptyOperation("refresh-log-store", context.getCurrentAddress().getParent().getParent());
context.addStep(operation, new OperationStepHandler() {
@Override
public void execute(OperationContext context, ModelNode operation) throws OperationFailedException {
probeHandler.execute(context, operation);
}
}, OperationContext.Stage.MODEL);
}
}
代码示例来源:origin: org.jboss.eap/wildfly-transactions
void refreshParticipant(OperationContext context) {
final ModelNode operation = Util.createEmptyOperation("refresh-log-store", context.getCurrentAddress().getParent().getParent());
context.addStep(operation, new OperationStepHandler() {
@Override
public void execute(OperationContext context, ModelNode operation) throws OperationFailedException {
probeHandler.execute(context, operation);
}
}, OperationContext.Stage.MODEL);
}
}
内容来源于网络,如有侵权,请联系作者删除!