Package org.apache.tomcat.dbcp.pool2.impl

Examples of org.apache.tomcat.dbcp.pool2.impl.GenericObjectPoolConfig


    }
  }

  @Test
  public void testGetResourceValidate() {
    GenericObjectPoolConfig poolConfig = new GenericObjectPoolConfig();
    poolConfig.setTestOnBorrow(true);
    this.pool = new JredisPool(connectionSpec, poolConfig);
    JRedis client = pool.getResource();
    assertNotNull(client);
  }
View Full Code Here


  }

  @Test
  public void testReturnResource() throws RedisException {

    GenericObjectPoolConfig poolConfig = new GenericObjectPoolConfig();
    poolConfig.setMaxTotal(1);
    poolConfig.setMaxWaitMillis(1);
    this.pool = new JredisPool(connectionSpec);
    JRedis client = pool.getResource();
    assertNotNull(client);
    pool.returnResource(client);
    assertNotNull(pool.getResource());
View Full Code Here

  }

  @Test
  public void testReturnBrokenResource() throws RedisException {

    GenericObjectPoolConfig poolConfig = new GenericObjectPoolConfig();
    poolConfig.setMaxTotal(1);
    poolConfig.setMaxWaitMillis(1);
    this.pool = new JredisPool(connectionSpec, poolConfig);
    JRedis client = pool.getResource();
    assertNotNull(client);
    pool.returnBrokenResource(client);
    JRedis client2 = pool.getResource();
View Full Code Here

            if (p == null) {
                return// Object was abandoned and removed
            } else {
                // Make sure object is not being reclaimed
                synchronized(p) {
                    final PooledObjectState state = p.getState();
                    if (state != PooledObjectState.ALLOCATED) {
                        throw new IllegalStateException(
                                "Object has already been returned to this pool or is invalid");
                    } else {
                        p.markReturning(); // Keep from being marked abandoned
View Full Code Here

            if (p == null) {
                return// Object was abandoned and removed
            } else {
                // Make sure object is not being reclaimed
                synchronized(p) {
                    final PooledObjectState state = p.getState();
                    if (state != PooledObjectState.ALLOCATED) {
                        throw new IllegalStateException(
                                "Object has already been returned to this pool or is invalid");
                    } else {
                        p.markReturning(); // Keep from being marked abandoned
View Full Code Here

            if (p == null) {
                return// Object was abandoned and removed
            } else {
                // Make sure object is not being reclaimed
                synchronized(p) {
                    final PooledObjectState state = p.getState();
                    if (state != PooledObjectState.ALLOCATED) {
                        throw new IllegalStateException(
                                "Object has already been returned to this pool or is invalid");
                    } else {
                        p.markReturning(); // Keep from being marked abandoned
View Full Code Here

     * exceptions queue.
     *
     * @param e exception to be swallowed
     */
    final void swallowException(Exception e) {
        SwallowedExceptionListener listener = getSwallowedExceptionListener();

        if (listener == null) {
            return;
        }

        try {
            listener.onSwallowException(e);
        } catch (OutOfMemoryError oome) {
            throw oome;
        } catch (VirtualMachineError vme) {
            throw vme;
        } catch (Throwable t) {
View Full Code Here

     * exceptions queue.
     *
     * @param e exception to be swallowed
     */
    final void swallowException(Exception e) {
        SwallowedExceptionListener listener = getSwallowedExceptionListener();

        if (listener == null) {
            return;
        }

        try {
            listener.onSwallowException(e);
        } catch (OutOfMemoryError oome) {
            throw oome;
        } catch (VirtualMachineError vme) {
            throw vme;
        } catch (Throwable t) {
View Full Code Here

     * exceptions queue.
     *
     * @param e exception to be swallowed
     */
    final void swallowException(Exception e) {
        SwallowedExceptionListener listener = getSwallowedExceptionListener();

        if (listener == null) {
            return;
        }

        try {
            listener.onSwallowException(e);
        } catch (OutOfMemoryError oome) {
            throw oome;
        } catch (VirtualMachineError vme) {
            throw vme;
        } catch (Throwable t) {
View Full Code Here

     *                                     invoked
     */
    public void setRemoveAbandonedOnMaintenance(
            boolean removeAbandonedOnMaintenance) {
        if (abandonedConfig == null) {
            abandonedConfig = new AbandonedConfig();
        }
        abandonedConfig.setRemoveAbandonedOnMaintenance(
                removeAbandonedOnMaintenance);
    }
View Full Code Here

TOP

Related Classes of org.apache.tomcat.dbcp.pool2.impl.GenericObjectPoolConfig

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.