當前位置: 首頁>>代碼示例>>Java>>正文


Java GenericObjectPool.close方法代碼示例

本文整理匯總了Java中org.apache.commons.pool.impl.GenericObjectPool.close方法的典型用法代碼示例。如果您正苦於以下問題:Java GenericObjectPool.close方法的具體用法?Java GenericObjectPool.close怎麽用?Java GenericObjectPool.close使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.apache.commons.pool.impl.GenericObjectPool的用法示例。


在下文中一共展示了GenericObjectPool.close方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: refreshChannelPool

import org.apache.commons.pool.impl.GenericObjectPool; //導入方法依賴的package包/類
/**
 * Refresh the channel pool for the server.
 *
 * @param loc server address
 */
public void refreshChannelPool(Location loc) {
  try {
    lock.lock();
    GenericObjectPool<Channel> pool = locToChannelPoolMap.get(loc);
    if(pool == null) {
      return;
    } else {
      try {
        pool.close();
      } catch (Exception e) {
        LOG.error("Close channel for location " + loc +" error ", e);
      }
    }

    locToChannelPoolMap.put(loc, createPool(loc, pool.getNumActive() / 5));
  } finally {
    lock.unlock();
  }
}
 
開發者ID:Tencent,項目名稱:angel,代碼行數:25,代碼來源:ChannelManager.java

示例2: removeChannelPool

import org.apache.commons.pool.impl.GenericObjectPool; //導入方法依賴的package包/類
/**
 * Remove the channel pool for the server.
 *
 * @param loc server address
 */
public void removeChannelPool(Location loc) {
  try {
    lock.lock();
    GenericObjectPool<Channel> pool = locToChannelPoolMap.remove(loc);
    if (pool != null) {
      try {
        pool.close();
      } catch (Exception e) {
        e.printStackTrace();
      }
    }
  } finally {
    lock.unlock();
  }
}
 
開發者ID:Tencent,項目名稱:angel,代碼行數:21,代碼來源:ChannelManager.java

示例3: close

import org.apache.commons.pool.impl.GenericObjectPool; //導入方法依賴的package包/類
public synchronized void close() throws ZooKeeperConnectionException {
	if (this.closed) {
		throw new ZooKeeperConnectionException("HzDataSource was already closed");
	}
	//
	this.closed = true;
	GenericObjectPool<HConnection> oldpool = this.objectPool;
	this.objectPool = null;
	this.instance = null;
	try {
		if (oldpool != null)
			oldpool.close();
	} catch (Exception ex) {
		throw new ZooKeeperConnectionException("Cannot close pool", ex);
	}
}
 
開發者ID:mixaceh,項目名稱:openyu-commons,代碼行數:17,代碼來源:HzDataSourceImpl.java

示例4: close

import org.apache.commons.pool.impl.GenericObjectPool; //導入方法依賴的package包/類
public synchronized void close() throws TTransportException {
	if (this.closed) {
		throw new TTransportException(dataSourceType + " was already closed");
	}
	//
	this.closed = true;
	GenericObjectPool<TTransport> oldpool = this.objectPool;
	this.objectPool = null;
	this.instance = null;
	try {
		if (oldpool != null)
			oldpool.close();
	} catch (Exception e) {
		throw new TTransportException("Cannot close pool", e);
	}
}
 
開發者ID:mixaceh,項目名稱:openyu-commons,代碼行數:17,代碼來源:ThriftDataSourceSupporter.java

示例5: close

import org.apache.commons.pool.impl.GenericObjectPool; //導入方法依賴的package包/類
public synchronized void close() throws IOException {
	this.closed = true;
	GenericObjectPool<XMPPConnection> oldpool = this.objectPool;
	this.objectPool = null;
	this.instance = null;
	try {
		if (oldpool != null) {
			oldpool.close();
		}
	} catch (Exception ex) {
		throw new IOException("Cannot close pool", ex);
	}
}
 
開發者ID:mixaceh,項目名稱:openyu-commons,代碼行數:14,代碼來源:XmppConnectionFactoryImpl.java

示例6: close

import org.apache.commons.pool.impl.GenericObjectPool; //導入方法依賴的package包/類
public synchronized void close() throws IOException {
	this.closed = true;
	GenericObjectPool<FTPClient> oldpool = this.objectPool;
	this.objectPool = null;
	this.instance = null;
	try {
		if (oldpool != null) {
			oldpool.close();
		}
	} catch (Exception ex) {
		throw new IOException("Cannot close pool", ex);
	}
}
 
開發者ID:mixaceh,項目名稱:openyu-commons,代碼行數:14,代碼來源:FtpClientConnectionFactoryImpl.java


注:本文中的org.apache.commons.pool.impl.GenericObjectPool.close方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。