本文整理汇总了Java中org.logicalcobwebs.proxool.ProxoolFacade类的典型用法代码示例。如果您正苦于以下问题:Java ProxoolFacade类的具体用法?Java ProxoolFacade怎么用?Java ProxoolFacade使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ProxoolFacade类属于org.logicalcobwebs.proxool包,在下文中一共展示了ProxoolFacade类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: close
import org.logicalcobwebs.proxool.ProxoolFacade; //导入依赖的package包/类
/**
* Release all resources held by this provider. JavaDoc requires a second sentence.
* @throws HibernateException
*/
public void close() throws HibernateException {
// If the provider was leeching off an existing pool don't close it
if (existingPool) {
return;
}
// We have created the pool ourselves, so shut it down
try {
ProxoolFacade.shutdown(0);
}
catch (Exception e) {
// If you're closing down the ConnectionProvider chances are an
// is not a real big deal, just warn
log.warn("Exception occured when closing the Proxool pool", e);
throw new HibernateException("Exception occured when closing the Proxool pool", e);
}
}
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:23,代码来源:ProxoolConnectionProvider.java
示例2: registerPool
import org.logicalcobwebs.proxool.ProxoolFacade; //导入依赖的package包/类
/**
* 注册一个可用的proxool数据库连接池
*
* @param url
* -- proxool 的jdbc url
* @param props
* -- 连接池配置属性
* @return -- 数据库连接池别名或者拼接的URL字符串
* @exception -- 运行时应用异常(RuntimeAppException)
*/
public static synchronized String registerPool(String url, Properties props) {
String alias = null;
logger.info("数据库连接URL:{}, 配置属性:{}", url, props);
try {
alias = ProxoolFacade.registerConnectionPool(url, props);
} catch (Exception ex) {
// ErrorTrackService ets = FwErrorTrackService.getInstance();
// RuntimeAppException raex = ets.newRuntimeError("fw06002", ex);
// raex.formatErrorMsg(alias, url, props);
// ets.trackAndThrow(raex);
String msg = "注册proxool数据库连接池异常. alias:%s, url:%s, props:%s";
msg = String.format(msg, alias, url, props);
throw new FwRuntimeException(msg, ex);
}
return alias;
}
开发者ID:bignippleboy,项目名称:ipaas,代码行数:28,代码来源:DbConnectionProvider.java
示例3: getIdleConnectionCount
import org.logicalcobwebs.proxool.ProxoolFacade; //导入依赖的package包/类
public Integer getIdleConnectionCount() {
try {
SnapshotIF snapshot = ProxoolFacade.getSnapshot(getConfiguration().getName());
return snapshot.getAvailableConnectionCount();
} catch (ProxoolException e) {
logger.error("", e);
return null;
}
}
开发者ID:nkasvosve,项目名称:beyondj,代码行数:10,代码来源:ProxoolManagedDataSource.java
示例4: getBusyConnectionCount
import org.logicalcobwebs.proxool.ProxoolFacade; //导入依赖的package包/类
public Integer getBusyConnectionCount() {
try {
SnapshotIF snapshot = ProxoolFacade.getSnapshot(getConfiguration().getName());
return snapshot.getActiveConnectionCount();
} catch (ProxoolException e) {
logger.error("", e);
return null;
}
}
开发者ID:nkasvosve,项目名称:beyondj,代码行数:10,代码来源:ProxoolManagedDataSource.java
示例5: getConnectionCount
import org.logicalcobwebs.proxool.ProxoolFacade; //导入依赖的package包/类
public Integer getConnectionCount() {
try {
SnapshotIF snapshot = ProxoolFacade.getSnapshot(getConfiguration().getName());
return (int)snapshot.getConnectionCount();
} catch (ProxoolException e) {
logger.error("", e);
return null;
}
}
开发者ID:nkasvosve,项目名称:beyondj,代码行数:10,代码来源:ProxoolManagedDataSource.java
示例6: init
import org.logicalcobwebs.proxool.ProxoolFacade; //导入依赖的package包/类
static void init() {
try {
String proxoolClazz = "org.logicalcobwebs.proxool.ProxoolDriver";
Class.forName(proxoolClazz);
logger.info("proxoolClazz:org.logicalcobwebs.proxool.ProxoolDriver");
// defaultProps.setProperty("proxool.simultaneous-build-throttle",
// "10");
// defaultProps.setProperty("proxool.test-before-use", "true");
// defaultProps.setProperty("proxool.house-keeping-test-sql",
// "select 0");
// defaultProps.setProperty("proxool.house-keeping-sleep-time",
// "60000");
// defaultProps.setProperty("proxool.maximum-active-time",
// "300000");
// defaultProps.setProperty("proxool.maximum-connection-count",
// "50");
// defaultProps.setProperty("proxool.minimum-connection-count",
// "1");
// defaultProps.setProperty("proxool.maximum-connection-lifetime",
// "1800000");
// defaultProps.setProperty("proxool.recently-started-threshold",
// "60000");
// defaultProps.setProperty("proxool.overload-without-refusal-lifetime",
// "60000");
// defaultProps.setProperty("proxool.prototype-count", "0");
// logger.info("proxool数据库连接池默认配置:{}", defaultProps);
ProxoolFacade.addProxoolListener(proxoolListener); // add proxool
// listener
} catch (Exception ex) {
throw new FwRuntimeException("初始化数据库连接提供者失败", ex);
// FwErrorTrackService.getInstance().trackAndThrowRuntime("fw06001",
// ex);
}
}
开发者ID:bignippleboy,项目名称:ipaas,代码行数:39,代码来源:DbConnectionProvider.java
示例7: removePool
import org.logicalcobwebs.proxool.ProxoolFacade; //导入依赖的package包/类
/**
* 关闭指定别名的数据库连接池
*
* @param alias
* -- 数据库连接池
* @exception -- 运行时应用异常(RuntimeAppException)
*/
public static synchronized void removePool(String alias) {
try {
logger.info("关闭指定别名的数据库连接池[alias:{}]", alias);
ProxoolFacade.removeConnectionPool(alias);
} catch (Exception ex) {
logger.error("关闭数据库连接池异常, 别名:" + alias, ex);
}
}
开发者ID:bignippleboy,项目名称:ipaas,代码行数:16,代码来源:DbConnectionProvider.java
示例8: toString
import org.logicalcobwebs.proxool.ProxoolFacade; //导入依赖的package包/类
@Override
public String toString() {
try {
ConnectionPoolDefinitionIF poolDef = ProxoolFacade.getConnectionPoolDefinition("openfire");
SnapshotIF poolStats = ProxoolFacade.getSnapshot("openfire", true);
return poolDef.getMinimumConnectionCount()+","+poolDef.getMaximumConnectionCount()+","
+poolStats.getAvailableConnectionCount()+","+poolStats.getActiveConnectionCount();
}
catch (ProxoolException e) {
return "Default Connection Provider";
}
}
开发者ID:coodeer,项目名称:g3server,代码行数:13,代码来源:DefaultConnectionProvider.java
示例9: destroy
import org.logicalcobwebs.proxool.ProxoolFacade; //导入依赖的package包/类
public void destroy() {
ProxoolFacade.shutdown();
}
开发者ID:wufeisoft,项目名称:ryf_mms2,代码行数:4,代码来源:ProxoolServlet.java
注:本文中的org.logicalcobwebs.proxool.ProxoolFacade类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论