[HER-1607] handle persist state when crawl starts up

* BdbModule.java
    fail-fast if not started properly; stop with fewer errors in problem situations
* CrawlController.java
    continue past runtimeException on stop
* CrawlJob.java
    less redundant error-reporting
* AbstractFrontier.java
    consider PAUSE or FINISH valid targets after unexpected exception 
* StatisticsTracker.java
    avoid promoting runtimeException in report-generating up
* PersistOnlineProcessor.java
    delegate DB-closing to BdbModule to avoid double-close
This commit is contained in:
gojomo committed 2009-09-11 02:26:04 +00:00
1 parent d5e088ed6a
commit 163dcb7826
6 files changed
+34 -20

No files matched your search

@@ -181,7 +181,7 @@ Serializable, Closeable {
}
protected ConfigPath dir = new ConfigPath("state subdirectory","state");
protected ConfigPath dir = new ConfigPath("bdbmodule subdirectory","state");
public ConfigPath getDir() {
return dir;
}
@@ -315,7 +315,12 @@ Serializable, Closeable {
public Database openDatabase(String name, BdbConfig config,
boolean recycle)
throws DatabaseException {
throws DatabaseException {
if(!isRunning()) {
// proper initialization hasn't occurred
throw new IllegalStateException(
"BdbModule not started; as a Lifecycle bean it must not be an inner bean.");
}
if (databases.containsKey(name)) {
throw new IllegalStateException("Database already exists: " +name);
}
@@ -584,8 +589,10 @@ Serializable, Closeable {
public void close() {
close2();
Runtime.getRuntime().removeShutdownHook(shutdownHook);
shutdownHook = null;
if(shutdownHook!=null) {
Runtime.getRuntime().removeShutdownHook(shutdownHook);
shutdownHook = null;
}
}
@SuppressWarnings("unchecked")