Package org.jboss.as.controller.client

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


            resolveOperation.get(GlobalOperationHandlers.ResolveAddressOperationHandler.ORIGINAL_OPERATION).set(executionContext.getOperation().require(ModelDescriptionConstants.OP));
            // Aggregate the result as collection using a hacked resolve operation and resultHandler
            final Collection<ModelNode> resolved = new ArrayList<ModelNode>();
            final AtomicInteger status = new AtomicInteger();
            final ModelNode failureResult = new ModelNode();
            final Operation resolveContext = OperationBuilder.Factory.create(resolveOperation).build();
            final ResultHandler resolveHandler = new ResultHandler() {
                @Override
                public void handleResultFragment(String[] location, ModelNode result) {
                    synchronized(failureResult) {
                        if (status.get() == 0) {
View Full Code Here


            for(final ModelNode a : resolved) {
                final ModelNode newOperation = executionContext.getOperation().clone();
                newOperation.get(ModelDescriptionConstants.OP_ADDR).set(a);
                multiStep.get(STEPS).add(newOperation);
            }
            final Operation multiContext = executionContext.clone(multiStep);
            final MultiStepOperationController multistepController = BasicModelController.this.getMultiStepOperationController(multiContext, handler, modelSource, configurationPersisterProvider);
            multistepController.resolve = false; // tell the multi step controller not to resolve again
            // Execute multi step operation
            return multistepController.execute(handler);
        }
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

                ModelControllerClient client = controller.createClient(executor);
                OperationBuilder builder = OperationBuilder.create(operation);
                for (InputStream in : inputStreams) {
                    builder.addInputStream(in);
                }
                Operation op = builder.build();

                try {
                    return client.execute(op);
                } catch (IOException e) {
                    throw new RuntimeException(e);
View Full Code Here

        if (!(plan instanceof DeploymentPlanImpl)) {
            throw new IllegalArgumentException("Cannot use a DeploymentPlan not created by this manager");
        }
        DeploymentPlanImpl planImpl = DeploymentPlanImpl.class.cast(plan);
        Map<UUID, String> actionsById = new HashMap<UUID, String>();
        Operation operation = getDeploymentPlanOperation(planImpl, actionsById);
        Handler handler = new Handler(operation);
        OperationResult c = client.execute(operation, handler.resultHandler);
        handler.setCancellable(c.getCancellable());
        return new DomainDeploymentPlanResultFuture(planImpl, handler, actionsById);
    }
View Full Code Here

    public InitialDeploymentPlanBuilder newDeploymentPlan() {
        return InitialDeploymentPlanBuilderFactory.newInitialDeploymentPlanBuilder(this.contentDistributor);
    }

    private Operation getDeploymentPlanOperation(DeploymentPlanImpl plan, Map<UUID, String> actionsById) {
        Operation op = getCompositeOperation(plan, actionsById);
        addRollbackPlan(plan, op);
        return op;
    }
View Full Code Here

    @Override
    public byte[] addDeploymentContent(InputStream stream) {
        ModelNode op = new ModelNode();
        op.get("operation").set("upload-deployment-stream");
        op.get("input-stream-index").set(0);
        Operation operation = OperationBuilder.Factory.create(op).addInputStream(stream).build();
        ModelNode result = executeForResult(operation);
        return result.asBytes();
    }
View Full Code Here

    public Future<ServerDeploymentPlanResult> execute(DeploymentPlan plan) {
        if (!(plan instanceof DeploymentPlanImpl)) {
            throw new IllegalArgumentException("Plan was not created by this manager");
        }
        DeploymentPlanImpl planImpl = (DeploymentPlanImpl) plan;
        Operation operation = getCompositeOperation(planImpl);
        Future<ModelNode> nodeFuture = executeOperation(operation);
        return new ServerDeploymentPlanResultFuture(planImpl, nodeFuture);
    }
View Full Code Here

        try {
            if(!unmanaged) {
                OperationBuilder op = new OperationBuilder(request);
                op.addFileAsAttachment(f);
                request.get(Util.CONTENT).get(0).get(Util.INPUT_STREAM_INDEX).set(0);
                Operation operation = op.build();
                result = ctx.getModelControllerClient().execute(operation);
                operation.close();
            } else {
                result = ctx.getModelControllerClient().execute(request);
            }
        } catch (Exception e) {
            throw new CommandFormatException("Failed to add the deployment content to the repository: " + e.getLocalizedMessage());
View Full Code Here

        try {
            if(!unmanaged) {
                OperationBuilder op = new OperationBuilder(request);
                op.addFileAsAttachment(f);
                request.get(Util.CONTENT).get(0).get(Util.INPUT_STREAM_INDEX).set(0);
                Operation operation = op.build();
                result = ctx.getModelControllerClient().execute(operation);
                operation.close();
            } else {
                result = ctx.getModelControllerClient().execute(request);
            }
        } catch (Exception e) {
            throw new CommandFormatException("Failed to add the deployment content to the repository: " + e.getLocalizedMessage());
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.