本文整理了Java中org.jboss.as.controller.registry.Resource.writeModel
方法的一些代码示例,展示了Resource.writeModel
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Resource.writeModel
方法的具体详情如下:
包路径:org.jboss.as.controller.registry.Resource
类名称:Resource
方法名:writeModel
[英]Write the model.
[中]写一个模型。
代码示例来源:origin: wildfly/wildfly
@Override
public void writeModel(ModelNode newModel) {
delegate.writeModel(newModel);
}
代码示例来源:origin: wildfly/wildfly
/**
* @param newModel
* @see org.jboss.as.controller.registry.Resource#writeModel(org.jboss.dmr.ModelNode)
*/
public void writeModel(ModelNode newModel) {
delegate.writeModel(newModel);
}
代码示例来源:origin: wildfly/wildfly
@Override
public void writeModel(final ModelNode newModel) {
delegate.writeModel(newModel);
}
代码示例来源:origin: wildfly/wildfly
@Override
public void writeModel(final ModelNode newModel) {
delegate.writeModel(newModel);
}
代码示例来源:origin: wildfly/wildfly
@Override
public void writeModel(ModelNode newModel) {
delegate.writeModel(newModel);
}
代码示例来源:origin: wildfly/wildfly
public void execute(OperationContext context, ModelNode operation) throws OperationFailedException {
MBeanServer mbs = TransactionExtension.getMBeanServer(context);
final Resource resource = context.readResource(PathAddress.EMPTY_ADDRESS);
try {
final ObjectName on = LogStoreResource.getObjectName(resource);
final ModelNode model = resource.getModel().clone();
AttributeList attributes = mbs.getAttributes(on, LogStoreConstants.PARTICIPANT_JMX_NAMES);
for (javax.management.Attribute attribute : attributes.asList()) {
String modelName = LogStoreConstants.jmxNameToModelName(LogStoreConstants.MODEL_TO_JMX_PARTICIPANT_NAMES, attribute.getName());
if (modelName != null) {
ModelNode aNode = model.get(modelName);
Object value = attribute.getValue();
if (aNode != null)
aNode.set(value == null ? "" : value.toString());
}
}
// Replace the model
resource.writeModel(model);
} catch (Exception e) {
throw new OperationFailedException("JMX error: " + e.getMessage());
}
context.completeStep(OperationContext.RollbackHandler.NOOP_ROLLBACK_HANDLER);
}
}
代码示例来源:origin: wildfly/wildfly
public void execute(OperationContext context, ModelNode operation) throws OperationFailedException {
if(! context.isNormalServer()) {
context.completeStep(OperationContext.RollbackHandler.NOOP_ROLLBACK_HANDLER);
return;
}
final MBeanServer mbs = TransactionExtension.getMBeanServer(context);
if (mbs != null) {
// Get the log-store resource
final Resource resource = context.readResource(PathAddress.EMPTY_ADDRESS);
assert resource instanceof LogStoreResource;
final LogStoreResource logStore = (LogStoreResource) resource;
// Get the expose-all-logs parameter value
final ModelNode subModel = context.readResource(PathAddress.EMPTY_ADDRESS).getModel();
final boolean exposeAllLogs = LogStoreConstants.EXPOSE_ALL_LOGS.resolveModelAttribute(context, subModel).asBoolean();
final Resource storeModel = probeTransactions(mbs, exposeAllLogs);
// Replace the current model with an updated one
context.acquireControllerLock();
// WFLY-3020 -- don't drop the root model
storeModel.writeModel(logStore.getModel());
logStore.update(storeModel);
}
context.completeStep(OperationContext.RollbackHandler.NOOP_ROLLBACK_HANDLER);
}
代码示例来源:origin: org.wildfly/wildfly-controller
@Override
public void writeModel(ModelNode newModel) {
delegate.writeModel(newModel);
}
代码示例来源:origin: org.jboss.eap/wildfly-connector
@Override
public void writeModel(ModelNode newModel) {
delegate.writeModel(newModel);
}
代码示例来源:origin: org.jboss.eap/wildfly-batch-jberet
@Override
public void writeModel(final ModelNode newModel) {
delegate.writeModel(newModel);
}
代码示例来源:origin: wildfly/wildfly-core
@Override
public void writeModel(ModelNode newModel) {
delegate.writeModel(newModel);
}
代码示例来源:origin: org.wildfly.core/wildfly-management-client-content
@Override
public void execute(OperationContext context, ModelNode operation) throws OperationFailedException {
ModelNode model = new ModelNode();
ModelNode synthOp = new ModelNode();
synthOp.get(contentAttribute.getName()).set(operation.get(ModelDescriptionConstants.VALUE));
contentAttribute.validateAndSet(synthOp, model);
final Resource resource = context.readResourceForUpdate(PathAddress.EMPTY_ADDRESS);
// IMPORTANT: Use writeModel, as this is what causes the content to be flushed to the content repo!
resource.writeModel(model);
}
}
代码示例来源:origin: wildfly/wildfly-core
@Override
public void execute(OperationContext context, ModelNode operation) throws OperationFailedException {
ModelNode model = new ModelNode();
ModelNode synthOp = new ModelNode();
synthOp.get(contentAttribute.getName()).set(operation.get(ModelDescriptionConstants.VALUE));
contentAttribute.validateAndSet(synthOp, model);
final Resource resource = context.readResourceForUpdate(PathAddress.EMPTY_ADDRESS);
// IMPORTANT: Use writeModel, as this is what causes the content to be flushed to the content repo!
resource.writeModel(model);
}
}
代码示例来源:origin: org.infinispan.server/infinispan-server-security
@Override
public void transformResource(ResourceTransformationContext context, PathAddress address, Resource resource) throws OperationFailedException {
ModelNode model = new ModelNode();
transformModulesToAttributes(address, resourceName, oldName, context, model);
resource.writeModel(model);
final ResourceTransformationContext childContext = context.addTransformedResource(PathAddress.EMPTY_ADDRESS, resource);
childContext.processChildren(resource);
}
代码示例来源:origin: org.jboss.as/jboss-as-security
@Override
public void transformResource(ResourceTransformationContext context, PathAddress address, Resource resource) throws OperationFailedException {
ModelNode model = new ModelNode();
transformModulesToAttributes(address, resourceName, oldName, context, model);
resource.writeModel(model);
final ResourceTransformationContext childContext = context.addTransformedResource(PathAddress.EMPTY_ADDRESS, resource);
childContext.processChildren(resource);
}
代码示例来源:origin: org.wildfly/wildfly-controller
public ResourceTransformationContext addTransformedResourceFromRoot(PathAddress absoluteAddress, PathAddress read, Resource toAdd) {
// Only keep the mode, drop all children
final Resource copy = Resource.Factory.create();
if (toAdd != null) {
copy.writeModel(toAdd.getModel());
}
return addTransformedRecursiveResourceFromRoot(absoluteAddress, read, copy);
}
代码示例来源:origin: org.jboss.as/jboss-as-controller
public ResourceTransformationContext addTransformedResourceFromRoot(PathAddress absoluteAddress, PathAddress read, Resource toAdd) {
// Only keep the mode, drop all children
final Resource copy = Resource.Factory.create();
if (toAdd != null) {
copy.writeModel(toAdd.getModel());
}
return addTransformedRecursiveResourceFromRoot(absoluteAddress, read, copy);
}
代码示例来源:origin: org.wildfly.core/wildfly-controller
private ResourceTransformationContext addTransformedResourceFromRoot(PathAddress absoluteAddress, PathAddress read, Resource toAdd) {
// Only keep the mode, drop all children
final Resource copy;
if (toAdd != null) {
copy = Resource.Factory.create(false, toAdd.getOrderedChildTypes());
copy.writeModel(toAdd.getModel());
} else {
copy = Resource.Factory.create();
}
return addTransformedRecursiveResourceFromRoot(absoluteAddress, read, copy);
}
代码示例来源:origin: org.jboss.as/jboss-as-controller
public Resource createResource(final PathAddress element, Resource copy) {
final PathAddress absoluteAddress = this.current.append(element);
final PathAddress readAddress = this.read.append(element);
final Resource resource = Resource.Factory.create();
resource.writeModel(copy.getModel());
addTransformedRecursiveResourceFromRoot(absoluteAddress, readAddress, resource);
return resource;
}
代码示例来源:origin: org.wildfly/wildfly-controller
public Resource createResource(final PathAddress element, Resource copy) {
final PathAddress absoluteAddress = this.current.append(element);
final PathAddress readAddress = this.read.append(element);
final Resource resource = Resource.Factory.create();
resource.writeModel(copy.getModel());
addTransformedRecursiveResourceFromRoot(absoluteAddress, readAddress, resource);
return resource;
}
内容来源于网络,如有侵权,请联系作者删除!