本文整理汇总了Java中org.hsqldb.ServerConstants类的典型用法代码示例。如果您正苦于以下问题:Java ServerConstants类的具体用法?Java ServerConstants怎么用?Java ServerConstants使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ServerConstants类属于org.hsqldb包,在下文中一共展示了ServerConstants类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: waitForServer
import org.hsqldb.ServerConstants; //导入依赖的package包/类
/**
* Blocks the current thread until the server is shut down.
*/
public void waitForServer() {
while (true) {
int curState = server.getState();
if (curState == ServerConstants.SERVER_STATE_SHUTDOWN) {
LOG.info("Got shutdown notification");
break;
}
try {
Thread.sleep(100);
} catch (InterruptedException ie) {
LOG.info("Interrupted while blocking for server:"
+ StringUtils.stringifyException(ie));
}
}
}
开发者ID:aliyun,项目名称:aliyun-maxcompute-data-collectors,代码行数:20,代码来源:HsqldbMetaStore.java
示例2: stop
import org.hsqldb.ServerConstants; //导入依赖的package包/类
public void stop() {
server.stop();
int maxWait = 5000 * 5;
int currentWait = 0;
while (server.getState() != ServerConstants.SERVER_STATE_SHUTDOWN) {
LOG.log(Level.INFO, "Shutting down hsqldb-server. State: " + server.getStateDescriptor());
LOG.log(Level.INFO, name);
LOG.log(Level.INFO, path);
LOG.log(Level.INFO, "Waiting 5 seconds ...");
try {
Thread.sleep(5000);
currentWait += 5000;
} catch (InterruptedException interrupt) {
LOG.log(Level.WARNING, "Shutdown interrupted.", interrupt);
break;
}
if(currentWait >= maxWait) {
LOG.info("Giving up... ;-)");
break;
}
}
if(server.getState() == ServerConstants.SERVER_STATE_SHUTDOWN) {
LOG.log(Level.INFO, "Shutdown complete!");
}
server = null;
}
开发者ID:KlausRicharz,项目名称:Foosball-League,代码行数:27,代码来源:HsqldbManager.java
示例3: start
import org.hsqldb.ServerConstants; //导入依赖的package包/类
public void start() {
server = new Server();
server.setPort(port);
server.setNoSystemExit(true);
server.setDatabasePath(0, path);
server.setDatabaseName(0, name);
server.setErrWriter(new PrintWriter(System.out));
server.setLogWriter(new PrintWriter(System.out));
server.setSilent(true);
server.setTrace(false);
server.start();
int maxWait = 5000 * 2;
int currentWait = 0;
while (server.getState() != ServerConstants.SERVER_STATE_ONLINE) {
LOG.log(Level.INFO, "Starting hsqldb-server. State: " + server.getStateDescriptor());
LOG.log(Level.INFO, name);
LOG.log(Level.INFO, path);
LOG.log(Level.INFO, "Waiting 5 seconds ...");
try {
Thread.sleep(5000);
currentWait += 5000;
} catch (InterruptedException interrupt) {
LOG.log(Level.WARNING, "Start interrupted.", interrupt);
break;
}
if(currentWait >= maxWait) {
LOG.info("Giving up... ;-)");
break;
}
}
if(server.getState() == ServerConstants.SERVER_STATE_ONLINE) {
LOG.log(Level.INFO, "Started!");
}
}
开发者ID:KlausRicharz,项目名称:Foosball-League,代码行数:35,代码来源:HsqldbManager.java
示例4: setUp
import org.hsqldb.ServerConstants; //导入依赖的package包/类
public void setUp() throws SQLException {
switch (mode) {
case NET:
url = "jdbc:hsqldb:hsql://localhost:4808/test";
break;
case MEM:
url = "jdbc:hsqldb:mem:test;sql.enforce_strict_size=true";
server = new Server();
server.setDatabaseName(0, "test");
server.setDatabasePath(0, url);
server.setLogWriter(new PrintWriter(System.out));
server.setErrWriter(new PrintWriter(System.out));
server.setTrace(false);
server.setSilent(false);
server.start();
break;
case FILE:
url = "jdbc:hsqldb:file:test;sql.enforce_strict_size=true";
break;
}
// try {
// Class.forName(DRIVER_CLASS);
// } catch (Exception e) {
// e.printStackTrace();
// System.out.println(this + ".setUp() error: " + e.getMessage());
// }
// Thread.yield();
System.out.println(server.getState());
int waitCount = 0;
while (server.getState() != ServerConstants.SERVER_STATE_ONLINE
&& waitCount < 5) {
try {
waitCount++;
Thread.sleep(1);
} catch (InterruptedException e) {
}
}
createTables();
}
开发者ID:cscfa,项目名称:bartleby,代码行数:45,代码来源:DBAppenderHSQLTestFixture.java
注:本文中的org.hsqldb.ServerConstants类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论