Package org.jboss.as.controller

Examples of org.jboss.as.controller.BasicOperationResult


        }
        if (model.hasDefined(HANDOFF_EXECUTOR)) {
            compensating.get(HANDOFF_EXECUTOR).set(model.get(HANDOFF_EXECUTOR));
        }

        return new BasicOperationResult(compensating);
    }
View Full Code Here


                // not a problem
    //            return masterDomainControllerClient.execute(operationContext, handler);
                PathAddress addr = PathAddress.pathAddress(operationNode.get(OP_ADDR));
                handler.handleFailed(new ModelNode().set("Operations for address " + addr +
                        " can only handled by the master Domain Controller; this host is not the master Domain Controller"));
                return new BasicOperationResult();
            }
            else if (!routing.isTwoStep()) {
                // It's either for a read of a domain-level resource or it's for a single host-level resource,
                // either of which a single host client can handle directly
                String host = routing.getSingleHost();
                // System.out.println("------ route to host " + host);
                return executeOnHost(host, operation, handler);
            }
            else {
                // Else we are responsible for coordinating a two-phase op
                // -- apply to DomainController models across domain and then push to servers
                return executeTwoPhaseOperation(operation, handler, operationNode, routing);
            }
        } catch (OperationFailedException e) {
            log.debugf(e, "operation (%s) failed - address: (%s)", operation.getOperation().get(OP), operation.getOperation().get(OP_ADDR));
            handler.handleFailed(e.getFailureDescription());
            return new BasicOperationResult();
        } catch (final Throwable t) {
            log.errorf(t, "operation (%s) failed - address: (%s)", operation.getOperation().get(OP), operation.getOperation().get(OP_ADDR));
            handler.handleFailed(getFailureResult(t));
            return new BasicOperationResult();
        }
    }
View Full Code Here

                    handler.handleResultFragment(Util.NO_LOCATION, fragment);
                }
            }

            handler.handleResultComplete();
            return new BasicOperationResult(domainResult.compensatingOperation);
        }

        // Push to servers (via hosts)
        RolloutPlanController controller = new RolloutPlanController(domainResult.opsByGroup, domainResult.rolloutPlan, handler, serverOperationExecutor, scheduledExecutorService, false);
        RolloutPlanController.Result controllerResult = controller.execute();

        // Rollback if necessary
        switch (controllerResult) {
            case FAILED: {
                controller.rollback();
                handler.handleFailed(new ModelNode().set("Operation was not applied successfully to any servers"));
                return new BasicOperationResult(domainResult.compensatingOperation);
            }
            case PARTIAL: {
                controller.rollback();
                // fall through
            }
            case SUCCESS: {
                handler.handleResultComplete();
                return new BasicOperationResult(domainResult.compensatingOperation);
            }
            default:
                throw new IllegalStateException(String.format("Unknown %s %s", RolloutPlanController.Result.class.getCanonicalName(), controllerResult));
        }
View Full Code Here

    private OperationResult executeOnHost(String hostName, Operation operation, ResultHandler handler) {
        DomainControllerSlaveClient client = hosts.get(hostName);
        if (client == null) {
            handler.handleFailed(new ModelNode().set("No host called " + hostName + " exists"));
            return new BasicOperationResult();
        }
        else if (hostName.equals(localHostName)) {
            return client.execute(operation, handler);
        }
        else {
View Full Code Here

                }
            });
        } else {
            resultHandler.handleResultComplete();
        }
        return new BasicOperationResult(compensatingOperation);
    }
View Full Code Here

                }
            });
        } else {
            resultHandler.handleResultComplete();
        }
        return new BasicOperationResult(compensating);
    }
View Full Code Here

            ModelNode result = new ModelNode();
            result.add(add);

            resultHandler.handleResultFragment(Util.NO_LOCATION, result);
            resultHandler.handleResultComplete();
            return new BasicOperationResult();
        }
View Full Code Here

        }
        if (model.has(DEFAULT_WORKMANAGER_SHORT_RUNNING_THREAD_POOL)) {
            compensating.get(DEFAULT_WORKMANAGER_SHORT_RUNNING_THREAD_POOL).set(
                    model.get(DEFAULT_WORKMANAGER_SHORT_RUNNING_THREAD_POOL));
        }
        return new BasicOperationResult(compensating);
    }
View Full Code Here

        } else {
            resultHandler.handleResultComplete();
        }

        final ModelNode compensatingOperation = Util.getResourceRemoveOperation(operation.require(OP_ADDR));
        return new BasicOperationResult(compensatingOperation);
    }
View Full Code Here

            resultHandler.handleResultComplete();
        }

        // Create the compensating operation
        final ModelNode compensatingOperation = Util.getResourceRemoveOperation(operation.require(OP_ADDR));
        return new BasicOperationResult(compensatingOperation);
    }
View Full Code Here

TOP

Related Classes of org.jboss.as.controller.BasicOperationResult

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.