public void flush() throws IOException { if (real != null) { real.flush(); } else { invocationContext.flush(); } }
public void open(InvocationContext<P> consumer) throws Exception { this.context = consumer; // open(); }
public void provide(C element) throws IOException, CommandException { if (real != null) { try { real.provide(element); } catch (Exception e) { throw new CommandException(ErrorKind.EVALUATION, "Command " + name + " failed", e); } } }
public void close() throws IOException, CommandException { try { try { if (real != null) { real.close(); } } catch (Exception e) { throw new CommandException(ErrorKind.EVALUATION, "Command " + name + " failed", e); } finally { try { invocationContext.close(); } catch (Exception e) { throw new CommandException(ErrorKind.EVALUATION, e); } } } finally { command.popContext(); command.unmatched = null; } } };
public void close() throws IOException, CommandException { try { try { if (real != null) { real.close(); } } catch (Exception e) { throw new CommandException(ErrorKind.EVALUATION, "Command " + name + " failed", e); } finally { try { invocationContext.close(); } catch (Exception e) { throw new CommandException(ErrorKind.EVALUATION, e); } } } finally { command.popContext(); command.unmatched = null; } } };
@Override public void flush() throws IOException { for (String s : buffer) { try { context.provide(s); } catch (Exception e) { throw new UndeclaredThrowableException(e); } } buffer.clear(); super.flush(); } };
public void open(InvocationContext<P> consumer) throws Exception { this.context = consumer; // open(); }
public void provide(C element) throws IOException, CommandException { if (real != null) { try { real.provide(element); } catch (Exception e) { throw new CommandException(ErrorKind.EVALUATION, "Command " + name + " failed", e); } } }
public void close() throws IOException, CommandException { try { try { if (real != null) { real.close(); } } catch (Exception e) { throw new CommandException(ErrorKind.EVALUATION, "Command " + name + " failed", e); } finally { try { invocationContext.close(); } catch (Exception e) { throw new CommandException(ErrorKind.EVALUATION, e); } } } finally { command.popContext(); command.unmatched = null; } } };
public void flush() throws IOException { if (real != null) { real.flush(); } else { invocationContext.flush(); } }
public void open(InvocationContext<P> consumer) throws Exception { this.context = consumer; // open(); }
public void provide(C element) throws IOException, CommandException { if (real != null) { try { real.provide(element); } catch (Exception e) { throw new CommandException(ErrorKind.EVALUATION, "Command " + name + " failed", e); } } }
public void flush() throws IOException { if (real != null) { real.flush(); } else { invocationContext.flush(); } }
public void open2(final CommandContext<P> consumer) throws CommandException { // invocationContext = new InvocationContextImpl<P>(consumer); // Push context command.pushContext(invocationContext); // Set the unmatched part command.unmatched = invoker.getMatch().getRest(); // PC ret; try { ret = invoker.invoke(this); } catch (org.crsh.cli.impl.SyntaxException e) { throw new CommandException(ErrorKind.SYNTAX, "Syntax exception when executing command " + name, e); } catch (InvocationException e) { throw new CommandException(ErrorKind.EVALUATION, "Command " + name + " failed", e.getCause()); } // It's a pipe command if (ret != null) { real = ret; try { real.open(invocationContext); } catch (Exception e) { throw new CommandException(ErrorKind.EVALUATION, "Command " + name + " failed", e); } } }
public void open2(final CommandContext<P> consumer) throws CommandException { // invocationContext = new InvocationContextImpl<P>(consumer); // Push context command.pushContext(invocationContext); // Set the unmatched part command.unmatched = invoker.getMatch().getRest(); // PC ret; try { ret = invoker.invoke(this); } catch (org.crsh.cli.impl.SyntaxException e) { throw new CommandException(ErrorKind.SYNTAX, "Syntax exception when executing command " + name, e); } catch (InvocationException e) { throw new CommandException(ErrorKind.EVALUATION, "Command " + name + " failed", e.getCause()); } // It's a pipe command if (ret != null) { real = ret; try { real.open(invocationContext); } catch (Exception e) { throw new CommandException(ErrorKind.EVALUATION, "Command " + name + " failed", e); } } }
public void open2(final CommandContext<P> consumer) throws CommandException { // invocationContext = new InvocationContextImpl<P>(consumer); // Push context command.pushContext(invocationContext); // Set the unmatched part command.unmatched = invoker.getMatch().getRest(); // PC ret; try { ret = invoker.invoke(this); } catch (org.crsh.cli.impl.SyntaxException e) { throw new CommandException(ErrorKind.SYNTAX, "Syntax exception when executing command " + name, e); } catch (InvocationException e) { throw new CommandException(ErrorKind.EVALUATION, "Command " + name + " failed", e.getCause()); } // It's a pipe command if (ret != null) { real = ret; try { real.open(invocationContext); } catch (Exception e) { throw new CommandException(ErrorKind.EVALUATION, "Command " + name + " failed", e); } } }