Package org.agilewiki.jactor

Examples of org.agilewiki.jactor.JAFuture


        MailboxFactory mailboxFactory = JAMailboxFactory.newMailboxFactory(1);
        try {
            Mailbox mailbox = mailboxFactory.createMailbox();
            Driver3 driver = new Driver3();
            driver.initialize(mailbox);
            JAFuture future = new JAFuture();
            System.err.println(SimpleRequest.req.send(future, driver));
        } catch (Throwable e) {
            e.printStackTrace();
        } finally {
            mailboxFactory.close();
View Full Code Here


        MailboxFactory mailboxFactory = JAMailboxFactory.newMailboxFactory(1);
        try {
            Mailbox mailbox = mailboxFactory.createMailbox();
            PrintingCalculator calculator = new PrintingCalculator();
            calculator.initialize(mailbox);
            JAFuture future = new JAFuture();
            future.send(calculator, new Set(1));
            future.send(calculator, new Add(2));
            future.send(calculator, new Multiply(3));
            future.send(calculator, new Divide(0));
        } catch (Throwable e) {
            e.printStackTrace();
        } finally {
            mailboxFactory.close();
        }
View Full Code Here

        MailboxFactory mailboxFactory = JAMailboxFactory.newMailboxFactory(1);
        try {
            Mailbox mailbox = mailboxFactory.createMailbox();
            FactorialCalculation calculator = new FactorialCalculation();
            calculator.initialize(mailbox);
            JAFuture future = new JAFuture();
            System.err.println(future.send(calculator, new Factorial(5)));
        } catch (Throwable e) {
            e.printStackTrace();
        } finally {
            mailboxFactory.close();
        }
View Full Code Here

            throws Exception {
        MailboxFactory mailboxFactory = JAMailboxFactory.newMailboxFactory(1);
        try {
            AllInOne aio = new AllInOne();
            aio.initialize(mailboxFactory.createMailbox());
            Start.req.send(new JAFuture(), aio);
        } finally {
            mailboxFactory.close();
        }
    }
View Full Code Here

            throws Exception {
        MailboxFactory mailboxFactory = JAMailboxFactory.newMailboxFactory(100);
        try {
            Driver driver = new Driver();
            driver.initialize(mailboxFactory.createAsyncMailbox());
            Start.req.send(new JAFuture(), driver);
        } finally {
            mailboxFactory.close();
        }
    }
View Full Code Here

    public void test() {
        MailboxFactory mailboxFactory = JAMailboxFactory.newMailboxFactory(1);
        try {
            JLPCActor a = new EventAReceiver();
            a.initialize(mailboxFactory.createMailbox());
            JAFuture future = new JAFuture();
            SimpleRequest eventA = new SimpleRequest();
            eventA.sendEvent(a);
            eventA.send(future, a);
        } catch (Throwable e) {
            e.printStackTrace();
View Full Code Here

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;
View Full Code Here

    public void test() {
        MailboxFactory mailboxFactory = JAMailboxFactory.newMailboxFactory(1);
        try {
            Goto actor = new Goto();
            actor.initialize(mailboxFactory.createMailbox());
            JAFuture future = new JAFuture();
            System.out.println(SimpleRequest.req.send(future, actor));
        } catch (Throwable e) {
            e.printStackTrace();
        } finally {
            mailboxFactory.close();
View Full Code Here

*/
public class Test4 extends TestCase {
    public void test() throws Exception {
        MailboxFactory mailboxFactory = JAMailboxFactory.newMailboxFactory(10);
        Mailbox mailbox = mailboxFactory.createMailbox();
        JAFuture future = new JAFuture();

        Actor2 actor2 = new Actor2();
        actor2.initialize(mailbox);
        Actor4 actor4 = new Actor4();
        actor4.initialize(mailbox, actor2);
View Full Code Here

    public void test() {
        MailboxFactory mailboxFactory = JAMailboxFactory.newMailboxFactory(1);
        try {
            IfF actor = new IfF();
            actor.initialize(mailboxFactory.createMailbox());
            JAFuture future = new JAFuture();
            System.out.println(SimpleRequest.req.send(future, actor));
        } catch (Throwable e) {
            e.printStackTrace();
        } finally {
            mailboxFactory.close();
View Full Code Here

TOP

Related Classes of org.agilewiki.jactor.JAFuture

Copyright © 2018 www.massapicom. 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.