Package org.apache.commons.pool

Examples of org.apache.commons.pool.BasePoolableObjectFactory


                String nodeRootPath = rootPath+"/"+name;
                beanClassNodeRootPaths.put(beanClass, nodeRootPath);
            }
           
            // create JCR credentials session pool
            PoolableObjectFactory sessionFactory = new BasePoolableObjectFactory()
            {
                /* (non-Javadoc)
                 * @see org.apache.commons.pool.BasePoolableObjectFactory#passivateObject(java.lang.Object)
                 */
                public void passivateObject(Object obj) throws Exception
View Full Code Here


                String nodeRootPath = rootPath+"/"+name;
                beanClassNodeRootPaths.put(beanClass, nodeRootPath);
            }
           
            // create JCR credentials session pool
            PoolableObjectFactory sessionFactory = new BasePoolableObjectFactory()
            {
                /* (non-Javadoc)
                 * @see org.apache.commons.pool.BasePoolableObjectFactory#passivateObject(java.lang.Object)
                 */
                public void passivateObject(Object obj) throws Exception
View Full Code Here

                String nodeRootPath = rootPath+"/"+name;
                beanClassNodeRootPaths.put(beanClass, nodeRootPath);
            }
           
            // create JCR credentials session pool
            PoolableObjectFactory sessionFactory = new BasePoolableObjectFactory()
            {
                /* (non-Javadoc)
                 * @see org.apache.commons.pool.BasePoolableObjectFactory#passivateObject(java.lang.Object)
                 */
                public void passivateObject(Object obj) throws Exception
View Full Code Here

    /**
     * Makes sure an {@link OutOfMemoryError} isn't swallowed.
     */
    public void testOutOfMemoryError() throws Exception {
        pool = new SoftReferenceObjectPool(new BasePoolableObjectFactory() {
            public Object makeObject() throws Exception {
                throw new OutOfMemoryError();
            }
        });

        try {
            pool.borrowObject();
            fail("Expected out of memory.");
        }
        catch (OutOfMemoryError ex) {
            // expected
        }
        pool.close();

        pool = new SoftReferenceObjectPool(new BasePoolableObjectFactory() {
            public Object makeObject() throws Exception {
                return new Object();
            }

            public boolean validateObject(Object obj) {
View Full Code Here

                String nodeRootPath = rootPath+"/"+name;
                beanClassNodeRootPaths.put(beanClass, nodeRootPath);
            }
           
            // create JCR credentials session pool
            PoolableObjectFactory sessionFactory = new BasePoolableObjectFactory()
            {
                /* (non-Javadoc)
                 * @see org.apache.commons.pool.BasePoolableObjectFactory#passivateObject(java.lang.Object)
                 */
                public void passivateObject(Object obj) throws Exception
View Full Code Here

    /**
     * Makes sure an {@link OutOfMemoryError} isn't swallowed.
     */
    public void testOutOfMemoryError() throws Exception {
        pool = new SoftReferenceObjectPool(new BasePoolableObjectFactory() {
            public Object makeObject() throws Exception {
                throw new OutOfMemoryError();
            }
        });

        try {
            pool.borrowObject();
            fail("Expected out of memory.");
        }
        catch (OutOfMemoryError ex) {
            // expected
        }
        pool.close();

        pool = new SoftReferenceObjectPool(new BasePoolableObjectFactory() {
            public Object makeObject() throws Exception {
                return new Object();
            }

            public boolean validateObject(Object obj) {
View Full Code Here

TOP

Related Classes of org.apache.commons.pool.BasePoolableObjectFactory

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.