Search in sources :

Example 1 with MCFLifecycleListener

use of com.sun.appserv.connectors.internal.spi.MCFLifecycleListener in project Payara by payara.

the class PoolManagerImpl method killPool.

/**
 * Kill the pool with the specified pool name
 *
 * @param poolInfo - The name of the pool to kill
 */
public void killPool(PoolInfo poolInfo) {
    // empty the pool
    // and remove from poolTable
    ResourcePool pool = poolTable.get(poolInfo);
    if (pool != null) {
        pool.cancelResizerTask();
        pool.emptyPool();
        if (_logger.isLoggable(Level.FINE)) {
            _logger.fine("Removing pool " + pool + " from pooltable");
        }
        poolTable.remove(poolInfo);
        if (listener != null) {
            listener.poolDestroyed(poolInfo);
        }
        // notify mcf-destroy
        ManagedConnectionFactory mcf = ConnectorRegistry.getInstance().getManagedConnectionFactory(poolInfo);
        if (mcf != null) {
            if (mcf instanceof MCFLifecycleListener) {
                ((MCFLifecycleListener) mcf).mcfDestroyed();
            }
        }
    }
}
Also used : MCFLifecycleListener(com.sun.appserv.connectors.internal.spi.MCFLifecycleListener) ManagedConnectionFactory(javax.resource.spi.ManagedConnectionFactory)

Example 2 with MCFLifecycleListener

use of com.sun.appserv.connectors.internal.spi.MCFLifecycleListener in project Payara by payara.

the class PoolManagerImpl method createEmptyConnectionPool.

public void createEmptyConnectionPool(PoolInfo poolInfo, PoolType pt, Hashtable env) throws PoolingException {
    // Create and initialise the connection pool
    createAndInitPool(poolInfo, pt, env);
    if (listener != null) {
        try {
            listener.poolCreated(poolInfo);
        } catch (Exception ex) {
            if (_logger.isLoggable(Level.FINE)) {
                _logger.log(Level.FINE, "Exception thrown on pool listener");
            }
        }
    }
    // notify mcf-create
    ManagedConnectionFactory mcf = ConnectorRegistry.getInstance().getManagedConnectionFactory(poolInfo);
    if (mcf != null) {
        if (mcf instanceof MCFLifecycleListener) {
            ((MCFLifecycleListener) mcf).mcfCreated();
        }
    }
}
Also used : MCFLifecycleListener(com.sun.appserv.connectors.internal.spi.MCFLifecycleListener) ManagedConnectionFactory(javax.resource.spi.ManagedConnectionFactory) PoolingException(com.sun.appserv.connectors.internal.api.PoolingException) ResourceException(javax.resource.ResourceException) InvocationException(org.glassfish.api.invocation.InvocationException) RetryableUnavailableException(javax.resource.spi.RetryableUnavailableException)

Aggregations

MCFLifecycleListener (com.sun.appserv.connectors.internal.spi.MCFLifecycleListener)2 ManagedConnectionFactory (javax.resource.spi.ManagedConnectionFactory)2 PoolingException (com.sun.appserv.connectors.internal.api.PoolingException)1 ResourceException (javax.resource.ResourceException)1 RetryableUnavailableException (javax.resource.spi.RetryableUnavailableException)1 InvocationException (org.glassfish.api.invocation.InvocationException)1