Examples of CommandContainer


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

        @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

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

         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

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

        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

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

            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

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

         }
         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

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

        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

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

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

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

         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

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

         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

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

         }
         else
         {
            try
            {
               CommandContainer exitCommand = registry.getCommand("exit", "");
               // print a new line so we exit nicely
               console.getShell().out().println();
               exitCommand.getCommand().execute(
                        new AeshCommandInvocation((AeshConsoleImpl) ShellImpl.this.console, ControlOperator.NONE, 1,
                                 null));
            }
            catch (InterruptedException | CommandNotFoundException | IOException e)
            {
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.