Destroy managed connection pool
@param poolName The name of the pool
@param mcp The managed connection pool
330713
public static synchronized void destroyManagedConnectionPool(String poolName, Object mcp)
   {
      log.tracef("%s", new TraceEvent(poolName,
                                      Integer.toHexString(System.identityHashCode(mcp)),
                                      TraceEvent.MANAGED_CONNECTION_POOL_DESTROY,
                                      "NONE"));
   }
583696
public static synchronized void ccmUserTransaction(String poolName, Object mcp, Object cl,
                                                      Object connection, String key)
   {
      log.tracef("%s", new TraceEvent(poolName,
                                      Integer.toHexString(System.identityHashCode(mcp)),
                                      TraceEvent.CCM_USER_TRANSACTION,
                                      Integer.toHexString(System.identityHashCode(cl)),
                                      Integer.toHexString(System.identityHashCode(connection)),
                                      key));
   }
739929
@Override
    public void destroy()
    {
        if (indexManager != null)
        {
            indexManager.close();
        }
        if (schemaManager != null)
        {
            schemaManager.dropSchema();
        }
        schemaManager = null;
        externalProperties = null;
        releaseConnection(this.session);
        ((Cluster) getConnectionPoolOrConnection()).closeAsync();
    }
1238022
def delete_pool(hostname, username, password, name):
    '''
    
    '''

    ret = {'name': name, 'changes': {}, 'result': False, 'comment': ''}

    if __opts__['test']:
        return _test_output(ret, 'delete', params={
            'hostname': hostname,
            'username': username,
            'password': password,
            'name': name,
        }
        )

    #is this pool currently configured?
    existing = __salt__['bigip.list_pool'](hostname, username, password, name)
    # if it exists by name
    if existing['code'] == 200:

        deleted = __salt__['bigip.delete_pool'](hostname, username, password, name)
        # did we get rid of it?
        if deleted['code'] == 200:
            ret['result'] = True
            ret['comment'] = 'Pool was successfully deleted.'
            ret['changes']['old'] = existing['content']
            ret['changes']['new'] = {}

        # something bad happened
        else:
            ret = _load_result(deleted, ret)

    # not found
    elif existing['code'] == 404:
        ret['result'] = True
        ret['comment'] = 'This pool already does not exist. No changes made.'
        ret['changes']['old'] = {}
        ret['changes']['new'] = {}

    else:
        ret = _load_result(existing, ret)

    return ret
684586
protected synchronized void releaseAllConnectionPools() {

    for (HikariDataSource pool : pools.values()) {

      if (pool != null) {
        logger.info("Releasing pool: {}...", pool.getPoolName());
        pool.close();
      }
    }
  }
394778
def delete_connection(self, name):
        
        name = quote(name, '')
        path = Client.urls['connections_by_name'] % name
        self._call(path, 'DELETE')
        return True
522853
public void destroy(String name, Object instance)
    {
        if (instance != null && isManagedBean(name))
        {
            try
            {
                _lifecycleProvider.destroyInstance(instance);
            } 
            catch (IllegalAccessException e)
            {
                log.log(Level.SEVERE, "Could not access @PreDestroy method of managed bean " + name, e);
            } 
            catch (InvocationTargetException e)
            {
                log.log(Level.SEVERE, "An Exception occured while invoking " +
                        "@PreDestroy method of managed bean " + name, e);
            }
        }
    }
396778
private ManagedConnectionPool getManagedConnectionPool(Credential credential)
   {
      ManagedConnectionPool mcp = pools.get(credential);

      if (mcp == null)
      {
         synchronized (this)
         {
            mcp = pools.get(credential);

            if (mcp == null)
            {
               ManagedConnectionPool newMcp = createManagedConnectionPool(credential);
               mcp = pools.putIfAbsent(credential, newMcp);
               if (mcp == null)
               {
                  mcp = newMcp;

                  if (Tracer.isEnabled())
                     Tracer.createManagedConnectionPool(poolConfiguration.getId(), mcp);
               }
               else
               {
                  newMcp.shutdown();
               }
            }
         }
      }
      return mcp;
   }
970442
function (connectionName, cb) {

      function shutdownConnection(id) {
        if (connections[id].client) {
          connections[id].client.shutdown();
        }
        delete connections[id];
      }

      if (typeof connectionName == 'function') {
        cb = connectionName;
        connectionName = null;
      }

      // shutdown connections
      if (connectionName) {
        shutdownConnection(connectionName);
      }
      else {
        Object.keys(connections).forEach(function (conn) {
          shutdownConnection(conn);
        });
      }

      cb();
    }
507059
public static synchronized void createManagedConnectionPool(String poolName, Object mcp)
   {
      log.tracef("%s", new TraceEvent(poolName,
                                      Integer.toHexString(System.identityHashCode(mcp)),
                                      TraceEvent.MANAGED_CONNECTION_POOL_CREATE,
                                      "NONE"));
   }
