(final Promise<T> p)
| 778 | } |
| 779 | |
| 780 | @Override |
| 781 | public final void proxyTo(final Promise<T> p) { |
| 782 | if (p.isDefined()) |
| 783 | throw new IllegalStateException("Cannot call proxyTo on an already satisfied Promise."); |
| 784 | |
| 785 | final Responder<T> r = new Responder<T>() { |
| 786 | @Override |
| 787 | public final void onException(final Throwable ex) { |
| 788 | p.setException(ex); |
| 789 | } |
| 790 | |
| 791 | @Override |
| 792 | public final void onValue(final T value) { |
| 793 | p.setValue(value); |
| 794 | } |
| 795 | }; |
| 796 | respond(r); |
| 797 | } |
| 798 | |
| 799 | private static final class WithinPromise<T> extends Promise<T> implements Responder<T>, Runnable { |
| 800 |
no test coverage detected