本文整理汇总了Java中com.owera.common.db.ConnectionProperties类的典型用法代码示例。如果您正苦于以下问题:Java ConnectionProperties类的具体用法?Java ConnectionProperties怎么用?Java ConnectionProperties使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ConnectionProperties类属于com.owera.common.db包,在下文中一共展示了ConnectionProperties类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: DBI
import com.owera.common.db.ConnectionProperties; //导入依赖的package包/类
public DBI(int lifetimeSec, ConnectionProperties connectionProperties, Syslog syslog) throws NoAvailableConnectionException, SQLException {
this.cp = connectionProperties;
this.lifetimeSec = lifetimeSec;
this.syslog = syslog;
populateInboxes();
publishInbox.deleteReadMessage();
this.sleep = new Sleep(1000, 1000, true);
this.xaps = new XAPS(cp, syslog);
this.dbiId = random.nextInt(1000000);
xaps.setDbi(this);
publishInbox.addFilter(new Message(null, Message.MTYPE_PUB_ADD, null, null));
publishInbox.addFilter(new Message(null, Message.MTYPE_PUB_CHG, null, null));
publishInbox.addFilter(new Message(null, Message.MTYPE_PUB_DEL, null, null));
registerInbox(PUBLISH_INBOX_NAME, publishInbox);
Thread t = new Thread(this);
if (syslog != null)
t.setName("DBI for " + syslog.getIdentity().getFacilityName());
else
t.setName("DBI");
t.setDaemon(true);
t.start();
logger.debug("DBI is loaded for user " + syslog.getIdentity().getUser().getFullname());
}
示例2: XAPSUnit
import com.owera.common.db.ConnectionProperties; //导入依赖的package包/类
public XAPSUnit(ConnectionProperties connectionProperties, XAPS xaps, Syslog syslog) throws NoAvailableConnectionException, SQLException {
this.connectionProperties = connectionProperties;
this.syslog = syslog;
if (xaps == null)
throw new IllegalArgumentException("The XAPSUnit constructor requires a non-null XAPS object");
this.xaps = xaps;
if (xaps.getUnittypes() == null) {
xaps.read();
}
}
示例3: XAPS
import com.owera.common.db.ConnectionProperties; //导入依赖的package包/类
public XAPS(ConnectionProperties connectionProperties, Syslog syslog) throws NoAvailableConnectionException, SQLException {
long start = System.currentTimeMillis();
this.connectionProperties = connectionProperties;
this.syslog = syslog;
/* Checks all necessary tables to see which version they're in */
XAPSVersionCheck.versionCheck(connectionProperties);
this.unittypes = read();
if (logger.isDebugEnabled()) {
logger.debug("Read XAPS object in " + (System.currentTimeMillis() - start) + " ms.");
}
}
示例4: ReportGenerator
import com.owera.common.db.ConnectionProperties; //导入依赖的package包/类
public ReportGenerator(ConnectionProperties sysCp, ConnectionProperties xapsCp, XAPS xaps, String logPrefix, Identity id) {
this.sysCp = sysCp;
this.xapsCp = xapsCp;
this.xaps = xaps;
this.id = id;
if (logPrefix != null)
this.logPrefix = logPrefix;
}
示例5: doGet
import com.owera.common.db.ConnectionProperties; //导入依赖的package包/类
/**
* doGet prints some information about the server, focus on database connections and memory usage
*/
protected void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException {
if (req.getParameter("clearCache") != null)
BaseCache.clearCache();
PrintWriter pw = res.getWriter();
String html = "";
html += "<title>xAPS TR-069 Server Monitoring Page</title>";
html += "<h1>Monitoring of the TR-069 Server v. " + VERSION + "</h1>";
ConnectionProperties props = DBAccess.getXAPSProperties();
ConnectionPoolData poolData = ConnectionProvider.getConnectionPoolData(props);
if (poolData != null) {
html += "<h1>Database connection</h1>\n";
html += "This server is connected to " + poolData.getProps().getUrl() + " with user " + poolData.getProps().getUser() + "<br>\n";
ConnectionMetaData metaData = poolData.getMetaData().clone();
html += "<ul>Accessed : " + metaData.getAccessed() + "<br>\n";
html += "Retries : " + metaData.getRetries() + "<br>\n";
html += "Denied : " + metaData.getDenied() + "<br>\n";
html += "Denied % : " + metaData.calculateDeniedPercent() + "<br>\n";
html += "Free : " + poolData.getFreeConn().size() + "<br>\n";
html += "Currently used : " + poolData.getUsedConn().size() + "<br>\n";
html += "Used % : " + metaData.calculateUsedPercent() + "<br>\n<ul>";
int[] accessedSim = metaData.getAccessedSim();
for (int i = 1; i < accessedSim.length; i++) {
if (accessedSim[i] == 0 && accessedSim[i + 1] == 0 && accessedSim[i + 2] == 0)
break;
float percent = ((float) accessedSim[i] / metaData.getAccessed()) * 100f;
html += String.format("Used " + i + " connection(s) simultaneously: %8.5f", percent);
html += "% (accessed: " + accessedSim[i] + ")<br>\n";
}
html += "</ul>\n</ul><br>\n";
}
long total = Runtime.getRuntime().totalMemory();
long free = Runtime.getRuntime().freeMemory();
long used = total - free;
html += "<h1>Memory Usage</h1>\n";
html += "The JVM uses " + getBytesFormatted(used) + " of memory. " + getBytesFormatted(free) + " of memory available on the heap.<br>";
pw.print(html);
}
示例6: UnitJobs
import com.owera.common.db.ConnectionProperties; //导入依赖的package包/类
public UnitJobs(ConnectionProperties cp) {
this.connectionProperties = cp;
}
示例7: Permissions
import com.owera.common.db.ConnectionProperties; //导入依赖的package包/类
protected Permissions(ConnectionProperties cp) {
// this.user = user;
this.connectionProperties = cp;
}
示例8: ScriptExecutions
import com.owera.common.db.ConnectionProperties; //导入依赖的package包/类
public ScriptExecutions(ConnectionProperties connectionProperties) {
this.connectionProperties = connectionProperties;
}
示例9: getConnectionProperties
import com.owera.common.db.ConnectionProperties; //导入依赖的package包/类
public ConnectionProperties getConnectionProperties() {
return connectionProperties;
}
示例10: Users
import com.owera.common.db.ConnectionProperties; //导入依赖的package包/类
public Users(ConnectionProperties cp) throws SQLException, NoAvailableConnectionException {
XAPSVersionCheck.versionCheck(cp);
this.connectionProperties = cp;
readAllUsers();
}
示例11: getConnectionProperties
import com.owera.common.db.ConnectionProperties; //导入依赖的package包/类
protected ConnectionProperties getConnectionProperties() {
return connectionProperties;
}
示例12: ReportSyslogGenerator
import com.owera.common.db.ConnectionProperties; //导入依赖的package包/类
public ReportSyslogGenerator(ConnectionProperties sysCp, ConnectionProperties xapsCp, XAPS xaps, String logPrefix, Identity id) {
super(sysCp, xapsCp, xaps, logPrefix, id);
}
示例13: ReportProvisioningGenerator
import com.owera.common.db.ConnectionProperties; //导入依赖的package包/类
public ReportProvisioningGenerator(ConnectionProperties sysCp, ConnectionProperties xapsCp, XAPS xaps, String logPrefix, Identity id) {
super(sysCp, xapsCp, xaps, logPrefix, id);
}
示例14: ReportVoipGenerator
import com.owera.common.db.ConnectionProperties; //导入依赖的package包/类
public ReportVoipGenerator(ConnectionProperties sysCp, ConnectionProperties xapsCp, XAPS xaps, String logPrefix, Identity id) {
super(sysCp, xapsCp, xaps, logPrefix, id);
}
示例15: ReportVoipCallGenerator
import com.owera.common.db.ConnectionProperties; //导入依赖的package包/类
public ReportVoipCallGenerator(ConnectionProperties sysCp, ConnectionProperties xapsCp, XAPS xaps, String logPrefix, Identity id) {
super(sysCp, xapsCp, xaps, logPrefix, id);
}