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


Java HsqlProperties.getErrorKeys方法代码示例

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


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

示例1: setProperties

import org.hsqldb.persist.HsqlProperties; //导入方法依赖的package包/类
/**
 * Sets server properties using the specified properties object
 *
 * @param props The object containing properties to set
 * @throws ServerAcl.AclFormatException
 *          ACL list was requested but problem loading ACL.
 * @throws IOException
 *          ACL list was requested but I/O problem loading ACL.
 */
public void setProperties(HsqlProperties props)
throws IOException, ServerAcl.AclFormatException {

    checkRunning(false);

    if (props != null) {
        props.validate();

        String[] errors = props.getErrorKeys();

        if (errors.length > 0) {
            throw Error.error(ErrorCode.SERVER_NO_DATABASE, errors[0]);
        }

        serverProperties.addProperties(props);
    }

    maxConnections = serverProperties.getIntegerProperty(
        ServerProperties.sc_key_max_connections, 16);

    JavaSystem.setLogToSystem(isTrace());

    isSilent =
        serverProperties.isPropertyTrue(ServerProperties.sc_key_silent);
    isRemoteOpen = serverProperties.isPropertyTrue(
        ServerProperties.sc_key_remote_open_db);
    isDaemon =
        serverProperties.isPropertyTrue(ServerProperties.sc_key_daemon);

    String aclFilepath =
        serverProperties.getProperty(ServerProperties.sc_key_acl);

    if (aclFilepath != null) {
        acl = new ServerAcl(new File(aclFilepath));

        if (logWriter != null && !isSilent) {
            acl.setPrintWriter(logWriter);
        }
    }
}
 
开发者ID:tiweGH,项目名称:OpenDiabetes,代码行数:50,代码来源:Server.java

示例2: 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

示例3: 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

示例4: 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

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