774719
public static synchronized void returnConnection(String poolName, Object mcp, Object cl, Object connection)
   {
      log.tracef("%s", new TraceEvent(poolName,
                                      Integer.toHexString(System.identityHashCode(mcp)),
                                      TraceEvent.RETURN_CONNECTION,
                                      Integer.toHexString(System.identityHashCode(cl)),
                                      Integer.toHexString(System.identityHashCode(connection))));
   }
295138
final void close(final ConnectionPoolConnection conn) {
      if(closeQueue != null) {
         closeQueue.add(conn);
      } else {
         closer.close(conn);
      }
   }
776574
protected void returnToFreePool(MCWrapper mcWrapper) {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
            Tr.entry(this, tc, "returnToFreePool", gConfigProps.cfName);
        }
        if (mcWrapper.shouldBeDestroyed() || mcWrapper.hasFatalErrorNotificationOccurred(fatalErrorNotificationTime)
            || ((pm.agedTimeout != -1)
                && (mcWrapper.hasAgedTimedOut(pm.agedTimeoutMillis)))) {
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                if (mcWrapper.shouldBeDestroyed()) {
                    Tr.debug(this, tc, "Connection destroy flag is set, removing connection " + mcWrapper);
                }
                if (mcWrapper.hasFatalErrorNotificationOccurred(fatalErrorNotificationTime)) {
                    Tr.debug(this, tc, "Fatal error occurred, removing connection " + mcWrapper);
                }
                if (((pm.agedTimeout != -1) && (mcWrapper.hasAgedTimedOut(pm.agedTimeoutMillis)))) {
                    Tr.debug(this, tc, "Aged timeout exceeded, removing connection " + mcWrapper);
                }
                if (mcWrapper.isDestroyState()) {
                    Tr.debug(this, tc, "Mbean method purgePoolContents with option immediate was used." +
                                       "  Connection cleanup and destroy is being processed.");
                }
            }
            if (mcWrapper.isDestroyState()) {
                final FreePool tempFP = this;
                final MCWrapper tempMCWrapper = mcWrapper;
                ThreadSupportedCleanupAndDestroy tscd = new ThreadSupportedCleanupAndDestroy(pm.tscdList, tempFP, tempMCWrapper);
                pm.tscdList.add(tscd);
                pm.connectorSvc.execSvcRef.getServiceWithException().submit(tscd);
            } else {
                cleanupAndDestroyMCWrapper(mcWrapper); // cleanup, remove, then release mcWrapper
                // Do not return this mcWrapper back to the free pool.
                removeMCWrapperFromList(mcWrapper, _mcWrapperDoesNotExistInFreePool, _synchronizeInMethod, _notifyWaiter, _decrementTotalCounter);
            }
        } else {
            returnToFreePoolDelegated(mcWrapper); // Added to Help PMI Stuff.Unable to inject code in if/else conditional situations.
        } // end else -- the mcWrapper is not stale

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
            Tr.exit(this, tc, "returnToFreePool");
        }
    }
509271
void releaseConnection(ConnectionPool pool, Cassandra.Client conn)
    {
        if (pool != null && conn != null)
        {
            pool.release(conn);
        }
    }
245469
@Override
    public void destroyXAResource(XAResource xa) throws DestroyXAResourceException {

        final boolean trace = TraceComponent.isAnyTracingEnabled();
        if (trace && tc.isEntryEnabled())
            Tr.entry(this, tc, "destroyXAResource", xa);

        ManagedConnection mc = ((WSXAResource) xa).getManagedConnection();
        try {
            mc.destroy();
        } catch (ResourceException x) {
            if (trace && tc.isEntryEnabled())
                Tr.exit(tc, "destroyXAResource", x);
            throw new DestroyXAResourceException(x);
        }

        if (trace && tc.isEntryEnabled())
            Tr.exit(this, tc, "destroyXAResource");
    }
578352
public void removeConnectionPool(String url) {
        try {
            removeConnectionPool(new URL(url));
        } catch (MalformedURLException e) {
            log.error("url exception", e);
            throw new IllegalArgumentException(e);
        }
    }
780785
final public void close() {
		List<C> connsToClose;
		synchronized(poolLock) {
			// Prevent any new connections
			isClosed = true;
			// Find any connections that are available and open
			connsToClose = new ArrayList<>(availableConnections.size());
			for(PooledConnection<C> availableConnection : availableConnections) {
				synchronized(availableConnection) {
					C conn = availableConnection.connection;
					if(conn!=null) {
						availableConnection.connection = null;
						connsToClose.add(conn);
					}
				}
			}
			poolLock.notifyAll();
		}
		// Close all of the connections
		for(C conn : connsToClose) {
			try {
				close(conn);
			} catch(Exception err) {
				logger.log(Level.WARNING, null, err);
			}
		}
	}