当前位置: 首页>>代码示例>>Java>>正文


Java StopWatch.stop方法代码示例

本文整理汇总了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;
}
 
开发者ID:tiweGH,项目名称:OpenDiabetes,代码行数:69,代码来源:Server.java

示例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;
}
 
开发者ID:Julien35,项目名称:dev-courses,代码行数:69,代码来源:Server.java

示例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;
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:67,代码来源:Server.java

示例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;
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:71,代码来源:Server.java


注:本文中的org.hsqldb.lib.StopWatch.stop方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。