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


Java HsqlProperties.argArrayToProps方法代码示例

本文整理汇总了Java中org.hsqldb.persist.HsqlProperties.argArrayToProps方法的典型用法代码示例。如果您正苦于以下问题:Java HsqlProperties.argArrayToProps方法的具体用法?Java HsqlProperties.argArrayToProps怎么用?Java HsqlProperties.argArrayToProps使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.hsqldb.persist.HsqlProperties的用法示例。


在下文中一共展示了HsqlProperties.argArrayToProps方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: main

import org.hsqldb.persist.HsqlProperties; //导入方法依赖的package包/类
public static void main(String[] argv) {

        TestCacheSize  test  = new TestCacheSize();
        HsqlProperties props = HsqlProperties.argArrayToProps(argv, "test");

        test.bigops   = props.getIntegerProperty("test.bigops", test.bigops);
        test.bigrows  = test.bigops;
        test.smallops = test.bigops / 8;
        test.cacheScale = props.getIntegerProperty("test.scale",
                test.cacheScale);
        test.tableType = props.getProperty("test.tabletype", test.tableType);
        test.nioMode   = props.isPropertyTrue("test.nio", test.nioMode);

        if (props.getProperty("test.dbtype", "").equals("mem")) {
            test.filepath = "mem:test";
            test.filedb   = false;
            test.shutdown = false;
        }

        test.setUp();

        StopWatch sw = new StopWatch();

        test.testFillUp();
        test.checkResults();

        long time = sw.elapsedTime();

        test.storeResult("total test time", 0, (int) time, 0);
        System.out.println("total test time -- " + sw.elapsedTime() + " ms");
        test.tearDown();
    }
 
开发者ID:tiweGH,项目名称:OpenDiabetes,代码行数:33,代码来源:TestCacheSize.java

示例2: main

import org.hsqldb.persist.HsqlProperties; //导入方法依赖的package包/类
public static void main(String[] argv) {

        TestCacheSize  test  = new TestCacheSize();
        HsqlProperties props = HsqlProperties.argArrayToProps(argv, "test");

        test.bigops   = props.getIntegerProperty("test.bigops", test.bigops);
        test.bigrows  = test.bigops;
        test.smallops = test.bigops / 8;
        test.cacheScale = props.getIntegerProperty("test.scale",
                test.cacheScale);
        test.logType   = props.getProperty("test.logtype", test.logType);
        test.tableType = props.getProperty("test.tabletype", test.tableType);
        test.nioMode   = props.isPropertyTrue("test.nio", test.nioMode);

        if (props.getProperty("test.dbtype", "").equals("mem")) {
            test.filepath = "mem:test";
            test.filedb   = false;
            test.shutdown = false;
        }

        test.setUp();

        StopWatch sw = new StopWatch();

        test.testFillUp();
        test.checkResults();

        long time = sw.elapsedTime();

        test.storeResult("total test time", 0, (int) time, 0);
        System.out.println("total test time -- " + sw.elapsedTime() + " ms");
        test.tearDown();
    }
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:34,代码来源:TestCacheSize.java

示例3: main

import org.hsqldb.persist.HsqlProperties; //导入方法依赖的package包/类
/**
 * Creates and starts a new Server.  <p>
 *
 * Allows starting a Server via the command line interface. <p>
 *
 * @param args the command line arguments for the Server instance
 */
