Package org.agilewiki.jactor

Examples of org.agilewiki.jactor.JAFuture


    public void test() {
        MailboxFactory mailboxFactory = JAMailboxFactory.newMailboxFactory(1);
        try {
            SetF1 actor = new SetF1();
            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() {
        MailboxFactory mailboxFactory = JAMailboxFactory.newMailboxFactory(1);
        try {
            Call actor = new Call();
            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();
        String result = Hi1.req.send(future, actor2);
        assertEquals("Hello world!", result);
        mailboxFactory.close();
    }
View Full Code Here

    public void test() throws Exception {
        MailboxFactory mailboxFactory = JAMailboxFactory.newMailboxFactory(10);
        Mailbox mailbox = mailboxFactory.createMailbox();
        Actor1 actor1 = new Actor1();
        actor1.initialize(mailbox);
        JAFuture future = new JAFuture();
        String result = Hi1.req.send(future, actor1);
        assertEquals("Hello world!", result);
        mailboxFactory.close();
    }
View Full Code Here

        Mailbox mailbox = mailboxFactory.createMailbox();
        Driver driver = new Driver();
        driver.initialize(mailbox);
        driver.r = r;
        driver.s = s;
        JAFuture future = new JAFuture();
        JAPublisher pub = new JAPublisher();
        pub.initialize(mailbox);
        driver.pub = pub;
        Go.req.send(future, driver);
        pub = new JAPublisher();
View Full Code Here

            Mailbox sharedMailbox = mailboxFactory.createMailbox();
            CounterActor counterActor = new CounterActor();
            counterActor.initialize(sharedMailbox);
            Driver driver = new Driver();
            driver.initialize(sharedMailbox, counterActor, runs);
            JAFuture future = new JAFuture();
            long start = System.currentTimeMillis();
            Long count = (Long) SimpleRequest.req.send(future, driver);
            long finish = System.currentTimeMillis();
            double elapsedTime = (finish - start) / 1000.;
            System.out.println("[java-shared] Number of runs: " + runs);
View Full Code Here

        try {
            CounterActor counterActor = new CounterActor();
            counterActor.initialize(mailboxFactory.createMailbox());
            Driver driver = new Driver();
            driver.initialize(mailboxFactory.createMailbox(), counterActor, runs);
            JAFuture future = new JAFuture();
            long start = System.currentTimeMillis();
            Long count = (Long) SimpleRequest.req.send(future, driver);
            long finish = System.currentTimeMillis();
            double elapsedTime = (finish - start) / 1000.;
            System.out.println("[java-unshared] Number of runs: " + runs);
View Full Code Here

        try {
            CounterActor counterActor = new CounterActor();
            counterActor.initialize(mailboxFactory.createAsyncMailbox());
            Driver driver = new Driver();
            driver.initialize(mailboxFactory.createMailbox(), counterActor, runs);
            JAFuture future = new JAFuture();
            long start = System.currentTimeMillis();
            Long count = (Long) SimpleRequest.req.send(future, driver);
            long finish = System.currentTimeMillis();
            double elapsedTime = (finish - start) / 1000.;
            System.out.println("[java-async] Number of runs: " + runs);
View Full Code Here

    public void testFactorial() throws Exception {
        MailboxFactory mailboxFactory = JAMailboxFactory.newMailboxFactory(1);
        try {
            Factorial factorial = new Factorial();
            factorial.initialize(mailboxFactory.createMailbox());
            JAFuture future = new JAFuture();
            SimpleRequest.req.send(future, factorial);
        } finally {
            mailboxFactory.close();
        }
    }
View Full Code Here

    public void test() {
        MailboxFactory mailboxFactory = JAMailboxFactory.newMailboxFactory(1);
        try {
            JidFactories factory = new JidFactories();
            factory.initialize(mailboxFactory.createMailbox());
            JAFuture future = new JAFuture();
            Actor l0 = (new ListJidFactory(JidFactories.STRING_LIST_JID_TYPE, StringJidFactory.fac)).
                    newActor(factory.getMailbox(), factory);
            int l0sl = GetSerializedLength.req.send(future, l0);
            assertEquals(8, l0sl);
            Actor l1 = (new CopyJID()).send(future, l0);
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.