示例#1
0
 public void destroy() {
   try {
     internalPool.close();
   } catch (Exception e) {
     throw new JedisException("Could not destroy the pool", e);
   }
 }
示例#2
0
 public void close() throws Exception {
   if (mConnectionPool != null) {
     mConnectionPool.close();
     mConnectionPool = null;
   }
   mDataSource = null;
 }
示例#3
0
 @Override
 protected void doStop() throws Exception {
   super.doStop();
   if (consumers != null) {
     consumers.close();
     consumers = null;
   }
 }
 protected void stopPool(GenericObjectPool pool) {
   pool.clear();
   try {
     pool.close();
   } catch (Exception e) {
     _log.error("ERROR >> Failed to close pool ", e);
   }
 }
示例#5
0
  /** Shuts down pool and closes connections */
  public static synchronized void shutdown() {
    try {
      connectionPool.close();
    } catch (Exception e) {
      log.warn("Failed to shutdown DatabaseFactory", e);
    }

    // set datasource to null so we can call init() once more...
    dataSource = null;
  }
示例#6
0
 /*
  * (non-Javadoc)
  *
  * @see org.geotools.arcsde.session.ISessionPool#close()
  */
 public void close() {
   if (pool != null) {
     try {
       pool.close();
       pool = null;
       LOGGER.fine("SDE connection pool closed. ");
     } catch (Exception e) {
       LOGGER.log(Level.WARNING, "Closing pool: " + e.getMessage(), e);
     }
   }
 }
  public static synchronized void releaseResources() {
    log.debug("Releasing resources...");
    if (isInitialized) {
      try {
        if (workerPool.getNumActive() > 0) {
          log.warn("Shutting down even though there are still some active compute workers");
        }

        workerPool.clear();
        workerPool.close();
      } catch (Exception e) {
        log.error("Problem shutting down compute service", e);
      }
    }
  }