Package org.jboss.as.controller.client

Examples of org.jboss.as.controller.client.Operation


        deployTwo.get(OP).set(ADD);
        deployTwo.get(OP_ADDR).set(DEPLOYMENT_TWO.toModelNode());
        deployTwo.get(ENABLED).set(true);
        deployTwo.get(CONTENT).add().get(INPUT_STREAM_INDEX).set(1);

        final Operation operation = OperationBuilder.create(composite, true)
                .addFileAsAttachment(deploymentOne)
                .addFileAsAttachment(deploymentTwo)
                .build();

        final ModelControllerClient client = getModelControllerClient();
View Full Code Here


            deploy.get(ModelDescriptionConstants.OP).set("add");
            deploy.get(ModelDescriptionConstants.OP_ADDR).add("deployment", "compat-test.war");
            deploy.get("content").get(0).get("input-stream-index").set(0);
            deploy.get("auto-start").set(true);

            final Operation o = OperationBuilder.create(deploy)
                    .addInputStream(deployment.as(ZipExporter.class).exportAsInputStream()).build();

            try {
                final ModelNode deployResult = client.execute(o);
                Assert.assertEquals(deployResult.toString(), ModelDescriptionConstants.SUCCESS, deployResult.get(ModelDescriptionConstants.OUTCOME).asString());
View Full Code Here

            e.printStackTrace(new PrintWriter(writer));
            Assert.fail("Failed to parse XML; " + writer.toString());
        }

        // Remove and add in a composite operation
        final Operation compositeOp = CompositeOperationBuilder.create()
                .addStep(removeOp)
                .addStep(addOp)
                .build();
        executeOperation(kernelServices, compositeOp);
View Full Code Here

            if (deploymentRepository != null) {
                // Store any uploaded content now
                storeDeploymentContent(operation, opNode);
            }

            Operation localOperation = operation;
            if (targets.size() > 0) {
                // clone things so our local activity doesn't affect the op
                // we send to the other hosts
                localOperation = localOperation.clone(localOperation.getOperation().clone());
            }
            pushToHost(localOperation, transaction, localHostName, futures);
            processHostFuture(localHostName, futures.remove(localHostName), hostResults);
            ModelNode hostResult = hostResults.get(localHostName);
            if (!transaction.isRollbackOnly()) {
View Full Code Here

                return action.execute(operation, handler, modelSource, contextFactory, configurationPersisterProvider);
            }

            final ProxyController proxyExecutor = registry.getProxyController(address);
            if (proxyExecutor != null) {
                Operation newContext = operation.clone();
                newContext.getOperation().get(OP_ADDR).set(address.subAddress(proxyExecutor.getProxyNodeAddress().size()).toModelNode());
                return proxyExecutor.execute(newContext, handler);
            }

            try {
                if (isMultiStepOperation(operation, address)) {
View Full Code Here

                final ModelNode failureResult = new ModelNode();
                for(final ProxyController proxy : proxies) {
                    final PathAddress proxyAddress = proxy.getProxyNodeAddress();
                    final ModelNode newOperation = operation.clone();
                    newOperation.get(OP_ADDR).set(address.subAddress(proxyAddress.size()).toModelNode());
                    final Operation operationContext = OperationBuilder.Factory.create(newOperation).build();
                    proxy.execute(operationContext, new ResultHandler() {
                        @Override
                        public void handleResultFragment(String[] location, ModelNode result) {
                            synchronized(failureResult) {
                                if(status.get() == 0) {
View Full Code Here

            if (executionContext.getOperation().hasDefined(OP_ADDR)) {
                final PathAddress address = PathAddress.pathAddress(executionContext.getOperation().get(OP_ADDR));

                final ProxyController proxyExecutor = getRegistry().getProxyController(address);
                if (proxyExecutor != null) {
                    Operation newContext = executionContext.clone();
                    newContext.getOperation().get(OP_ADDR).set(address.subAddress(proxyExecutor.getProxyNodeAddress().size()).toModelNode());
                    return proxyExecutor.execute(newContext, handler);
                }
            }
            transaction = new ControllerTransaction();
            return execute(executionContext, handler, transaction);
View Full Code Here

        try {
            final PathAddress address = PathAddress.pathAddress(executionContext.getOperation().get(ModelDescriptionConstants.OP_ADDR));

            final ProxyController proxyExecutor = getRegistry().getProxyController(address);
            if (proxyExecutor != null) {
                Operation newContext = executionContext.clone();
                newContext.getOperation().get(OP_ADDR).set(address.subAddress(proxyExecutor.getProxyNodeAddress().size()).toModelNode());
                return proxyExecutor.execute(newContext, handler);
            }

            if (isMultiStepOperation(executionContext, address)) {
                MultiStepOperationController multistepController = getMultiStepOperationController(executionContext, handler, modelSource, configurationPersisterProvider, transaction);
View Full Code Here

        }

        @Override
        protected void sendResponse(final OutputStream outputStream) throws IOException {
            ControllerTransactionContext tx = getTransaction();
            Operation operation = builder.build();
            ModelNode result = transactionalModelController.execute(operation, tx);
            outputStream.write(ModelControllerClientProtocol.PARAM_OPERATION);
            result.writeExternal(outputStream);
        }
View Full Code Here

            final IOExceptionHolder exceptionHolder = new IOExceptionHolder();
            final FailureHolder failureHolder = new FailureHolder();
            final AtomicInteger status = new AtomicInteger(0);

            ControllerTransactionContext tx = getTransaction();
            Operation operation = builder.build();
            OperationResult result = transactionalModelController.execute(operation, new ResultHandler() {
                @Override
                public void handleResultFragment(String[] location, ModelNode fragment) {
                    try {
                        synchronized (outputStream) {
View Full Code Here

TOP

Related Classes of org.jboss.as.controller.client.Operation

Copyright © 2018 www.massapicom. 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.