protected final NextAction doSuspend(Tube next, Runnable onExitRunnable) { NextAction na = new NextAction(); na.suspend(next, onExitRunnable); return na; }
protected final NextAction doInvoke(Tube next, Packet packet) { NextAction na = new NextAction(); na.invoke(next,packet); return na; }
protected final NextAction doInvokeAndForget(Tube next, Packet packet) { NextAction na = new NextAction(); na.invokeAndForget(next,packet); return na; }
protected final NextAction doThrow(Packet response, Throwable t) { NextAction na = new NextAction(); na.throwException(response, t); return na; }
/** * Indicates that the next action is to abort the processResponse chain * because of an exception. How that exception is processed is not * defined. * * @param t * Either {@link RuntimeException} or {@link Error} */ public void throwExceptionAbortResponse(Throwable t) { set(THROW_ABORT_RESPONSE,null,null,t); }
protected final NextAction doReturnWith(Packet response) { NextAction na = new NextAction(); na.returnWith(response); return na; }
/** * Indicates that the fiber should be suspended. * Once {@link Fiber#resume(Packet) resumed}, resume with the * {@link Tube#processRequest(Packet)} on the given next tube. * @deprecated Use variants that pass {@link Runnable} */ public void suspend(Tube next) { suspend(next, null); }
JPanel btnPanel = new JPanel(new GridLayout(1, 0, 5, 0)); btnPanel.add(new JButton(new PrevAction(this, "Previous", KeyEvent.VK_P))); btnPanel.add(new JButton(new NextAction(this, "Next", KeyEvent.VK_N))); JPanel bottomPanel = new JPanel(); bottomPanel.add(btnPanel);
/** * Dumps the contents to assist debugging. */ @Override public String toString() { StringBuilder buf = new StringBuilder(); buf.append(super.toString()).append(" ["); buf.append("kind=").append(getKindString()).append(','); buf.append("next=").append(next).append(','); buf.append("packet=").append(packet != null ? packet.toShortString() : null).append(','); buf.append("throwable=").append(throwable).append(']'); return buf.toString(); }
protected final NextAction doThrow(Throwable t) { NextAction na = new NextAction(); na.throwException(t); return na; }
/** * Indicates that the next action should be to * invoke the next tube's {@link Tube#processRequest(Packet)}, * then later invoke the current tube's {@link Tube#processResponse(Packet)} * with the response packet. */ public void invoke(Tube next, Packet p) { set(INVOKE, next, p, null); }
protected final NextAction doReturnWith(Packet response) { NextAction na = new NextAction(); na.returnWith(response); return na; }
/** * Indicates that the fiber should be suspended. * Once {@link Fiber#resume(Packet) resumed}, return the response processing. * @deprecated Use variants that pass {@link Runnable} */ public void suspend() { suspend(null, null); }
/** * Dumps the contents to assist debugging. */ @Override public String toString() { StringBuilder buf = new StringBuilder(); buf.append(super.toString()).append(" ["); buf.append("kind=").append(getKindString()).append(','); buf.append("next=").append(next).append(','); buf.append("packet=").append(packet != null ? packet.toShortString() : null).append(','); buf.append("throwable=").append(throwable).append(']'); return buf.toString(); }
protected final NextAction doSuspend(Runnable onExitRunnable) { NextAction na = new NextAction(); na.suspend(onExitRunnable); return na; }
protected final NextAction doThrow(Packet response, Throwable t) { NextAction na = new NextAction(); na.throwException(response, t); return na; }
/** * Indicates that the next action is to flip the processing direction * and starts response processing. */ public void returnWith( Packet response ) { set(RETURN, null, response, null); }
protected final NextAction doInvoke(Tube next, Packet packet) { NextAction na = new NextAction(); na.invoke(next,packet); return na; }
protected final NextAction doInvokeAndForget(Tube next, Packet packet) { NextAction na = new NextAction(); na.invokeAndForget(next,packet); return na; }
protected final NextAction doReturnWith(Packet response) { NextAction na = new NextAction(); na.returnWith(response); return na; }