本文整理汇总了Java中org.apache.derby.jdbc.EmbeddedDataSource.setShutdownDatabase方法的典型用法代码示例。如果您正苦于以下问题:Java EmbeddedDataSource.setShutdownDatabase方法的具体用法?Java EmbeddedDataSource.setShutdownDatabase怎么用?Java EmbeddedDataSource.setShutdownDatabase使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.derby.jdbc.EmbeddedDataSource
的用法示例。
在下文中一共展示了EmbeddedDataSource.setShutdownDatabase方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: messageSent
import org.apache.derby.jdbc.EmbeddedDataSource; //导入方法依赖的package包/类
@Override
protected void messageSent() throws Exception {
verifyExpectedBroker(inflightMessageCount);
if (++inflightMessageCount == failureCount) {
LOG.info("STOPPING [email protected]!!!!");
final EmbeddedDataSource ds = ((SyncCreateDataSource) getExistingDataSource()).getDelegate();
ds.setShutdownDatabase("shutdown");
LOG.info("DB [email protected]!!!!");
Thread dbRestartThread = new Thread("db-re-start-thread") {
@Override
public void run() {
delayTillRestartRequired();
ds.setShutdownDatabase("false");
LOG.info("DB [email protected]!!!!");
}
};
dbRestartThread.start();
}
verifyExpectedBroker(inflightMessageCount);
}
示例2: stopDerby
import org.apache.derby.jdbc.EmbeddedDataSource; //导入方法依赖的package包/类
private void stopDerby() {
LOG.info("STOPPING [email protected]!!!!");
final EmbeddedDataSource ds = dataSource;
try {
ds.setShutdownDatabase("shutdown");
ds.getConnection();
} catch (Exception ignored) {
}
}
示例3: messageSent
import org.apache.derby.jdbc.EmbeddedDataSource; //导入方法依赖的package包/类
@Override
protected void messageSent() throws Exception {
if (++inflightMessageCount == failureCount) {
LOG.info("STOPPING [email protected]!!!!");
final EmbeddedDataSource ds = sharedDs;
ds.setShutdownDatabase("shutdown");
try {
ds.getConnection();
} catch (Exception ignored) {
}
LOG.info("DB [email protected]!!!!");
Thread dbRestartThread = new Thread("db-re-start-thread") {
@Override
public void run() {
LOG.info("Sleeping for 10 seconds before allowing db restart");
try {
restartDBLatch.await(10, TimeUnit.SECONDS);
} catch (InterruptedException e) {
e.printStackTrace();
}
ds.setShutdownDatabase("false");
LOG.info("DB [email protected]!!!!");
}
};
dbRestartThread.start();
}
}