public CommandInvoker<?, ?> resolve(String s) throws CommandException { CRaSHSession session = (CRaSHSession)getSession(); Token token2 = Token.parse(s); try { PipeLineFactory factory = token2.createFactory(); return factory.create(session); } catch (CommandNotFoundException e) { throw new CommandException(ErrorKind.SYNTAX, e.getMessage(), e); } }
public ReplResponse eval(ShellSession session, String request) { PipeLineFactory factory; try { factory = Token.parse(request).createFactory(); } catch (CommandException e) { return new ReplResponse.Response(ShellResponse.error(e.getErrorKind(), e.getMessage(), e.getCause())); } if (factory != null) { try { CommandInvoker<Void, Object> invoker = factory.create(session); return new ReplResponse.Invoke(invoker); } catch (CommandNotFoundException e) { log.log(Level.FINER, "Could not create command", e); return new ReplResponse.Response(ShellResponse.unknownCommand(e.getName())); } catch (CommandException e) { log.log(Level.FINER, "Could not create command", e); return new ReplResponse.Response(ShellResponse.error(e.getErrorKind(), e.getMessage(), e)); } } else { return new ReplResponse.Response(ShellResponse.noCommand()); } }
public CommandInvoker<?, ?> resolve(String s) throws CommandException { CRaSHSession session = (CRaSHSession)getSession(); Token token2 = Token.parse(s); try { PipeLineFactory factory = token2.createFactory(); return factory.create(session); } catch (CommandNotFoundException e) { throw new CommandException(ErrorKind.SYNTAX, e.getMessage(), e); } }
public CommandInvoker<?, ?> resolve(String s) throws CommandException { CRaSHSession session = (CRaSHSession)getSession(); Token token2 = Token.parse(s); try { PipeLineFactory factory = token2.createFactory(); return factory.create(session); } catch (CommandNotFoundException e) { throw new CommandException(ErrorKind.SYNTAX, e.getMessage(), e); } }
public ReplResponse eval(ShellSession session, String request) { PipeLineFactory factory; try { factory = Token.parse(request).createFactory(); } catch (CommandException e) { return new ReplResponse.Response(ShellResponse.error(e.getErrorKind(), e.getMessage(), e.getCause())); } if (factory != null) { try { CommandInvoker<Void, Object> invoker = factory.create(session); return new ReplResponse.Invoke(invoker); } catch (CommandNotFoundException e) { log.log(Level.FINER, "Could not create command", e); return new ReplResponse.Response(ShellResponse.unknownCommand(e.getName())); } catch (CommandException e) { log.log(Level.FINER, "Could not create command", e); return new ReplResponse.Response(ShellResponse.error(e.getErrorKind(), e.getMessage(), e)); } } else { return new ReplResponse.Response(ShellResponse.noCommand()); } }
public ReplResponse eval(ShellSession session, String request) { PipeLineFactory factory; try { factory = Token.parse(request).createFactory(); } catch (CommandException e) { return new ReplResponse.Response(ShellResponse.error(e.getErrorKind(), e.getMessage(), e.getCause())); } if (factory != null) { try { CommandInvoker<Void, Object> invoker = factory.create(session); return new ReplResponse.Invoke(invoker); } catch (CommandNotFoundException e) { log.log(Level.FINER, "Could not create command", e); return new ReplResponse.Response(ShellResponse.unknownCommand(e.getName())); } catch (CommandException e) { log.log(Level.FINER, "Could not create command", e); return new ReplResponse.Response(ShellResponse.error(e.getErrorKind(), e.getMessage(), e)); } } else { return new ReplResponse.Response(ShellResponse.noCommand()); } }