Package org.agilewiki.jactor

Examples of org.agilewiki.jactor.JAFuture


*/
public class ReturnVTest extends TestCase {
    public void test() {
        MailboxFactory mailboxFactory = JAMailboxFactory.newMailboxFactory(1);
        try {
            JAFuture future = new JAFuture();
            ReturnV1 actor1 = new ReturnV1();
            actor1.initialize(mailboxFactory.createMailbox());
            System.out.println(SimpleRequest.req.send(future, actor1));
            ReturnV2 actor2 = new ReturnV2();
            actor2.initialize(mailboxFactory.createMailbox());
View Full Code Here


    public void test() {
        MailboxFactory mailboxFactory = JAMailboxFactory.newMailboxFactory(1);
        try {
            SetV1 actor = new SetV1();
            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

        Mailbox mailbox = mailboxFactory.createMailbox();
        Actor1 actor1 = new Actor1();
        actor1.initialize(mailbox);
        Actor2 actor2 = new Actor2();
        actor2.initialize(mailbox, actor1);
        JAFuture future = new JAFuture();
        Greet1.req.send(future, actor2);
        mailboxFactory.close();
    }
View Full Code Here

    public void test() {
        MailboxFactory mailboxFactory = JAMailboxFactory.newMailboxFactory(1);
        try {
            It actor = new It();
            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 void test() throws Exception {
        MailboxFactory mailboxFactory = JAMailboxFactory.newMailboxFactory(10);
        Mailbox mailbox = mailboxFactory.createMailbox();
        Actor5a actor5a = new Actor5a();
        actor5a.initialize(mailbox);
        JAFuture future = new JAFuture();
        boolean response = Parallel.req.send(future, actor5a);
        assertEquals(true, response);
        mailboxFactory.close();
    }
View Full Code Here

            Mailbox mailbox = mailboxFactory.createMailbox();
            Greeter a = new Greeter();
            a.initialize(mailbox);
            ResponsePrinter b = new ResponsePrinter();
            b.initialize(mailbox);
            JAFuture future = new JAFuture();
            (new PrintResponse(new Hi(), a)).send(future, b);
        } catch (Throwable e) {
            e.printStackTrace();
        } finally {
            System.out.println("end ResponsePrinterTest 1");
View Full Code Here

            Mailbox mailbox2 = mailboxFactory.createMailbox();
            Greeter a = new Greeter();
            a.initialize(mailbox1);
            ResponsePrinter b = new ResponsePrinter();
            b.initialize(mailbox2);
            JAFuture future = new JAFuture();
            (new PrintResponse(new Hi(), a)).send(future, b);
        } catch (Throwable e) {
            e.printStackTrace();
        } finally {
            System.out.println("end ResponsePrinterTest 2");
View Full Code Here

            Mailbox mailbox2 = mailboxFactory.createAsyncMailbox();
            Greeter a = new Greeter();
            a.initialize(mailbox1);
            ResponsePrinter b = new ResponsePrinter();
            b.initialize(mailbox2);
            JAFuture future = new JAFuture();
            (new PrintResponse(new Hi(), a)).send(future, b);
        } catch (Throwable e) {
            e.printStackTrace();
        } finally {
            System.out.println("end ResponsePrinterTest 3");
View Full Code Here

                bs[i] = b;
                i += 1;
            }
            ParallelResponsePrinter c = new ParallelResponsePrinter();
            c.initialize(mailboxFactory.createMailbox());
            JAFuture future = new JAFuture();
            PrintResponse printResponse = new PrintResponse(new Hi(), a);
            PrintParallelResponse printParallelResponse = new PrintParallelResponse(count, bs, printResponse);
            printParallelResponse.send(future, c);
        } catch (Throwable e) {
            e.printStackTrace();
View Full Code Here

                bs[i] = b;
                i += 1;
            }
            ParallelResponsePrinter c = new ParallelResponsePrinter();
            c.initialize(mailboxFactory.createMailbox());
            JAFuture future = new JAFuture();
            PrintResponse printResponse = new PrintResponse(new Hi(), a);
            PrintParallelResponse printParallelResponse = new PrintParallelResponse(count, bs, printResponse);
            int j = 0;
            while (j < 1) {
                printParallelResponse.send(future, c);
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.