Examples of discardActiveBatch()


Examples of org.jboss.as.cli.batch.BatchManager.discardActiveBatch()

        }

        ifBlock.setIfRequest(ifBatch.toRequest());
        ifBlock.setInElse();

        batchManager.discardActiveBatch();
        if(!batchManager.activateNewBatch()) {
            IfElseBlock.remove(ctx);
            // that's more like illegal state
            throw new CommandFormatException("Failed to activate batch mode for else.");
        }
View Full Code Here

Examples of org.jboss.as.cli.batch.BatchManager.discardActiveBatch()

                while(line != null) {
                    batch.add(ctx.toBatchedCommand(line));
                    line = reader.readLine();
                }
            } catch(IOException e) {
                batchManager.discardActiveBatch();
                throw new CommandLineException("Failed to read file " + f.getAbsolutePath(), e);
            } catch(CommandFormatException e) {
                batchManager.discardActiveBatch();
                throw new CommandLineException("Failed to create batch from " + f.getAbsolutePath(), e);
            } finally {
View Full Code Here

Examples of org.jboss.as.cli.batch.BatchManager.discardActiveBatch()

                }
            } catch(IOException e) {
                batchManager.discardActiveBatch();
                throw new CommandLineException("Failed to read file " + f.getAbsolutePath(), e);
            } catch(CommandFormatException e) {
                batchManager.discardActiveBatch();
                throw new CommandLineException("Failed to create batch from " + f.getAbsolutePath(), e);
            } finally {
                if(baseDir != null) {
                    ctx.setCurrentDir(currentDir);
                }
View Full Code Here

Examples of org.jboss.as.cli.batch.BatchManager.discardActiveBatch()

                throw new CommandFormatException("--file is not allowed in the batch mode.");
            }
            final Batch batch = batchManager.getActiveBatch();
            List<BatchedCommand> currentBatch = batch.getCommands();
            if(currentBatch.isEmpty()) {
                batchManager.discardActiveBatch();
                throw new CommandFormatException("The batch is empty.");
            }
            return batch.toRequest();
        }
View Full Code Here

Examples of org.jboss.as.cli.batch.BatchManager.discardActiveBatch()

            } catch(IOException e) {
                throw new CommandFormatException("Failed to read file " + f.getAbsolutePath(), e);
            } catch(CommandFormatException e) {
                throw new CommandFormatException("Failed to create batch from " + f.getAbsolutePath(), e);
            } finally {
                batchManager.discardActiveBatch();
                if(baseDir != null) {
                    ctx.setCurrentDir(currentDir);
                }
                if(reader != null) {
                    try {
View Full Code Here

Examples of org.jboss.as.cli.batch.BatchManager.discardActiveBatch()

        return currentBatch;
    }

    private void discardBatch(CommandContext ctx, String holdbackBatch) {
        BatchManager batchManager = ctx.getBatchManager();
        batchManager.discardActiveBatch();
        if (holdbackBatch != null) {
            batchManager.activateHeldbackBatch(holdbackBatch);
        }
    }
View Full Code Here

Examples of org.jboss.as.cli.batch.BatchManager.discardActiveBatch()

        return currentBatch;
    }

    private void discardBatch(CommandContext ctx, String holdbackBatch) {
        BatchManager batchManager = ctx.getBatchManager();
        batchManager.discardActiveBatch();
        if (holdbackBatch != null) {
            batchManager.activateHeldbackBatch(holdbackBatch);
        }
    }
View Full Code Here

Examples of org.jboss.as.cli.batch.BatchManager.discardActiveBatch()

        final Batch batch = batchManager.getActiveBatch();
        List<BatchedCommand> currentBatch = batch.getCommands();
        if(currentBatch.isEmpty()) {
            ctx.error("The batch is empty.");
            batchManager.discardActiveBatch();
            return;
        }

        final ModelNode composite = batch.toRequest();
        try {
View Full Code Here

Examples of org.jboss.as.cli.batch.BatchManager.discardActiveBatch()

        final ModelNode composite = batch.toRequest();
        try {
            ModelNode result = ctx.getModelControllerClient().execute(composite);
            if(Util.isSuccess(result)) {
                batchManager.discardActiveBatch();
                ctx.printLine("The batch executed successfully.");
            } else {
                ctx.error("Failed to execute batch: " + Util.getFailureDescription(result));
            }
        } catch (Exception e) {
View Full Code Here

Examples of org.jboss.as.cli.batch.BatchManager.discardActiveBatch()

        return currentBatch;
    }

    private void discardBatch(CommandContext ctx, String holdbackBatch) {
        BatchManager batchManager = ctx.getBatchManager();
        batchManager.discardActiveBatch();
        if (holdbackBatch != null) {
            batchManager.activateHeldbackBatch(holdbackBatch);
        }
    }
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.