public static void main(String[] args) {

    HsqlProperties argProps = null;

    argProps = HsqlProperties.argArrayToProps(args,
            ServerProperties.sc_key_prefix);

    String[] errors = argProps.getErrorKeys();

    if (errors.length != 0) {
        System.out.println("no value for argument:" + errors[0]);
        printHelp("server.help");

        return;
    }

    String propsPath = argProps.getProperty(ServerProperties.sc_key_props);
    String propsExtension = "";

    if (propsPath == null) {
        propsPath      = "server";
        propsExtension = ".properties";
    } else {
        argProps.removeProperty(ServerProperties.sc_key_props);
    }

    propsPath = FileUtil.getFileUtil().canonicalOrAbsolutePath(propsPath);

    ServerProperties fileProps = ServerConfiguration.getPropertiesFromFile(
        ServerConstants.SC_PROTOCOL_HSQL, propsPath, propsExtension);
    ServerProperties props =
        fileProps == null
        ? new ServerProperties(ServerConstants.SC_PROTOCOL_HSQL)
        : fileProps;

    props.addProperties(argProps);
    ServerConfiguration.translateDefaultDatabaseProperty(props);

    // Standard behaviour when started from the command line
    // is to halt the VM when the server shuts down.  This may, of
    // course, be overridden by whatever, if any, security policy
    // is in place.
    ServerConfiguration.translateDefaultNoSystemExitProperty(props);
    ServerConfiguration.translateAddressProperty(props);

    // finished setting up properties;
    Server server = new Server();

    try {
        server.setProperties(props);
    } catch (Exception e) {
        server.printError("Failed to set properties");
        server.printStackTrace(e);

        return;
    }

    // now messages go to the channel specified in properties
    server.print("Startup sequence initiated from main() method");

    if (fileProps != null) {
        server.print("Loaded properties from [" + propsPath
                     + propsExtension + "]");
    } else {
        server.print("Could not load properties from file");
        server.print("Using cli/default properties only");
    }

    server.start();
}
 
开发者ID:tiweGH,项目名称:OpenDiabetes,代码行数:78,代码来源:Server.java

示例4: main

import org.hsqldb.persist.HsqlProperties; //导入方法依赖的package包/类
/**
 *  Starts a new WebServer.
 *
 * @param  args the "command line" parameters with which to start
 *      the WebServer.  "-?" will cause the command line arguments
 *      help to be printed to the standard output
 */
public static void main(String[] args) {

    HsqlProperties argProps = null;

    argProps = HsqlProperties.argArrayToProps(args,
            ServerProperties.sc_key_prefix);

    String[] errors = argProps.getErrorKeys();

    if (errors.length != 0) {
        System.out.println("no value for argument:" + errors[0]);
        printHelp("webserver.help");

        return;
    }

    String propsPath = argProps.getProperty(ServerProperties.sc_key_props);
    String propsExtension = "";

    if (propsPath == null) {
        propsPath      = "webserver";
        propsExtension = ".properties";
    }

    propsPath = FileUtil.getFileUtil().canonicalOrAbsolutePath(propsPath);

    ServerProperties fileProps = ServerConfiguration.getPropertiesFromFile(
        ServerConstants.SC_PROTOCOL_HTTP, propsPath, propsExtension);
    ServerProperties props =
        fileProps == null
        ? new ServerProperties(ServerConstants.SC_PROTOCOL_HTTP)
        : fileProps;

    props.addProperties(argProps);
    ServerConfiguration.translateDefaultDatabaseProperty(props);

    // Standard behaviour when started from the command line
    // is to halt the VM when the server shuts down.  This may, of
    // course, be overridden by whatever, if any, security policy
    // is in place.
    ServerConfiguration.translateDefaultNoSystemExitProperty(props);
    ServerConfiguration.translateAddressProperty(props);

    // finished setting up properties;
    Server server = new WebServer();

    try {
        server.setProperties(props);
    } catch (Exception e) {
        server.printError("Failed to set properties");
        server.printStackTrace(e);

        return;
    }

    // now messages go to the channel specified in properties
    server.print("Startup sequence initiated from main() method");

    if (fileProps != null) {
        server.print("Loaded properties from [" + propsPath
                     + ".properties]");
    } else {
        server.print("Could not load properties from file");
        server.print("Using cli/default properties only");
    }

    server.start();
}
 
开发者ID:tiweGH,项目名称:OpenDiabetes,代码行数:76,代码来源:WebServer.java

示例5: main

import org.hsqldb.persist.HsqlProperties; //导入方法依赖的package包/类
/**
 * Creates and starts a new Server.  <p>
 *
 * Allows starting a Server via the command line interface. <p>
 *
 * @param args the command line arguments for the Server instance
 */
