Package org.jboss.as.controller

Examples of org.jboss.as.controller.OperationResult


            return super.doExecute(operationHandlerContext, operation, operationHandler, resultHandler, address, operationControllerContext);
        }

        try {
            ModelNode opNode = operation.getOperation();
            final OperationResult result = operationHandler.execute(operationHandlerContext, opNode, resultHandler);
            ControllerResource txResource = getControllerResource(operationHandlerContext, opNode, operationHandler, resultHandler,
                                                                  address, operationControllerContext);
            if (txResource != null) {
                transaction.registerResource(txResource);
            }
View Full Code Here


        RollbackAwareResultHandler rollbackAwareHandler = null;
        if (rollback) {
            rollbackAwareHandler = new RollbackAwareResultHandler(resultHandler);
            resultHandler = rollbackAwareHandler;
        }
        final OperationResult result = super.doExecute(context, operation, operationHandler, resultHandler, address, modelProvider, configurationPersisterFactory);
        if(context instanceof ServerOperationContextImpl) {
            if (rollbackAwareHandler != null) {
                rollbackAwareHandler.setRollbackOperation(result.getCompensatingOperation());
                // TODO deal with Cancellable as well
            }
            final ServerOperationContextImpl serverOperationContext = ServerOperationContextImpl.class.cast(context);
            if(serverOperationContext.getRuntimeTask() != null) {
                try {
View Full Code Here

        RollbackAwareResultHandler rollbackAwareHandler = null;
        if (rollback) {
            rollbackAwareHandler = new RollbackAwareResultHandler(resultHandler);
            resultHandler = rollbackAwareHandler;
        }
        final OperationResult result = super.doExecute(context, operation, operationHandler, resultHandler, address, operationControllerContext);
        if(context instanceof ServerOperationContextImpl) {
            if (rollbackAwareHandler != null) {
                rollbackAwareHandler.setRollbackOperation(result.getCompensatingOperation());
                // TODO deal with Cancellable as well
            }
            final ServerOperationContextImpl serverOperationContext = ServerOperationContextImpl.class.cast(context);
            if(serverOperationContext.getRuntimeTask() != null) {
                try {
View Full Code Here

     * {@inheritDoc}
     */
    @Override
    protected Future<ModelNode> executeOperation(Operation executionContext) {
        Handler handler = new Handler(executionContext);
        OperationResult c = client.execute(executionContext, handler.resultHandler);
        handler.setCancellable(c.getCancellable());
        return handler;
    }
View Full Code Here

     * {@link OperationHandler} reading a single attribute at the given operation address. The required request parameter "name" represents the attribute name.
     */
    public static class ReadAttributeHandler implements ModelQueryOperationHandler {
        @Override
        public OperationResult execute(final OperationContext context, final ModelNode operation, final ResultHandler resultHandler) throws OperationFailedException {
            OperationResult handlerResult = new BasicOperationResult();

            final String attributeName = operation.require(NAME).asString();
            final PathAddress address = PathAddress.pathAddress(operation.get(OP_ADDR));
            final AttributeAccess attributeAccess = context.getRegistry().getAttributeAccess(address, attributeName);
            if (attributeAccess == null) {
View Full Code Here

     * {@link OperationHandler} writing a single attribute. The required request parameter "name" represents the attribute name.
     */
    public static class WriteAttributeHandler implements ModelUpdateOperationHandler {
        @Override
        public OperationResult execute(final OperationContext context, final ModelNode operation, final ResultHandler resultHandler) throws OperationFailedException {
            OperationResult handlerResult = null;

            final String attributeName = operation.require(NAME).asString();
            final AttributeAccess attributeAccess = context.getRegistry().getAttributeAccess(PathAddress.pathAddress(operation.get(OP_ADDR)), attributeName);
            if (attributeAccess == null) {
                throw new OperationFailedException(new ModelNode().set("No known attribute called " + attributeName)); // TODO i18n
View Full Code Here

    @Override
    protected OperationResult doExecute(OperationContext context, Operation operation, OperationHandler operationHandler, ResultHandler resultHandler, PathAddress address,
            final OperationControllerContext operationControllerContext) throws OperationFailedException {
        boolean rollback = isRollbackOnRuntimeFailure(context, operation.getOperation());
        RollbackAwareResultHandler rollbackAwareHandler = new RollbackAwareResultHandler(resultHandler);
        final OperationResult result = super.doExecute(context, operation, operationHandler, rollbackAwareHandler, address, operationControllerContext);
        if(context instanceof ServerOperationContextImpl) {
            if (rollback) {
                rollbackAwareHandler.setRollbackOperation(result.getCompensatingOperation());
                // TODO deal with Cancellable as well
            }
            final ServerOperationContextImpl serverOperationContext = ServerOperationContextImpl.class.cast(context);
            if(serverOperationContext.getRuntimeTask() != null) {
View Full Code Here

TOP

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

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.