本文整理汇总了Java中org.logicalcobwebs.proxool.ProxoolException类的典型用法代码示例。如果您正苦于以下问题:Java ProxoolException类的具体用法?Java ProxoolException怎么用?Java ProxoolException使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ProxoolException类属于org.logicalcobwebs.proxool包,在下文中一共展示了ProxoolException类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: contextInitialized
import org.logicalcobwebs.proxool.ProxoolException; //导入依赖的package包/类
/**
*
* 初始化proxool数据库连接池
*
* @param event
*
* @return ModelAndView
*/
public void contextInitialized(ServletContextEvent event)
{
LOG.info("ProxoolInitialListener init ...");
String appDir = event.getServletContext().getRealPath("/");
String value = event.getServletContext().getInitParameter("proxoolXmlFile");
try
{
File file = new File(value);
if (file.isAbsolute())
{
JAXPConfigurator.configure(value, false);
}
else
{
JAXPConfigurator.configure(appDir + File.separator + value, false);
}
}
catch (ProxoolException e)
{
LOG.error("Problem configuring " + value, e);
}
}
开发者ID:GooDay0923,项目名称:java-framework-with-springmvc-mybatis-proxool,代码行数:31,代码来源:ProxoolInitialListener.java
示例2: init
import org.logicalcobwebs.proxool.ProxoolException; //导入依赖的package包/类
public static void init() {
try {
logger.info("init database connection pool……");
JAXPConfigurator.configure("configs/proxool.xml", true);
} catch (ProxoolException e) {
logger.error("read config failed ", e);
System.exit(-1);
}
}
示例3: init
import org.logicalcobwebs.proxool.ProxoolException; //导入依赖的package包/类
public static void init(String dbPath) {
try {
logger.info("初始化数据库连接池……");
JAXPConfigurator.configure(dbPath, true);
} catch (ProxoolException e) {
e.printStackTrace();
logger.error("读取数据库配置文件出错 " + e.getMessage(), e);
}
}
示例4: getIdleConnectionCount
import org.logicalcobwebs.proxool.ProxoolException; //导入依赖的package包/类
public Integer getIdleConnectionCount() {
try {
SnapshotIF snapshot = ProxoolFacade.getSnapshot(getConfiguration().getName());
return snapshot.getAvailableConnectionCount();
} catch (ProxoolException e) {
logger.error("", e);
return null;
}
}
示例5: getBusyConnectionCount
import org.logicalcobwebs.proxool.ProxoolException; //导入依赖的package包/类
public Integer getBusyConnectionCount() {
try {
SnapshotIF snapshot = ProxoolFacade.getSnapshot(getConfiguration().getName());
return snapshot.getActiveConnectionCount();
} catch (ProxoolException e) {
logger.error("", e);
return null;
}
}
示例6: getConnectionCount
import org.logicalcobwebs.proxool.ProxoolException; //导入依赖的package包/类
public Integer getConnectionCount() {
try {
SnapshotIF snapshot = ProxoolFacade.getSnapshot(getConfiguration().getName());
return (int)snapshot.getConnectionCount();
} catch (ProxoolException e) {
logger.error("", e);
return null;
}
}
示例7: toString
import org.logicalcobwebs.proxool.ProxoolException; //导入依赖的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";
}
}