public static void main(String[] args) {

    String propsPath =
        FileUtil.getDefaultInstance().canonicalOrAbsolutePath("server");
    HsqlProperties fileProps =
        ServerConfiguration.getPropertiesFromFile(propsPath);
    HsqlProperties props       = fileProps == null ? new HsqlProperties()
                                                   : fileProps;
    HsqlProperties stringProps = null;

    try {
        stringProps = HsqlProperties.argArrayToProps(args,
                ServerConstants.SC_KEY_PREFIX);
    } catch (ArrayIndexOutOfBoundsException aioob) {

        // I'd like to exit with 0 here, but it's possible that user
        // has called main() programmatically and does not want us to
        // exit.
        printHelp("server.help");

        return;
    }

    if (stringProps != null) {
        if (stringProps.getErrorKeys().length != 0) {
            printHelp("server.help");

            return;
        }

        props.addProperties(stringProps);
    }

    ServerConfiguration.translateDefaultDatabaseProperty(props);

    // Standard behaviour when started from the command line
    // is to halt the VM when the server shuts down.  This may, of
    // course, be overridden by whatever, if any, security policy
    // is in place.
    ServerConfiguration.translateDefaultNoSystemExitProperty(props);

    // finished setting up properties;
    Server server = new Server();

    try {
        server.setProperties(props);
    } catch (Exception e) {
        server.printError("Failed to set properties");
        server.printStackTrace(e);

        return;
    }

    // now messages go to the channel specified in properties
    server.print("Startup sequence initiated from main() method");

    if (fileProps != null) {
        server.print("Loaded properties from [" + propsPath
                     + ".properties]");
    } else {
        server.print("Could not load properties from file");
        server.print("Using cli/default properties only");
    }

    server.start();
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:74,代码来源:Server.java

示例6: main

import org.hsqldb.persist.HsqlProperties; //导入方法依赖的package包/类
/**
 *  Starts a new WebServer.
 *
 * @param  args the "command line" parameters with which to start
 *      the WebServer.  "-?" will cause the command line arguments
 *      help to be printed to the standard output
 */
public static void main(String[] args) {

    String propsPath =
        FileUtil.getDefaultInstance().canonicalOrAbsolutePath("webserver");
    HsqlProperties fileProps =
        ServerConfiguration.getPropertiesFromFile(propsPath);
    HsqlProperties props = fileProps == null ? new HsqlProperties()
                                             : fileProps;
    HsqlProperties stringProps = null;
    try {
        stringProps = HsqlProperties.argArrayToProps(args,
                ServerConstants.SC_KEY_PREFIX);
    } catch (ArrayIndexOutOfBoundsException aioob) {
        // I'd like to exit with 0 here, but it's possible that user
        // has called main() programmatically and does not want us to
        // exit.
        printHelp("webserver.help");
        return;
    }

    if (stringProps != null) {
        if (stringProps.getErrorKeys().length != 0) {
            printHelp("webserver.help");

            return;
        }

        props.addProperties(stringProps);
    }

    ServerConfiguration.translateDefaultDatabaseProperty(props);

    // Standard behaviour when started from the command line
    // is to halt the VM when the server shuts down.  This may, of
    // course, be overridden by whatever, if any, security policy
    // is in place.
    ServerConfiguration.translateDefaultNoSystemExitProperty(props);

    // finished setting up properties;
    Server server = new WebServer();

    try {
        server.setProperties(props);
    } catch (Exception e) {
        server.printError("Failed to set properties");
        server.printStackTrace(e);

        return;
    }

    // now messages go to the channel specified in properties
    server.print("Startup sequence initiated from main() method");

    if (fileProps != null) {
        server.print("Loaded properties from [" + propsPath
                     + ".properties]");
    } else {
        server.print("Could not load properties from file");
        server.print("Using cli/default properties only");
    }

    server.start();
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:71,代码来源:WebServer.java


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