Package org.agilewiki.jactor.factory

Examples of org.agilewiki.jactor.factory.JAFactory


    public void test8() throws Exception {
        MailboxFactory mailboxFactory = JAMailboxFactory.newMailboxFactory(1);
        try {
            Mailbox mailbox = mailboxFactory.createMailbox();
            JAFactory factory = new JAFactory();
            factory.initialize(mailbox);
            (new JidFactories()).initialize(mailbox, factory);
            BMapJid<Integer, IntegerJid> m = (BMapJid) factory.newActor(JidFactories.INTEGER_INTEGER_BMAP_JID_TYPE);
            int i = 0;
            while (i < 10000) {
                m.kMake(i);
                IntegerJid ij0 = m.kGet(i);
                ij0.setValue(i);
View Full Code Here


    public void test9() throws Exception {
        MailboxFactory mailboxFactory = JAMailboxFactory.newMailboxFactory(1);
        try {
            Mailbox mailbox = mailboxFactory.createMailbox();
            JAFactory factory = new JAFactory();
            factory.initialize(mailbox);
            (new JidFactories()).initialize(mailbox, factory);
            BMapJid<Integer, IntegerJid> m = (BMapJid) factory.newActor(JidFactories.INTEGER_INTEGER_BMAP_JID_TYPE);
            int i = 0;
            while (i < 10000) {
                m.kMake(i);
                IntegerJid ij0 = m.kGet(i);
                ij0.setValue(i);
View Full Code Here

        //time per update (microseconds) = 6854

        MailboxFactory mailboxFactory = JAMailboxFactory.newMailboxFactory(1);
        try {
            Mailbox mailbox = mailboxFactory.createMailbox();
            JAFactory factory = new JAFactory();
            factory.initialize(mailbox);
            (new JidFactories()).initialize(mailbox, factory);
            BMapJid<Integer, IntegerJid> m1 = (BMapJid) factory.newActor(JidFactories.INTEGER_INTEGER_BMAP_JID_TYPE);
            int i = 0;
            while (i < s) {
                m1.kMake(i);
                IntegerJid ij0 = m1.kGet(i);
                ij0.setValue(i);
View Full Code Here

    public void test()
            throws Exception {
        MailboxFactory mailboxFactory = JAMailboxFactory.newMailboxFactory(1);
        Mailbox mailbox = mailboxFactory.createMailbox();
        JAFuture future = new JAFuture();
        JAFactory factory = new JAFactory();
        factory.initialize(mailbox);
        factory.registerActorFactory(new GreeterFactory("hi greeter", "Hi"));

        RootJid root = new RootJid();
        root.initialize(mailbox, factory);
        (new SetActor("hi greeter")).send(future, root);
        Actor a = (new ResolvePathname("0")).send(future, root);
View Full Code Here

    public void test()
            throws Exception {
        MailboxFactory mailboxFactory = JAMailboxFactory.newMailboxFactory(1);
        Mailbox mailbox = mailboxFactory.createMailbox();
        JAFuture future = new JAFuture();
        JAFactory factory = new JAFactory();
        factory.initialize(mailbox);
        factory.defineActorType("lucky number", LuckyNumber.class);

        RootJid root = new RootJid();
        root.initialize(mailbox, factory);
        (new SetActor("lucky number")).send(future, root);
        Actor a = (new ResolvePathname("0")).send(future, root);
View Full Code Here

    public void test()
            throws Exception {
        MailboxFactory mailboxFactory = JAMailboxFactory.newMailboxFactory(1);
        Mailbox mailbox = mailboxFactory.createMailbox();
        JAFuture future = new JAFuture();
        JAFactory factory = new JAFactory();
        factory.initialize(mailbox);
        factory.defineActorType("hi", HelloWorld.class);

        RootJid root = new RootJid();
        root.initialize(mailbox, factory);
        (new SetActor("hi")).send(future, root);
        byte[] rootBytes = GetSerializedBytes.req.send(future, root);
View Full Code Here

    public void test()
            throws Exception {
        MailboxFactory mailboxFactory = JAMailboxFactory.newMailboxFactory(1);
        Mailbox mailbox = mailboxFactory.createMailbox();
        JAFuture future = new JAFuture();
        JAFactory factory = new JAFactory();
        factory.initialize(mailbox);
        factory.registerActorFactory(new UsersFactory("users"));
        JidFactories factories = new JidFactories();
        factories.initialize(mailbox, factory);

        RootJid root = new RootJid();
        root.initialize(mailbox, factory);
View Full Code Here

    public void test() {
        MailboxFactory mailboxFactory = JAMailboxFactory.newMailboxFactory(1);
        try {
            JAFuture future = new JAFuture();
            Mailbox mailbox = mailboxFactory.createMailbox();
            JAFactory factory = new JAFactory();
            factory.initialize(mailbox);
            factory.registerActorFactory(new TupleJidFactory(
                    "sst", StringJidFactory.fac, StringJidFactory.fac));
            (new JidFactories()).initialize(mailbox, factory);
            TupleJidFactory tjf = new TupleJidFactory(
                    "sst", StringJidFactory.fac, StringJidFactory.fac);
            Actor t0 = tjf.newActor(factory.getMailbox(), factory);
            IGet iget0 = new IGet(0);
            IGet iget1 = new IGet(1);
            Actor e0 = iget0.send(future, t0);
            assertNull(GetString.req.send(future, e0));
            Actor e1 = iget1.send(future, t0);
            assertNull(GetString.req.send(future, e1));
            (new SetString("Apples")).send(future, e0);
            assertEquals("Apples", GetString.req.send(future, e0));
            (new SetString("Oranges")).send(future, e1);
            assertEquals("Oranges", GetString.req.send(future, e1));
            Actor t1 = (new CopyJID()).send(future, t0);
            Actor f0 = (new ResolvePathname("0")).send(future, t1);
            assertEquals("Apples", GetString.req.send(future, f0));
            Actor f1 = (new ResolvePathname("1")).send(future, t1);
            assertEquals("Oranges", GetString.req.send(future, f1));

            Actor string1 = StringJidFactory.fac.newActor(factory.getMailbox(), factory);
            (new SetString("Peaches")).send(future, string1);
            byte[] sb = GetSerializedBytes.req.send(future, string1);
            (new ISetBytes(1, sb)).send(future, t1);
            Actor f1b = (new ResolvePathname("1")).send(future, t1);
            assertEquals("Peaches", GetString.req.send(future, f1b));
View Full Code Here

    public void test()
            throws Exception {
        MailboxFactory mailboxFactory = JAMailboxFactory.newMailboxFactory(1);
        Mailbox mailbox = mailboxFactory.createMailbox();
        JAFuture future = new JAFuture();
        JAFactory factory = new JAFactory();
        factory.initialize(mailbox);
        factory.registerActorFactory(new SumFactory("sum"));
        JidFactories factories = new JidFactories();
        factories.initialize(mailbox, factory);

        RootJid root = new RootJid();
        root.initialize(mailbox, factory);
View Full Code Here

        //time per update (microseconds) = 2927

        MailboxFactory mailboxFactory = JAMailboxFactory.newMailboxFactory(1);
        try {
            Mailbox mailbox = mailboxFactory.createMailbox();
            JAFactory factory = new JAFactory();
            factory.initialize(mailbox);
            (new JidFactories()).initialize(mailbox, factory);
            BListJidFactory intListFactory = new BListJidFactory("il", IntegerJidFactory.fac);
            factory.registerActorFactory(intListFactory);
            BListJid intList1 = (BListJid) factory.newActor("il");
            int i = 0;
            while (i < s) {
                intList1.iAdd(-1);
                IntegerJid ij0 = (IntegerJid) intList1.iGet(-1);
                ij0.setValue(i);
View Full Code Here

TOP

Related Classes of org.agilewiki.jactor.factory.JAFactory

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.