Package org.jboss.aesh.console.command.container

Examples of org.jboss.aesh.console.command.container.CommandContainer


            throws CommandNotFoundException {
        try {
            return registry.getCommand(name, line);
        } catch (CommandNotFoundException e) {
            if (internalRegistry != null) {
                CommandContainer cc = internalRegistry.getCommand(name);
                if (cc != null)
                    return cc;
            }
            throw e;
        }
View Full Code Here


            throws CommandNotFoundException {
        try {
            return registry.getCommand(name, line);
        } catch (CommandNotFoundException e) {
            if (internalRegistry != null) {
                CommandContainer cc = internalRegistry.getCommand(name);
                if (cc != null)
                    return cc;
            }
            throw e;
        }
View Full Code Here

        }
    }

    @Override
    public String getHelpInfo(String commandName) {
        CommandContainer commandContainer = null;
        try {
            commandContainer = registry.getCommand(commandName, "");
        }
        catch (CommandNotFoundException e) {
            e.printStackTrace();
        }
        if(commandContainer != null)
            return commandContainer.getParser().printHelp();
        else
            return "";
    }
View Full Code Here

        try {
            return registry.getCommand(name, line);
        }
        catch (CommandNotFoundException e) {
            if(internalRegistry != null) {
                CommandContainer cc = internalRegistry.getCommand(name);
                if(cc != null)
                    return cc;
            }
            throw e;
        }
View Full Code Here

            if(completedCommands.size() > 0) {
                completeOperation.addCompletionCandidates(completedCommands);
            }
            else {
                try {
                    CommandContainer commandContainer =
                            getCommand( Parser.findFirstWord(completeOperation.getBuffer()), completeOperation.getBuffer());
                    CommandLineCompletionParser completionParser = commandContainer.getParser().getCompletionParser();

                    ParsedCompleteObject completeObject =
                            completionParser.findCompleteObject( completeOperation.getBuffer(), completeOperation.getCursor());
                    completionParser.injectValuesAndComplete(completeObject, commandContainer.getCommand(), completeOperation);
                }
                catch (CommandLineParserException e) {
                    logger.warning(e.getMessage());
                }
                catch (CommandNotFoundException ignored) {
View Full Code Here

        @Override
        public int readConsoleOutput(ConsoleOperation output) {
            CommandResult result = CommandResult.SUCCESS;
            if(output != null && output.getBuffer().trim().length() > 0) {
                try {
                    CommandContainer commandContainer =
                            getCommand( Parser.findFirstWord(output.getBuffer()), output.getBuffer());

                    commandContainer.getParser().getCommandPopulator().populateObject(commandContainer.getCommand(),
                            commandContainer.getParser().parse(output.getBuffer()));
                    //validate the command before execute
                    if(commandContainer.getParser().getCommand().getValidator() != null)
                        commandContainer.getParser().getCommand().getValidator().validate(commandContainer.getCommand());
                    result = commandContainer.getCommand().execute(
                            commandInvocationServices.getCommandInvocationProvider(commandInvocationProvider)
                                    .enhanceCommandInvocation(new AeshCommandInvocation(console, output.getControlOperator())));
                }
                catch (CommandLineParserException e) {
                    getShell().out().println(e.getMessage());
View Full Code Here

         return getForgeCommand(shellContext, name, completeLine);
      }
      catch (CommandNotFoundException cnfe)
      {
         // Not a forge command, fallback to aesh command
         CommandContainer nativeCommand = aeshCommandRegistry.getCommand(name, completeLine);
         AeshUICommand aeshCommand = new AeshUICommand(nativeCommand);
         SingleCommandController controller = commandControllerFactory.createSingleController(shellContext, shell,
                  aeshCommand);
         try
         {
View Full Code Here

        try {
            return registry.getCommand(name, line);
        }
        catch (CommandNotFoundException e) {
            if (internalRegistry != null) {
                CommandContainer cc = internalRegistry.getCommand(name);
                if (cc != null)
                    return cc;
            }
            throw e;
        }
View Full Code Here

            return registry.getCommand(aeshLine.getWords().get(0), line);
            //return commandContainer;
        }
        catch (CommandNotFoundException e) {
            if (internalRegistry != null) {
                CommandContainer cc = internalRegistry.getCommand(aeshLine.getWords().get(0));
                if (cc != null)
                    return cc;
            }
            throw e;
        }
View Full Code Here

         }
         else
         {
            try
            {
               CommandContainer exitCommand = registry.getCommand("exit", "");
               // print a new line so we exit nicely
               console.getShell().out().println();
               exitCommand.getCommand().execute(
                        new AeshCommandInvocation(ShellImpl.this.console, ControlOperator.NONE, null));
            }
            catch (CommandNotFoundException | IOException e)
            {
               log.log(Level.WARNING, "Error while trying to run exit", e);
View Full Code Here

TOP

Related Classes of org.jboss.aesh.console.command.container.CommandContainer

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.