if(i<1) {//监控可用连接数。
StringBuffer sb=new StringBuffer();
sb.append("oper before DataSource Pool info : rn");
sb.append("AvailableConnectionCount="
+ AvailableConnectionCount);
sb.append("InUseConnectionCount="+InUseConnectionCount);
sb.append("ConnectionCreatedCount="
+ ConnectionCreatedCount);
sb.append("ConnectionDestroyedCount="
+ ConnectionDestroyedCount);
sb.append("rn");
//opReturn=server.invoke(name,"flush",argTypes,argTypes);
/*调用mbean的方法释放连接 begin 本实现方法对应jboss3.2.3
对于jboss4以后的版本只需调用
//opReturn=server.invoke(name,"flush",argTypes,argTypes);
**/
opReturn=server.invoke(name,"stop",argTypes,argTypes);
opReturn=server.invoke(name,"start",argTypes,argTypes);
opReturn=server.invoke(lname,"stop",argTypes,argTypes);
opReturn=server.invoke(lname,"start",argTypes,argTypes);
/*调用mbean的方法释放连接 end **/
AvailableConnectionCount=server.getAttribute(name,
"AvailableConnectionCount").toString();
InUseConnectionCount=server.getAttribute(name,
"InUseConnectionCount").toString();
ConnectionCreatedCount=server.getAttribute(name,
"ConnectionCreatedCount").toString();
ConnectionDestroyedCount =server.getAttribute(name,
"ConnectionDestroyedCount").toString();
ConnectionDestroyedCount=server.getAttribute(name,
"ConnectionDestroyedCount").toString();
sb.append("oper afer DataSource Pool info :rn");
sb.append("AvailableConnectionCount="
+ AvailableConnectionCount);
sb.append("InUseConnectionCount="+InUseConnectionCount);
sb.append("ConnectionCreatedCount="
+ ConnectionCreatedCount);
sb.append("ConnectionDestroyedCount="
+ ConnectionDestroyedCount);
//writeLog(sb.toString()); 操作日志信息
System.out.println("===========op SUCCESS============");
}
}catch(Exception ex){
ex.printStackTrace();
}
}
}
上一页 [1] [2]
责任编辑:小草