Package org.crsh.shell.impl.command.spi

Examples of org.crsh.shell.impl.command.spi.CommandInvoker


  }


  public final void execute(String s) throws IOException, CommandException {
    InvocationContext<?> context = peekContext();
    CommandInvoker invoker = context.resolve(s);
    invoker.open(context);
    invoker.flush();
    invoker.close();
  }
View Full Code Here


                        ReplResponse.Response shellResponse = (ReplResponse.Response)response;
                        Exception ex = new Exception("Was not expecting response " + shellResponse.response);
                        throw new CommandException(ErrorKind.EVALUATION, "Failure when evaluating '" + request + "'  in script " + name, ex);
                      } else if (response instanceof ReplResponse.Invoke) {
                        ReplResponse.Invoke invokeResponse = (ReplResponse.Invoke)response;
                        CommandInvoker invoker =  invokeResponse.invoker;
                        invoker.invoke(consumer);
                      }
                    }

                    //
                    try {
View Full Code Here

    for (PipeLineFactory current = this;current != null;current = current.next) {
      Command<?> command = session.getCommand(current.name);
      if (command == null) {
        throw new CommandNotFoundException(current.name);
      }
      CommandInvoker commandInvoker = command.resolveInvoker(current.rest);
      if (commandInvoker == null) {
        throw new CommandNotFoundException(current.name);
      }
      pipes.add(commandInvoker);
    }
View Full Code Here

  private CommandContext open(final int index, final CommandContext last) throws IOException, CommandException {
    if (index < invokers.length) {

      //
      final CommandInvoker invoker = invokers[index];
      CommandContext next = open(index + 1, last);

      //
      Class produced = invoker.getProducedType();
      Class<?> consumed = invoker.getConsumedType();
      CommandInvokerAdapter filterContext = new CommandInvokerAdapter(invoker, consumed, produced);
      try {
        filterContext.open(next);
      }
      catch (Exception e) {
View Full Code Here

  }

  public final void execute(String s) throws Exception {
    InvocationContext<?> context = peekContext();
    try {
      CommandInvoker invoker = context.resolve(s);
      invoker.invoke(context);
    }
    catch (CommandException e) {
      Throwable cause = e.getCause();
      if (cause instanceof Exception) {
        throw (Exception)cause;
View Full Code Here

TOP

Related Classes of org.crsh.shell.impl.command.spi.CommandInvoker

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.