Package org.agilewiki.jactor

Examples of org.agilewiki.jactor.JAMailboxFactory.createMailbox()


public class ResponsePrinterTest extends TestCase {
    public void test1() {
        System.out.println("start ResponsePrinterTest 1");
        JAMailboxFactory mailboxFactory = JAMailboxFactory.newMailboxFactory(10);
        try {
            Mailbox mailbox = mailboxFactory.createMailbox();
            Greeter a = new Greeter();
            a.initialize(mailbox);
            ResponsePrinter b = new ResponsePrinter();
            b.initialize(mailbox);
            JAFuture future = new JAFuture();
View Full Code Here


    public void test2() {
        System.out.println("start ResponsePrinterTest 2");
        JAMailboxFactory mailboxFactory = JAMailboxFactory.newMailboxFactory(10);
        try {
            Mailbox mailbox1 = mailboxFactory.createMailbox();
            Mailbox mailbox2 = mailboxFactory.createMailbox();
            Greeter a = new Greeter();
            a.initialize(mailbox1);
            ResponsePrinter b = new ResponsePrinter();
            b.initialize(mailbox2);
View Full Code Here

    public void test2() {
        System.out.println("start ResponsePrinterTest 2");
        JAMailboxFactory mailboxFactory = JAMailboxFactory.newMailboxFactory(10);
        try {
            Mailbox mailbox1 = mailboxFactory.createMailbox();
            Mailbox mailbox2 = mailboxFactory.createMailbox();
            Greeter a = new Greeter();
            a.initialize(mailbox1);
            ResponsePrinter b = new ResponsePrinter();
            b.initialize(mailbox2);
            JAFuture future = new JAFuture();
View Full Code Here

    public void test3() {
        System.out.println("start ResponsePrinterTest 3");
        JAMailboxFactory mailboxFactory = JAMailboxFactory.newMailboxFactory(10);
        try {
            Mailbox mailbox1 = mailboxFactory.createMailbox();
            Mailbox mailbox2 = mailboxFactory.createAsyncMailbox();
            Greeter a = new Greeter();
            a.initialize(mailbox1);
            ResponsePrinter b = new ResponsePrinter();
            b.initialize(mailbox2);
View Full Code Here

        System.out.println("start ResponsePrinterTest 4");
        JAMailboxFactory mailboxFactory = JAMailboxFactory.newMailboxFactory(10);
        try {

            Greeter a = new Greeter();
            a.initialize(mailboxFactory.createMailbox());
            int count = 5;
            ResponsePrinter[] bs = new ResponsePrinter[count];
            int i = 0;
            while (i < count) {
                ResponsePrinter b = new ResponsePrinter();
View Full Code Here

                b.initialize(mailboxFactory.createAsyncMailbox());
                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) {
View Full Code Here

        System.out.println("start ResponsePrinterTest 5");
        JAMailboxFactory mailboxFactory = JAMailboxFactory.newMailboxFactory(10);
        try {

            Greeter a = new Greeter();
            a.initialize(mailboxFactory.createMailbox());
            int count = 5;
            ResponsePrinter[] bs = new ResponsePrinter[count];
            int i = 0;
            while (i < count) {
                ResponsePrinter b = new ResponsePrinter();
View Full Code Here

                b.initialize(mailboxFactory.createAsyncMailbox());
                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) {
View Full Code Here

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.