Examples of borrowObject()


Examples of org.apache.commons.pool.impl.StackObjectPool.borrowObject()

        TypedPoolableObjectFactory<MockObject> factory = TypedPoolableObjectFactory.makeFactory(MockObject.class, true);
        assertNotNull(factory);
       
        StackObjectPool pool = new StackObjectPool(factory);
       
        MockObject obj = (MockObject)pool.borrowObject();
        assertNotNull(obj);
        assertTrue(obj.isInitialized());
    }
   
    /**
 
View Full Code Here

Examples of org.datanucleus.store.rdbms.datasource.dbcp.pool.ObjectPool.borrowObject()

            ObjectPool pool = getConnectionPool(url.substring(URL_PREFIX_LEN));
            if(null == pool) {
                throw new SQLException("No pool found for " + url + ".");
            } else {
                try {
                    Connection conn = (Connection)(pool.borrowObject());
                    if (conn != null) {
                        conn = new PoolGuardConnectionWrapper(pool, conn);
                    }
                    return conn;
                } catch(SQLException e) {
View Full Code Here

Examples of org.datanucleus.store.rdbms.datasource.dbcp.pool.ObjectPool.borrowObject()

            pool = ((CPDSConnectionFactory) manager).getPool();
        }

        PooledConnectionAndInfo info = null;
        try {
            info = (PooledConnectionAndInfo) pool.borrowObject();
        }
        catch (NoSuchElementException ex) {
            throw new SQLNestedException(
                    "Could not retrieve connection info from pool", ex);
        }
View Full Code Here

Examples of org.datanucleus.store.rdbms.datasource.dbcp.pool.ObjectPool.borrowObject()

                pool = getPool(key);
            } catch (NamingException ne) {
                throw new SQLNestedException("RegisterPool failed", ne);
            }
            try {
                info = (PooledConnectionAndInfo)pool.borrowObject();
            } catch (Exception ex) {
                throw (SQLException) new SQLException(
                "Could not retrieve connection info from pool").initCause(ex);
            }
        }
View Full Code Here

Examples of org.exist.util.serializer.SerializerPool.borrowObject()

              final Serializer serializer = broker.getSerializer();
              serializer.reset();
           
              final SerializerPool serializerPool = SerializerPool.getInstance();

              final SAXSerializer sax = (SAXSerializer) serializerPool.borrowObject(SAXSerializer.class);
              try {
                sax.setOutput(output, outputProperties);
                serializer.setProperties(outputProperties);
                serializer.setSAXHandlers(sax, sax);
                serializer.toSAX(resultSequence, 1, resultSequence.getItemCount(), false, false);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.