本文整理汇总了Java中org.hsqldb.lib.StopWatch.stop方法的典型用法代码示例。如果您正苦于以下问题:Java StopWatch.stop方法的具体用法?Java StopWatch.stop怎么用?Java StopWatch.stop使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.hsqldb.lib.StopWatch
的用法示例。
在下文中一共展示了StopWatch.stop方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: openDatabases
import org.hsqldb.lib.StopWatch; //导入方法依赖的package包/类
/**
* Opens this server's database instances. This method returns true If
* at least one database goes online, otherwise it returns false.
*
* If opening any of the databases is attempted and an exception is
* thrown, the server error is set to this exception.
*/
final boolean openDatabases() {
printWithThread("openDatabases() entered");
boolean success = false;
setDBInfoArrays();
for (int i = 0; i < dbAlias.length; i++) {
if (dbAlias[i] == null) {
continue;
}
printWithThread("Opening database: [" + dbType[i] + dbPath[i]
+ "]");
StopWatch sw = new StopWatch();
int id;
try {
id = DatabaseManager.getDatabase(dbType[i], dbPath[i], this,
dbProps[i]);
dbID[i] = id;
success = true;
} catch (HsqlException e) {
printError("Database [index=" + i + ", db=" + dbType[i]
+ dbPath[i] + ", alias=" + dbAlias[i]
+ "] did not open: " + e.toString());
setServerError(e);
dbAlias[i] = null;
dbPath[i] = null;
dbType[i] = null;
dbProps[i] = null;
continue;
}
sw.stop();
String msg = "Database [index=" + i + ", id=" + id + ", db="
+ dbType[i] + dbPath[i] + ", alias=" + dbAlias[i]
+ "] opened successfully";
print(sw.elapsedTimeToMessage(msg));
}
printWithThread("openDatabases() exiting");
if (isRemoteOpen) {
success = true;
}
if (!success && getServerError() == null) {
// database alias / path list is empty or without full info for any DB
setServerError(Error.error(ErrorCode.SERVER_NO_DATABASE));
}
return success;
}
示例2: openDatabases
import org.hsqldb.lib.StopWatch; //导入方法依赖的package包/类
/**
* Opens this server's database instances. This method returns true If
* at least one database goes online, otherwise it returns false.
*
* If openning any of the databases is attempted and an exception is
* thrown, the server error is set to this exception.
*/
final boolean openDatabases() {
printWithThread("openDatabases() entered");
boolean success = false;
setDBInfoArrays();
for (int i = 0; i < dbAlias.length; i++) {
if (dbAlias[i] == null) {
continue;
}
printWithThread("Opening database: [" + dbType[i] + dbPath[i]
+ "]");
StopWatch sw = new StopWatch();
int id;
try {
id = DatabaseManager.getDatabase(dbType[i], dbPath[i], this,
dbProps[i]);
dbID[i] = id;
success = true;
} catch (HsqlException e) {
printError("Database [index=" + i + ", db=" + dbType[i]
+ dbPath[i] + ", alias=" + dbAlias[i]
+ "] did not open: " + e.toString());
setServerError(e);
dbAlias[i] = null;
dbPath[i] = null;
dbType[i] = null;
dbProps[i] = null;
continue;
}
sw.stop();
String msg = "Database [index=" + i + ", id=" + id + ", db="
+ dbType[i] + dbPath[i] + ", alias=" + dbAlias[i]
+ "] opened sucessfully";
print(sw.elapsedTimeToMessage(msg));
}
printWithThread("openDatabases() exiting");
if (isRemoteOpen) {
success = true;
}
if (!success && getServerError() == null) {
// database alias / path list is empty or without full info for any DB
setServerError(Error.error(ErrorCode.SERVER_NO_DATABASE));
}
return success;
}
示例3: openDatabases
import org.hsqldb.lib.StopWatch; //导入方法依赖的package包/类
/**
* Opens this server's database instances. This method returns true If
* at least one database goes online, otherwise it returns false.
*
* If openning any of the databases is attempted and an exception is
* thrown, the server error is set to this exception.
*
* @throws HsqlException if a database access error occurs
*/
final boolean openDatabases() {
printWithThread("openDatabases() entered");
boolean success = false;
setDBInfoArrays();
for (int i = 0; i < dbAlias.length; i++) {
if (dbAlias[i] == null) {
continue;
}
printWithThread("Opening database: [" + dbType[i] + dbPath[i]
+ "]");
StopWatch sw = new StopWatch();
int id;
try {
id = DatabaseManager.getDatabase(dbType[i], dbPath[i], this,
dbProps[i]);
dbID[i] = id;
success = true;
} catch (HsqlException e) {
printError("Database [index=" + i + "db=" + dbType[i]
+ dbPath[i] + ", alias=" + dbAlias[i]
+ "] did not open: " + e.toString());
setServerError(e);
dbAlias[i] = null;
dbPath[i] = null;
dbType[i] = null;
dbProps[i] = null;
continue;
}
sw.stop();
String msg = "Database [index=" + i + ", id=" + id + ", " + "db="
+ dbType[i] + dbPath[i] + ", alias=" + dbAlias[i]
+ "] opened sucessfully";
print(sw.elapsedTimeToMessage(msg));
}
printWithThread("openDatabases() exiting");
if (!success && getServerError() == null) {
// database alias / path list is empty or without full info for any DB
setServerError(Trace.error(Trace.SERVER_NO_DATABASE));
}
return success;
}
示例4: openDatabases
import org.hsqldb.lib.StopWatch; //导入方法依赖的package包/类
/**
* Opens this server's database instances. This method returns true If
* at least one database goes online, otherwise it returns false.
*
* If openning any of the databases is attempted and an exception is
* thrown, the server error is set to this exception.
*
* @throws HsqlException if a database access error occurs
*/
final boolean openDatabases() {
printWithThread("openDatabases() entered");
boolean success = false;
setDBInfoArrays();
for (int i = 0; i < dbAlias.length; i++) {
if (dbAlias[i] == null) {
continue;
}
printWithThread("Opening database: [" + dbType[i] + dbPath[i]
+ "]");
StopWatch sw = new StopWatch();
int id;
try {
id = DatabaseManager.getDatabase(dbType[i], dbPath[i], this,
dbProps[i]);
dbID[i] = id;
success = true;
} catch (HsqlException e) {
printError("Database [index=" + i + "db=" + dbType[i]
+ dbPath[i] + ", alias=" + dbAlias[i]
+ "] did not open: " + e.toString());
setServerError(e);
dbAlias[i] = null;
dbPath[i] = null;
dbType[i] = null;
dbProps[i] = null;
continue;
}
sw.stop();
String msg = "Database [index=" + i + ", id=" + id + ", " + "db="
+ dbType[i] + dbPath[i] + ", alias=" + dbAlias[i]
+ "] opened sucessfully";
print(sw.elapsedTimeToMessage(msg));
}
printWithThread("openDatabases() exiting");
if (isRemoteOpen) {
success = true;
}
if (!success && getServerError() == null) {
// database alias / path list is empty or without full info for any DB
setServerError(Trace.error(Trace.SERVER_NO_DATABASE));
}
return success;
}