Package org.jboss.dmr

Examples of org.jboss.dmr.ModelNode.require()


            writeWorkerThreadPoolIfAttributesSet(writer, model);

            if (model.hasDefined(CONNECTOR)) {
                final ModelNode connector = model.get(CONNECTOR);
                for (String name : connector.keys()) {
                    writeConnector(writer, connector.require(name), name);
                }
            }

            writer.writeEndElement();
        }
View Full Code Here


        writeWorkerThreadPoolIfAttributesSet(writer, model);

        if (model.hasDefined(CONNECTOR)) {
            final ModelNode connector = model.get(CONNECTOR);
            for (String name : connector.keys()) {
                writeConnector(writer, connector.require(name), name);
            }
        }
        if (model.hasDefined(OUTBOUND_CONNECTION) || model.hasDefined(REMOTE_OUTBOUND_CONNECTION) || model.hasDefined(LOCAL_OUTBOUND_CONNECTION)) {
            // write <outbound-connections> element
            writer.writeStartElement(Element.OUTBOUND_CONNECTIONS.getLocalName());
View Full Code Here

        ModelNode node = this.model;
        List<PathElement> elements = new ArrayList<PathElement>();
        for (PathElement element : address.subAddress(0, address.size() - 1)) {
            try {
                elements.add(element);
                node = node.require(element.getKey()).require(element.getValue());
            }
            catch (NoSuchElementException nsee) {
                PathAddress ancestor = PathAddress.pathAddress(elements);
                throw new IllegalStateException("Cannot add resource at address " + address + " because ancestor resource " + ancestor + " does not exist");
            }
View Full Code Here

                final ModelProvider modelProvider, final ConfigurationPersisterProvider injectedConfigPersisterProvider) throws OperationFailedException {
            this.operation = operation;
            final ModelNode operationNode = operation.getOperation();
            stepsValidator.validateParameter(STEPS, operationNode.get(STEPS));
            this.resultHandler = resultHandler;
            this.steps = operationNode.require(STEPS).asList();
            this.unfinishedCount.set(steps.size());
            this.rollbackOnRuntimeFailure = (!operationNode.hasDefined(ROLLBACK_ON_RUNTIME_FAILURE) || operationNode.get(ROLLBACK_ON_RUNTIME_FAILURE).asBoolean());
            this.modelSource = modelProvider;
            this.localModel = this.modelSource.getModel().clone();
            this.injectedConfigPersisterProvider = injectedConfigPersisterProvider;
View Full Code Here

            }
            if (remote.has(PORT)) {
                writeAttribute(writer, Attribute.PORT, remote.get(PORT).asString());
            }
            if (remote.hasDefined(SECURITY_REALM)) {
                writeAttribute(writer, Attribute.SECURITY_REALM, remote.require(SECURITY_REALM).asString());
            }
            if (ignoredResources != null) {
                writeIgnoredResources(writer, ignoredResources);
            }
            writer.writeEndElement();
View Full Code Here

                final ModelNode deployment = modelNode.get(uniqueName);
                final String runtimeName = deployment.get(RUNTIME_NAME).asString();
                writer.writeStartElement(Element.DEPLOYMENT.getLocalName());
                writeAttribute(writer, Attribute.NAME, uniqueName);
                writeAttribute(writer, Attribute.RUNTIME_NAME, runtimeName);
                final List<ModelNode> contentItems = deployment.require(CONTENT).asList();
                for (ModelNode contentItem : contentItems) {
                    writeContentItem(writer, contentItem);
                }
                writer.writeEndElement();
            }
View Full Code Here

        }

        final ModelNode dc = host.require(DOMAIN_CONTROLLER).require(REMOTE);
        final InetAddress addr;
        try {
            addr = InetAddress.getByName(dc.require(HOST).resolve().asString());
        } catch (UnknownHostException e) {
            throw new RuntimeException(e);
        }
        final int port = dc.require(PORT).resolve().asInt();
//        final RemoteDomainConnectionService service = new RemoteDomainConnectionService(name, addr, port, localFileRepository);
View Full Code Here

        try {
            addr = InetAddress.getByName(dc.require(HOST).resolve().asString());
        } catch (UnknownHostException e) {
            throw new RuntimeException(e);
        }
        final int port = dc.require(PORT).resolve().asInt();
//        final RemoteDomainConnectionService service = new RemoteDomainConnectionService(name, addr, port, localFileRepository);
//        return serviceTarget.addService(MasterDomainControllerClient.SERVICE_NAME, service)
//                .setInitialMode(ServiceController.Mode.ACTIVE)
//                .install();
        return null;
View Full Code Here

        final ModelNode result = execute(op);
        String error = getFailureDescription(result);
        if (error != null) {
            throw new IllegalStateException(error);
        }
        standalone = result.require(RESULT).asString().equals("STANDALONE");
    }

    int getMBeanCount() {
        return new RootResourceIterator<Integer>(getRootResourceAndRegistration().getResource(), new ResourceAction<Integer>() {
            int count;
View Full Code Here

        public void execute(OperationContext context, ModelNode operation) throws OperationFailedException {
            final ModelNode model = context.readModel(PathAddress.EMPTY_ADDRESS);
            context.getResult().add(createAddOperation(model.hasDefined(CommonAttributes.SHOW_MODEL) ? model.get(CommonAttributes.SHOW_MODEL).asBoolean() : null));
            if (model.hasDefined(CommonAttributes.SERVER_BINDING)) {
                context.getResult().add(createAddConnectorOperation(model.require(CommonAttributes.SERVER_BINDING).asString(), model.require(CommonAttributes.REGISTRY_BINDING).asString()));
            }
            context.completeStep();
        }

        @Override
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.