Package org.agilewiki.jactor

Examples of org.agilewiki.jactor.Mailbox


    public void test5() {
        System.err.println("test 5");
        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));
View Full Code Here


    public void test6() {
        System.err.println("test 6");
        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) {
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;
            sender.echo = echo;
View Full Code Here

* Test code.
*/
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();
View Full Code Here

* Test code.
*/
public class Test3 extends TestCase {
    public void test() throws Exception {
        MailboxFactory mailboxFactory = JAMailboxFactory.newMailboxFactory(10);
        Mailbox mailbox = mailboxFactory.createMailbox();
        Actor1 actor1 = new Actor1();
        actor1.initialize(mailbox);
        Actor2 actor2 = new Actor2();
        actor2.initialize(mailbox, actor1);
        Actor3 actor3 = new Actor3();
View Full Code Here

* Test code.
*/
public class Test2 extends TestCase {
    public void test() throws Exception {
        MailboxFactory mailboxFactory = JAMailboxFactory.newMailboxFactory(10);
        Mailbox mailbox = mailboxFactory.createMailbox();
        Actor1 actor1 = new Actor1();
        actor1.initialize(mailbox);
        Actor2 actor2 = new Actor2();
        actor2.initialize(mailbox, actor1);
        JAFuture future = new JAFuture();
View Full Code Here

* Test code.
*/
public class Test5 extends TestCase {
    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);
View Full Code Here

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);
            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);
            JAFuture future = new JAFuture();
View Full Code Here

TOP

Related Classes of org.agilewiki.jactor.Mailbox

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.