Package org.jacorb.notification.util

Examples of org.jacorb.notification.util.AbstractPoolablePool


        }
    }

    public void testWithPool()
    {
        final AbstractPoolablePool pool =
            new AbstractPoolablePool("test")
            {
                public Object newInstance()
                {
                    return new StructuredEventMessage();
                }
            };
           
            pool.configure(null);
           
        Work[] worker = new Work[4];

        for (int i = 0; i < worker.length; ++i)
        {
            worker[i] = new Work()
            {
                public StructuredEventMessage createStructuredEventMessage()
                {
                    return (StructuredEventMessage) pool.lendObject();
                }
            };
            new Thread(worker[i]).start();
        }
View Full Code Here


        }
    }

    public void testWithPool()
    {
        final AbstractPoolablePool pool =
            new AbstractPoolablePool("test")
            {
                public Object newInstance()
                {
                    return new AnyMessage();
                }
            };

            pool.configure(null);

        Work[] worker = new Work[4];

        for (int i = 0; i < worker.length; ++i)
        {
            worker[i] = new Work()
            {
                public AnyMessage createMessage()
                {
                    return (AnyMessage) pool.lendObject();
                }
            };
            new Thread(worker[i]).start();
        }
View Full Code Here

    }

    @Test
    public void testWithPool()
    {
        final AbstractPoolablePool pool =
            new AbstractPoolablePool("test")
            {
                @Override
                public Object newInstance()
                {
                    return new AnyMessage();
                }
            };

            pool.configure(null);

        Work[] worker = new Work[4];

        for (int i = 0; i < worker.length; ++i)
        {
            worker[i] = new Work()
            {
                @Override
                public AnyMessage createMessage()
                {
                    return (AnyMessage) pool.lendObject();
                }
            };
            new Thread(worker[i]).start();
        }
View Full Code Here

TOP

Related Classes of org.jacorb.notification.util.AbstractPoolablePool

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.