Examples of writeModel()


Examples of org.jboss.as.controller.registry.Resource.writeModel()

        }
        if(recursive) {
            return model.clone();
        } else {
            final Resource copy = Resource.Factory.create();
            copy.writeModel(model.getModel());
            for(final String childType : model.getChildTypes()) {
                for(final Resource.ResourceEntry child : model.getChildren(childType)) {
                    copy.registerChild(child.getPathElement(), PlaceholderResource.INSTANCE);
                }
            }
View Full Code Here

Examples of org.jboss.as.controller.registry.Resource.writeModel()

    }

    public Resource createResource(final PathAddress element, Resource copy) {
        final PathAddress absoluteAddress = this.current.append(element);
        final Resource resource = Resource.Factory.create();
        resource.writeModel(copy.getModel());
        addTransformedRecursiveResourceFromRoot(absoluteAddress, resource);
        return resource;
    }

    @Override
View Full Code Here

Examples of org.jboss.as.controller.registry.Resource.writeModel()

    @Override
    public ResourceTransformationContext addTransformedResourceFromRoot(PathAddress absoluteAddress, 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, copy);
    }

    @Override
View Full Code Here

Examples of org.jboss.as.controller.registry.Resource.writeModel()

            allFields.remove(name);
        }
        if (!value.isDefined() && model.isDefined() && reg.getChildAddresses(PathAddress.EMPTY_ADDRESS).size() == 0) {
            value.setEmptyObject();
        }
        res.writeModel(value);

        for (PathElement path : reg.getChildAddresses(PathAddress.EMPTY_ADDRESS)) {

            ImmutableManagementResourceRegistration sub = reg.getSubModel(PathAddress.pathAddress(path));
            if (path.isWildcard()) {
View Full Code Here

Examples of org.jboss.as.controller.registry.Resource.writeModel()

            final boolean exposeAllLogs = LogStoreConstants.EXPOSE_ALL_LOGS.resolveModelAttribute(context, subModel).asBoolean();
            // Replace the current model with an updated one
            context.acquireControllerLock();
            final Resource storeModel = probeTransactions(mbs, exposeAllLogs);
            // WFLY-3020 -- don't drop the root model
            storeModel.writeModel(logStore.getModel());
            logStore.update(storeModel);
        }
        context.completeStep(OperationContext.RollbackHandler.NOOP_ROLLBACK_HANDLER);
    }
View Full Code Here

Examples of org.jboss.as.controller.registry.Resource.writeModel()

                    if (aNode != null)
                        aNode.set(value == null ? "" : value.toString());
                }
            }
            // Replace the model
            resource.writeModel(model);
        } catch (Exception e) {
            throw new OperationFailedException("JMX error: ", e);
        }

        context.completeStep(OperationContext.RollbackHandler.NOOP_ROLLBACK_HANDLER);
View Full Code Here

Examples of org.jboss.as.controller.registry.Resource.writeModel()

                    }
                }
            } catch (Exception e) {
                throw new OperationFailedException("Could not find resource for address '"+resourceAddress+"'");
            }
            resource.writeModel(resourceDescription.get("domain-resource-model"));

            // Track deployment and management content hashes and server group deployments so we can pull over the content we need
            if (resourceAddress.size() == 1) {
                PathElement pe = resourceAddress.getElement(0);
                String peKey = pe.getKey();
View Full Code Here

Examples of org.jboss.as.controller.registry.Resource.writeModel()

        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);

        context.stepCompleted();
    }
}
View Full Code Here

Examples of org.jboss.as.controller.registry.Resource.writeModel()

        }
        ModelNode model = new ModelNode();
        contentAttribute.validateAndSet(operation, model);

        // IMPORTANT: Use writeModel, as this is what causes the content to be flushed to the content repo!
        resource.writeModel(model);

        context.stepCompleted();
    }

    @Override
View Full Code Here

Examples of org.jboss.as.controller.registry.Resource.writeModel()

            final Resource resource = getResource(resourceAddress, rootResource, context);
            if (resourceAddress.size() == 1 && resourceAddress.getElement(0).getKey().equals(EXTENSION)) {
                // Extensions are handled in ApplyExtensionsHandler
                continue;
            }
            resource.writeModel(resourceDescription.get("domain-resource-model"));

            // Track deployment and management content hashes and server group deployments so we can pull over the content we need
            if (resourceAddress.size() == 1) {
                PathElement pe = resourceAddress.getElement(0);
                String peKey = pe.getKey();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.