Package org.agilewiki.jactor.factory

Examples of org.agilewiki.jactor.factory.JAFactory


     */
    @Override
    public void initialize(Mailbox mailbox, Actor parent, ActorFactory actorFactory)
            throws Exception {
        if (parent == null) {
            parent = new JAFactory();
            ((JAFactory) parent).initialize(mailbox);
        }
        super.initialize(mailbox, parent, actorFactory);

        Actor f = parent;
        while (!(f instanceof JAFactory)) f = f.getParent();
        JAFactory factory = (JAFactory) f;

        factory.registerActorFactory(JidFactory.fac);

        factory.registerActorFactory(BooleanJidFactory.fac);
        factory.registerActorFactory(IntegerJidFactory.fac);
        factory.registerActorFactory(LongJidFactory.fac);
        factory.registerActorFactory(FloatJidFactory.fac);
        factory.registerActorFactory(DoubleJidFactory.fac);

        factory.registerActorFactory(ActorJidFactory.fac);
        factory.registerActorFactory(RootJidFactory.fac);
        factory.registerActorFactory(StringJidFactory.fac);
        factory.registerActorFactory(BytesJidFactory.fac);

        factory.registerActorFactory(new BListJidFactory(STRING_BLIST_JID_TYPE, StringJidFactory.fac));
        factory.registerActorFactory(new BListJidFactory(BYTES_BLIST_JID_TYPE, BytesJidFactory.fac));
        factory.registerActorFactory(new BListJidFactory(ACTOR_BLIST_JID_TYPE, ActorJidFactory.fac));
        factory.registerActorFactory(new BListJidFactory(LONG_BLIST_JID_TYPE, LongJidFactory.fac));
        factory.registerActorFactory(new BListJidFactory(INTEGER_BLIST_JID_TYPE, IntegerJidFactory.fac));
        factory.registerActorFactory(new BListJidFactory(FLOAT_BLIST_JID_TYPE, FloatJidFactory.fac));
        factory.registerActorFactory(new BListJidFactory(DOUBLE_BLIST_JID_TYPE, DoubleJidFactory.fac));
        factory.registerActorFactory(new BListJidFactory(BOOLEAN_BLIST_JID_TYPE, BooleanJidFactory.fac));

        factory.registerActorFactory(new ListJidFactory(STRING_LIST_JID_TYPE, StringJidFactory.fac));
        factory.registerActorFactory(new ListJidFactory(BYTES_LIST_JID_TYPE, BytesJidFactory.fac));
        factory.registerActorFactory(new ListJidFactory(ACTOR_LIST_JID_TYPE, ActorJidFactory.fac));
        factory.registerActorFactory(new ListJidFactory(LONG_LIST_JID_TYPE, LongJidFactory.fac));
        factory.registerActorFactory(new ListJidFactory(INTEGER_LIST_JID_TYPE, IntegerJidFactory.fac));
        factory.registerActorFactory(new ListJidFactory(FLOAT_LIST_JID_TYPE, FloatJidFactory.fac));
        factory.registerActorFactory(new ListJidFactory(DOUBLE_LIST_JID_TYPE, DoubleJidFactory.fac));
        factory.registerActorFactory(new ListJidFactory(BOOLEAN_LIST_JID_TYPE, BooleanJidFactory.fac));

        factory.registerActorFactory(new StringMapJidFactory(STRING_STRING_MAP_JID_TYPE, StringJidFactory.fac));
        factory.registerActorFactory(new StringMapJidFactory(STRING_BYTES_MAP_JID_TYPE, BytesJidFactory.fac));
        factory.registerActorFactory(new StringMapJidFactory(STRING_ACTOR_MAP_JID_TYPE, ActorJidFactory.fac));
        factory.registerActorFactory(new StringMapJidFactory(STRING_LONG_MAP_JID_TYPE, LongJidFactory.fac));
        factory.registerActorFactory(new StringMapJidFactory(STRING_INTEGER_MAP_JID_TYPE, IntegerJidFactory.fac));
        factory.registerActorFactory(new StringMapJidFactory(STRING_FLOAT_MAP_JID_TYPE, FloatJidFactory.fac));
        factory.registerActorFactory(new StringMapJidFactory(STRING_DOUBLE_MAP_JID_TYPE, DoubleJidFactory.fac));
        factory.registerActorFactory(new StringMapJidFactory(STRING_BOOLEAN_MAP_JID_TYPE, BooleanJidFactory.fac));

        factory.registerActorFactory(new IntegerMapJidFactory(INTEGER_STRING_MAP_JID_TYPE, StringJidFactory.fac));
        factory.registerActorFactory(new IntegerMapJidFactory(INTEGER_BYTES_MAP_JID_TYPE, BytesJidFactory.fac));
        factory.registerActorFactory(new IntegerMapJidFactory(INTEGER_ACTOR_MAP_JID_TYPE, ActorJidFactory.fac));
        factory.registerActorFactory(new IntegerMapJidFactory(INTEGER_LONG_MAP_JID_TYPE, LongJidFactory.fac));
        factory.registerActorFactory(new IntegerMapJidFactory(INTEGER_INTEGER_MAP_JID_TYPE, IntegerJidFactory.fac));
        factory.registerActorFactory(new IntegerMapJidFactory(INTEGER_FLOAT_MAP_JID_TYPE, FloatJidFactory.fac));
        factory.registerActorFactory(new IntegerMapJidFactory(INTEGER_DOUBLE_MAP_JID_TYPE, DoubleJidFactory.fac));
        factory.registerActorFactory(new IntegerMapJidFactory(INTEGER_BOOLEAN_MAP_JID_TYPE, BooleanJidFactory.fac));

        factory.registerActorFactory(new LongMapJidFactory(LONG_STRING_MAP_JID_TYPE, StringJidFactory.fac));
        factory.registerActorFactory(new LongMapJidFactory(LONG_BYTES_MAP_JID_TYPE, BytesJidFactory.fac));
        factory.registerActorFactory(new LongMapJidFactory(LONG_ACTOR_MAP_JID_TYPE, ActorJidFactory.fac));
        factory.registerActorFactory(new LongMapJidFactory(LONG_LONG_MAP_JID_TYPE, LongJidFactory.fac));
        factory.registerActorFactory(new LongMapJidFactory(LONG_INTEGER_MAP_JID_TYPE, IntegerJidFactory.fac));
        factory.registerActorFactory(new LongMapJidFactory(LONG_FLOAT_MAP_JID_TYPE, FloatJidFactory.fac));
        factory.registerActorFactory(new LongMapJidFactory(LONG_DOUBLE_MAP_JID_TYPE, DoubleJidFactory.fac));
        factory.registerActorFactory(new LongMapJidFactory(LONG_BOOLEAN_MAP_JID_TYPE, BooleanJidFactory.fac));

        factory.registerActorFactory(new StringBMapJidFactory(STRING_STRING_BMAP_JID_TYPE, StringJidFactory.fac));
        factory.registerActorFactory(new StringBMapJidFactory(STRING_BYTES_BMAP_JID_TYPE, BytesJidFactory.fac));
        factory.registerActorFactory(new StringBMapJidFactory(STRING_ACTOR_BMAP_JID_TYPE, ActorJidFactory.fac));
        factory.registerActorFactory(new StringBMapJidFactory(STRING_LONG_BMAP_JID_TYPE, LongJidFactory.fac));
        factory.registerActorFactory(new StringBMapJidFactory(STRING_INTEGER_BMAP_JID_TYPE, IntegerJidFactory.fac));
        factory.registerActorFactory(new StringBMapJidFactory(STRING_FLOAT_BMAP_JID_TYPE, FloatJidFactory.fac));
        factory.registerActorFactory(new StringBMapJidFactory(STRING_DOUBLE_BMAP_JID_TYPE, DoubleJidFactory.fac));
        factory.registerActorFactory(new StringBMapJidFactory(STRING_BOOLEAN_BMAP_JID_TYPE, BooleanJidFactory.fac));

        factory.registerActorFactory(new IntegerBMapJidFactory(INTEGER_STRING_BMAP_JID_TYPE, StringJidFactory.fac));
        factory.registerActorFactory(new IntegerBMapJidFactory(INTEGER_BYTES_BMAP_JID_TYPE, BytesJidFactory.fac));
        factory.registerActorFactory(new IntegerBMapJidFactory(INTEGER_ACTOR_BMAP_JID_TYPE, ActorJidFactory.fac));
        factory.registerActorFactory(new IntegerBMapJidFactory(INTEGER_LONG_BMAP_JID_TYPE, LongJidFactory.fac));
        factory.registerActorFactory(new IntegerBMapJidFactory(INTEGER_INTEGER_BMAP_JID_TYPE, IntegerJidFactory.fac));
        factory.registerActorFactory(new IntegerBMapJidFactory(INTEGER_FLOAT_BMAP_JID_TYPE, FloatJidFactory.fac));
        factory.registerActorFactory(new IntegerBMapJidFactory(INTEGER_DOUBLE_BMAP_JID_TYPE, DoubleJidFactory.fac));
        factory.registerActorFactory(new IntegerBMapJidFactory(INTEGER_BOOLEAN_BMAP_JID_TYPE, BooleanJidFactory.fac));

        factory.registerActorFactory(new LongBMapJidFactory(LONG_STRING_BMAP_JID_TYPE, StringJidFactory.fac));
        factory.registerActorFactory(new LongBMapJidFactory(LONG_BYTES_BMAP_JID_TYPE, BytesJidFactory.fac));
        factory.registerActorFactory(new LongBMapJidFactory(LONG_ACTOR_BMAP_JID_TYPE, ActorJidFactory.fac));
        factory.registerActorFactory(new LongBMapJidFactory(LONG_LONG_BMAP_JID_TYPE, LongJidFactory.fac));
        factory.registerActorFactory(new LongBMapJidFactory(LONG_INTEGER_BMAP_JID_TYPE, IntegerJidFactory.fac));
        factory.registerActorFactory(new LongBMapJidFactory(LONG_FLOAT_BMAP_JID_TYPE, FloatJidFactory.fac));
        factory.registerActorFactory(new LongBMapJidFactory(LONG_DOUBLE_BMAP_JID_TYPE, DoubleJidFactory.fac));
        factory.registerActorFactory(new LongBMapJidFactory(LONG_BOOLEAN_BMAP_JID_TYPE, BooleanJidFactory.fac));
    }
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 UserFactory("user"));
        JidFactories factories = new JidFactories();
        factories.initialize(mailbox, factory);

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

