Package org.agilewiki.jactor

Examples of org.agilewiki.jactor.MailboxFactory


/**
* Test code.
*/
public class GotoTest extends TestCase {
    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


/**
* 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();
        actor4.initialize(mailbox, actor2);
        boolean result = Validate1.req.send(future, actor4);
        assertFalse(result);

        Actor1 actor1a = new Actor1();
        actor1a.initialize(mailbox);
        Actor2 actor2a = new Actor2();
        actor2a.initialize(mailbox, actor1a);
        Actor4 actor4a = new Actor4();
        actor4a.initialize(mailbox, actor2a);
        result = Validate1.req.send(future, actor4a);
        assertTrue(result);
        mailboxFactory.close();
    }
View Full Code Here

/**
* Test code.
*/
public class IfFTest extends TestCase {
    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

/**
* Test code.
*/
public class Actor5a extends JLPCActor {
    protected void processRequest(Parallel request, final RP rp) throws Exception {
        MailboxFactory mf = getMailboxFactory();
        Actor5 a = new Actor5();
        a.initialize(mf.createAsyncMailbox());
        Actor5 b = new Actor5();
        b.initialize(mf.createAsyncMailbox());
        Actor5 c = new Actor5();
        c.initialize(mf.createAsyncMailbox());
        a.delay = 500;
        c.delay = 500;
        a.delay = 500;
        final long t0 = System.currentTimeMillis();
        RP<Object> rc = new RP<Object>() {
View Full Code Here

/**
* Test code.
*/
public class PropertiesTest extends TestCase {
    public void test() {
        MailboxFactory mailboxFactory = JAMailboxFactory.newMailboxFactory(1);
        try {
            JAProperties p1 = new JAProperties();
            p1.initialize(mailboxFactory.createMailbox());
            JAProperties p2 = new JAProperties();
            p2.initialize(p1.getMailbox(), p1);
            JAProperties.setProperty(p1, "a", "foo");
            JAProperties.setProperty(p2, "b", "bar");
            String a = (String) JAProperties.getProperty(p2, "a");
            System.out.println(a);
            String b = (String) JAProperties.getProperty(p2, "b");
            System.out.println(b);
            String c = (String) JAProperties.getProperty(p2, "c");
            System.out.println(c);
        } catch (Throwable e) {
            e.printStackTrace();
        } finally {
            mailboxFactory.close();
        }
    }
View Full Code Here

/**
* Test code.
*/
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());
            System.out.println(SimpleRequest.req.send(future, actor2));
        } catch (Throwable e) {
            e.printStackTrace();
        } finally {
            mailboxFactory.close();
        }
    }
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 SetVTest extends TestCase {
    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

/**
* 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();
        Greet1.req.send(future, actor2);
        mailboxFactory.close();
    }
View Full Code Here

/**
* Test code.
*/
public class IteratorTest extends TestCase {
    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

TOP

Related Classes of org.agilewiki.jactor.MailboxFactory

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.