001 // Copyright 2010 Waterken Inc. under the terms of the MIT X license 002 // found at http://www.opensource.org/licenses/mit-license.html 003 package org.waterken.delayed; 004 005 import java.io.Serializable; 006 007 import org.joe_e.Struct; 008 import org.ref_send.promise.Deferred; 009 import org.ref_send.promise.Eventual; 010 import org.ref_send.promise.Promise; 011 012 /** 013 * A {@link Forwarder} maker. 014 */ 015 public final class 016 ForwarderMaker { 017 private ForwarderMaker() {} 018 019 static public Forwarder 020 make(final Eventual _) { 021 class ForwarderX extends Struct implements Forwarder, Serializable { 022 static private final long serialVersionUID = 1L; 023 024 public Promise<Deferred<Boolean>> 025 forward() { 026 final Deferred<Boolean> r = _.defer(); 027 return Eventual.ref(r); 028 } 029 } 030 return new ForwarderX(); 031 } 032 }