public class IntIntBMapJidTest extends TestCase {
    public void test1() 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);
            m.kMake(0);
            m.kMake(1);
            m.kMake(2);
            IntegerJid sj0 = m.kGet(0);
            IntegerJid sj1 = m.kGet(1);
View Full Code Here

    public void test2() 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 < 28) {
                m.kMake(i);
                IntegerJid ij0 = m.kGet(i);
                ij0.setValue(i);
View Full Code Here

    public void test3() 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 < 41) {
                m.kMake(i);
                IntegerJid ij0 = m.kGet(i);
                ij0.setValue(i);
View Full Code Here

    public void test4() 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 < 391) {
                m.kMake(i);
                IntegerJid ij0 = m.kGet(i);
                ij0.setValue(i);
View Full Code Here

    public void test5() 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 test() {
        MailboxFactory mailboxFactory = JAMailboxFactory.newMailboxFactory(1);
        try {
            JAFuture future = new JAFuture();
            Mailbox mailbox = mailboxFactory.createMailbox();
            JAFactory factory = new JAFactory();
            factory.initialize(mailbox);
            (new JidFactories()).initialize(mailbox, factory);
            UnionJidFactory siuf =
                    new UnionJidFactory("siUnion", StringJidFactory.fac.actorType, "siUnion");
            factory.registerActorFactory(siuf);
            UnionJid siu1 = (UnionJid) factory.newActor("siUnion");
            assertNull(siu1.getValue());
            UnionJid siu2 = (UnionJid) siu1.copyJID(mailbox);
            assertNull(siu2.getValue());
            siu2.setValue(StringJidFactory.fac);
            StringJid sj2 = (StringJid) siu2.getValue();
View Full Code Here

    public void test6() 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 test7() 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

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.