本文整理汇总了Java中org.hsqldb.persist.HsqlProperties.delimitedArgPairsToProps方法的典型用法代码示例。如果您正苦于以下问题:Java HsqlProperties.delimitedArgPairsToProps方法的具体用法?Java HsqlProperties.delimitedArgPairsToProps怎么用?Java HsqlProperties.delimitedArgPairsToProps使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.hsqldb.persist.HsqlProperties
的用法示例。
在下文中一共展示了HsqlProperties.delimitedArgPairsToProps方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: putPropertiesFromString
import org.hsqldb.persist.HsqlProperties; //导入方法依赖的package包/类
/**
* Puts properties from the supplied string argument. The relevant
* key value pairs are the same as those for the (web)server.properties
* file format, except that the 'server.' prefix should not be specified.
*
* @param s semicolon-delimited key=value pair string,
* e.g. silent=false;port=8080;...
* @throws HsqlException if this server is running
*
* @jmx.managed-operation
* impact="ACTION"
* description="'server.' key prefix automatically supplied"
*
* @jmx.managed-operation-parameter
* name="s"
* type="java.lang.String"
* position="0"
* description="semicolon-delimited key=value pairs"
*/
public void putPropertiesFromString(String s) {
if (getState() != ServerConstants.SERVER_STATE_SHUTDOWN) {
throw Error.error(ErrorCode.GENERAL_ERROR);
}
if (StringUtil.isEmpty(s)) {
return;
}
printWithThread("putPropertiesFromString(): [" + s + "]");
HsqlProperties p = HsqlProperties.delimitedArgPairsToProps(s, "=",
";", ServerProperties.sc_key_prefix);
try {
setProperties(p);
} catch (Exception e) {
throw Error.error(e, ErrorCode.GENERAL_ERROR,
ErrorCode.M_Message_Pair,
new String[]{ "Failed to set properties" });
}
}
示例2: putPropertiesFromString
import org.hsqldb.persist.HsqlProperties; //导入方法依赖的package包/类
/**
* Puts properties from the supplied string argument. The relevant
* key value pairs are the same as those for the (web)server.properties
* file format, except that the 'server.' prefix should not be specified.
*
* @param s semicolon-delimited key=value pair string,
* e.g. k1=v1;k2=v2;k3=v3...
* @throws RuntimeException if this server is running
*
* @jmx.managed-operation
* impact="ACTION"
* description="'server.' key prefix automatically supplied"
*
* @jmx.managed-operation-parameter
* name="s"
* type="java.lang.String"
* position="0"
* description="semicolon-delimited key=value pairs"
*/
public void putPropertiesFromString(String s) {
if (getState() != ServerConstants.SERVER_STATE_SHUTDOWN) {
throw new RuntimeException();
}
if (StringUtil.isEmpty(s)) {
return;
}
printWithThread("putPropertiesFromString(): [" + s + "]");
HsqlProperties p = HsqlProperties.delimitedArgPairsToProps(s, "=",
";", ServerConstants.SC_KEY_PREFIX);
try {
setProperties(p);
} catch (Exception e) {
throw new RuntimeException("Failed to set properties: " + e);
}
}