Package org.agilewiki.jid.scalar.vlens.actor

Examples of org.agilewiki.jid.scalar.vlens.actor.RootJid


        factory.initialize(mailbox);
        factory.registerActorFactory(new UserFactory("user"));
        JidFactories factories = new JidFactories();
        factories.initialize(mailbox, factory);

        RootJid root = new RootJid();
        root.initialize(mailbox, factory);
        (new SetActor("user")).send(future, root);
        Actor name = (new ResolvePathname("0/0")).send(future, root);
        (new SetString("Frank")).send(future, name);
        Actor age = (new ResolvePathname("0/1")).send(future, root);
        (new SetInteger(30)).send(future, age);
        Actor location = (new ResolvePathname("0/2")).send(future, root);
        (new SetString("Bangalore")).send(future, location);
        byte[] rootBytes = GetSerializedBytes.req.send(future, root);

        RootJid root2 = new RootJid();
        root2.initialize(mailbox, factory);
        root2.load(rootBytes);
        Actor user = (new ResolvePathname("0")).send(future, root2);
        Proc.req.send(future, user);

        mailboxFactory.close();
    }
View Full Code Here


        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);
        (new SetString("Frank")).send(future, a);
        byte[] rootBytes = GetSerializedBytes.req.send(future, root);

        RootJid root2 = new RootJid();
        root2.initialize(mailbox, factory);
        root2.load(rootBytes);
        Actor a2 = (new ResolvePathname("0")).send(future, root2);
        Proc.req.send(future, a2);

        mailboxFactory.close();
    }
View Full Code Here

        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);
        (new SetInteger(7)).send(future, a);
        byte[] rootBytes = GetSerializedBytes.req.send(future, root);

        RootJid root2 = new RootJid();
        root2.initialize(mailbox, factory);
        root2.load(rootBytes);
        Actor a2 = (new ResolvePathname("0")).send(future, root2);
        Proc.req.send(future, a2);

        mailboxFactory.close();
    }
View Full Code Here

        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);

        RootJid root2 = new RootJid();
        root2.initialize(mailbox, factory);
        root2.load(rootBytes);
        Actor a = (new ResolvePathname("0")).send(future, root2);
        Proc.req.send(future, a);

        mailboxFactory.close();
    }
View Full Code Here

        factory.initialize(mailbox);
        factory.registerActorFactory(new UsersFactory("users"));
        JidFactories factories = new JidFactories();
        factories.initialize(mailbox, factory);

        RootJid root = new RootJid();
        root.initialize(mailbox, factory);
        (new SetActor("users")).send(future, root);
        Users users = (Users) (new ResolvePathname("0")).send(future, root);
        new KMake<String, User>("John").send(future, users);
        StringJid jEmail = (StringJid) new KGet<String, User>("John").send(future, users);
        jEmail.setValue("john123@gmail.com");
        new KMake<String, User>("Sam").send(future, users);
        StringJid sEmail = (StringJid) new KGet<String, User>("Sam").send(future, users);
        sEmail.setValue("sammyjr@yahoo.com");
        new KMake<String, User>("Fred").send(future, users);
        StringJid fEmail = (StringJid) new KGet<String, User>("Fred").send(future, users);
        fEmail.setValue("fredk@gmail.com");
        byte[] rootBytes = GetSerializedBytes.req.send(future, root);

        RootJid root2 = new RootJid();
        root2.initialize(mailbox, factory);
        root2.load(rootBytes);
        Actor a = (new ResolvePathname("0")).send(future, root2);
        Proc.req.send(future, a);

        mailboxFactory.close();
    }
View Full Code Here

        factory.initialize(mailbox);
        factory.registerActorFactory(new SumFactory("sum"));
        JidFactories factories = new JidFactories();
        factories.initialize(mailbox, factory);

        RootJid root = new RootJid();
        root.initialize(mailbox, factory);
        (new SetActor("sum")).send(future, root);
        Sum sum = (Sum) (new ResolvePathname("0")).send(future, root);
        IAdd iAdd = new IAdd(-1);
        IGet iGet = new IGet(-1);
        iAdd.send(future, sum);
        IntegerJid ij0 = (IntegerJid) iGet.send(future, sum);
        (new SetInteger(1)).send(future, ij0);
        iAdd.send(future, sum);
        IntegerJid ij1 = (IntegerJid) iGet.send(future, sum);
        (new SetInteger(2)).send(future, ij1);
        iAdd.send(future, sum);
        IntegerJid ij2 = (IntegerJid) iGet.send(future, sum);
        (new SetInteger(3)).send(future, ij2);
        byte[] rootBytes = GetSerializedBytes.req.send(future, root);

        RootJid root2 = new RootJid();
        root2.initialize(mailbox, factory);
        root2.load(rootBytes);
        Actor a = (new ResolvePathname("0")).send(future, root2);
        Proc.req.send(future, a);

        mailboxFactory.close();
    }
View Full Code Here

        factory.registerActorFactory(new BlobFactory("blob"));
        factory.defineActorType("hi", HelloWorld.class);
        JidFactories factories = new JidFactories();
        factories.initialize(mailbox, factory);

        RootJid root = new RootJid();
        root.initialize(mailbox, factory);
        (new SetActor("blob")).send(future, root);
        Blob blob = (Blob) (new ResolvePathname("0")).send(future, root);
        new KMake<String, ActorJid>("fun").send(future, blob);
        ActorJid fun = (ActorJid) new KGet<String, ActorJid>("fun").send(future, blob);
        (new SetActor("hi")).send(future, fun);
        byte[] rootBytes = GetSerializedBytes.req.send(future, root);

        RootJid root2 = new RootJid();
        root2.initialize(mailbox, factory);
        root2.load(rootBytes);
        Actor a = (new ResolvePathname("0")).send(future, root2);
        Proc.req.send(future, a);

        mailboxFactory.close();
    }
View Full Code Here

        JAFuture future = new JAFuture();

        JidFactories factory = new JidFactories();
        factory.initialize(mailboxFactory.createMailbox());

        RootJid root = new RootJid();
        root.initialize(mailbox, factory);

        SetActor setList = new SetActor(JidFactories.BOOLEAN_LIST_JID_TYPE);
        setList.send(future, root);
        ListJid list = (ListJid) GetActor.req.send(future, root);
View Full Code Here

        JAFuture future = new JAFuture();

        JidFactories factory = new JidFactories();
        factory.initialize(mailboxFactory.createMailbox());

        RootJid root = new RootJid();
        root.initialize(mailbox, factory);

        SetActor setList = new SetActor(JidFactories.BOOLEAN_LIST_JID_TYPE);
        setList.send(future, root);
        ListJid list = (ListJid) GetActor.req.send(future, root);
View Full Code Here

        JAFuture future = new JAFuture();

        JidFactories factory = new JidFactories();
        factory.initialize(mailboxFactory.createMailbox());

        RootJid root = new RootJid();
        root.initialize(mailbox, factory);

        SetActor setList = new SetActor(JidFactories.BOOLEAN_LIST_JID_TYPE);
        setList.send(future, root);
        ListJid list = (ListJid) GetActor.req.send(future, root);
View Full Code Here

TOP

Related Classes of org.agilewiki.jid.scalar.vlens.actor.RootJid

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.