Package org.agilewiki.jactor.lpc.syncTiming

Source Code of org.agilewiki.jactor.lpc.syncTiming.Sync1Test

package org.agilewiki.jactor.lpc.syncTiming;

import junit.framework.TestCase;
import org.agilewiki.jactor.JAFuture;
import org.agilewiki.jactor.JAMailboxFactory;
import org.agilewiki.jactor.Mailbox;
import org.agilewiki.jactor.MailboxFactory;

public class Sync1Test extends TestCase {
    public void test() {
        MailboxFactory mailboxFactory = JAMailboxFactory.newMailboxFactory(1);
        try {
            JAFuture future = new JAFuture();
            Mailbox mailbox = mailboxFactory.createMailbox();
            Echo echo = new Echo();
            echo.initialize(mailbox);
            Sender sender = new Sender();
            sender.count = 10;
            sender.echo = echo;
            sender.initialize(mailbox);
            DoSender.req.send(future, sender);
        } catch (Throwable e) {
            e.printStackTrace();
        } finally {
            mailboxFactory.close();
        }
    }
}
TOP

Related Classes of org.agilewiki.jactor.lpc.syncTiming.Sync1Test

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.