Nachtrag zu 324: Beim Runterfahren eine Pause eingeführt, um das Beendet von Hintergrundprozessen abzuwarten.
git-svn-id: https://svn.libreccm.org/ccm/trunk@325 8810af33-2d31-482b-a856-94f89814c4dfmaster
parent
3342f0dd18
commit
4366671f9c
|
|
@ -83,8 +83,8 @@ public class QueueManager implements Runnable {
|
||||||
static Integer s_maximumFailCount = new Integer(-1);
|
static Integer s_maximumFailCount = new Integer(-1);
|
||||||
|
|
||||||
// Following true if should keep watching queue
|
// Following true if should keep watching queue
|
||||||
|
|
||||||
static private boolean s_keepWatchingQueue = true;
|
static private boolean s_keepWatchingQueue = true;
|
||||||
|
|
||||||
static private Thread s_queueThread = null;
|
static private Thread s_queueThread = null;
|
||||||
|
|
||||||
// Class implementing methods run when publishing or unpublishing to file.
|
// Class implementing methods run when publishing or unpublishing to file.
|
||||||
|
|
@ -462,10 +462,6 @@ public class QueueManager implements Runnable {
|
||||||
s_log.info("Sending signal to stop queue processing.");
|
s_log.info("Sending signal to stop queue processing.");
|
||||||
}
|
}
|
||||||
s_keepWatchingQueue = false;
|
s_keepWatchingQueue = false;
|
||||||
|
|
||||||
s_log.debug("Going to sleep.");
|
|
||||||
sleep(45);
|
|
||||||
s_log.debug("Resume processing.");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -177,7 +177,7 @@ public class CompoundInitializer implements Initializer {
|
||||||
m_log.info("Closing " + init.getClass() +
|
m_log.info("Closing " + init.getClass() +
|
||||||
" (" + i + " out of " + m_inits.size() + ")");
|
" (" + i + " out of " + m_inits.size() + ")");
|
||||||
}
|
}
|
||||||
init.close(null);
|
init.close(evt);
|
||||||
}
|
}
|
||||||
s_log.info("CompoundInitializer.close(ContextCloseEvent) completed");
|
s_log.info("CompoundInitializer.close(ContextCloseEvent) completed");
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -279,12 +279,6 @@ public class Runtime extends CompoundInitializer {
|
||||||
|
|
||||||
s_log.info("Shutting down WAF runtime using defaults");
|
s_log.info("Shutting down WAF runtime using defaults");
|
||||||
|
|
||||||
// DbHelper.setDatabase
|
|
||||||
// (DbHelper.getDatabaseFromURL(RuntimeConfig.
|
|
||||||
// getConfig().getJDBCURL()));
|
|
||||||
// s_log.info("Going to collect list of Initializers.");
|
|
||||||
// addRuntimeInitializers();
|
|
||||||
|
|
||||||
s_log.debug("Going to execute MetadataRoot.getMetadataRoot().");
|
s_log.debug("Going to execute MetadataRoot.getMetadataRoot().");
|
||||||
final MetadataRoot root = MetadataRoot.getMetadataRoot();
|
final MetadataRoot root = MetadataRoot.getMetadataRoot();
|
||||||
// XXX It shouldn't be necessary to do this until the legacy
|
// XXX It shouldn't be necessary to do this until the legacy
|
||||||
|
|
@ -293,7 +287,7 @@ public class Runtime extends CompoundInitializer {
|
||||||
s_log.debug("Going to execute session().");
|
s_log.debug("Going to execute session().");
|
||||||
final Session session = session("default", root);
|
final Session session = session("default", root);
|
||||||
|
|
||||||
s_log.info("Going to execute shutdown worker method.");
|
s_log.debug("Going to execute shutdown worker method.");
|
||||||
shutdown(session, this, evt);
|
shutdown(session, this, evt);
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -318,21 +312,22 @@ public class Runtime extends CompoundInitializer {
|
||||||
Assert.exists(session, Session.class);
|
Assert.exists(session, Session.class);
|
||||||
Assert.exists(init, Initializer.class);
|
Assert.exists(init, Initializer.class);
|
||||||
|
|
||||||
// s_hasRun = true;
|
|
||||||
if (s_hasRun == true) {
|
if (s_hasRun == true) {
|
||||||
|
|
||||||
// final PDLCompiler compiler = new PDLCompiler();
|
|
||||||
final MetadataRoot root = session.getMetadataRoot();
|
final MetadataRoot root = session.getMetadataRoot();
|
||||||
|
|
||||||
Assert.exists(root, MetadataRoot.class);
|
Assert.exists(root, MetadataRoot.class);
|
||||||
|
|
||||||
// init.init(new DataInitEvent(compiler));
|
s_log.debug("Going to call CompoundInitializer.close()");
|
||||||
// compiler.emit(root);
|
|
||||||
// init.init(new DomainInitEvent(new DomainObjectFactory()));
|
|
||||||
// init.init(new LegacyInitEvent(session));
|
|
||||||
|
|
||||||
s_log.info("Going to call CompoundInitializer.destroy()");
|
|
||||||
init.close(evt);
|
init.close(evt);
|
||||||
|
|
||||||
|
// Pausieren von ca. 1 Min. / 60 sek. um das Ende von laufenden Threads
|
||||||
|
// abzuwarten.
|
||||||
|
s_log.info("Waiting for background threads to terminate");
|
||||||
|
try {
|
||||||
|
Thread.currentThread().sleep(60000);
|
||||||
|
} catch( InterruptedException e) {
|
||||||
|
// do nothing
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
s_log.warn("Shutdown must only be run AFTER startup. Skipped.");
|
s_log.warn("Shutdown must only be run AFTER startup. Skipped.");
|
||||||
}
|
}
|
||||||
|
|
@ -370,14 +365,14 @@ public class Runtime extends CompoundInitializer {
|
||||||
|
|
||||||
Collection names = getRuntimeInitializerNames();
|
Collection names = getRuntimeInitializerNames();
|
||||||
|
|
||||||
s_log.info("Converting DataCollection names to StringArray inits. ");
|
s_log.debug("Converting DataCollection names to StringArray inits. ");
|
||||||
String[] inits = (String[]) names.toArray(new String[0]);
|
String[] inits = (String[]) names.toArray(new String[0]);
|
||||||
s_log.info("Create MetadataRoot mroot. ");
|
s_log.debug("Create MetadataRoot mroot. ");
|
||||||
MetadataRoot mroot = root();
|
MetadataRoot mroot = root();
|
||||||
s_log.info("Going to sort Stringarray inits. ");
|
s_log.debug("Going to sort Stringarray inits. ");
|
||||||
sort(inits, session("initializer", mroot), mroot);
|
sort(inits, session("initializer", mroot), mroot);
|
||||||
|
|
||||||
s_log.info("Going to process StringArray inits.");
|
s_log.debug("Going to process StringArray inits.");
|
||||||
for (int i = 0; i < inits.length; i++) {
|
for (int i = 0; i < inits.length; i++) {
|
||||||
if (s_log.isDebugEnabled()) {
|
if (s_log.isDebugEnabled()) {
|
||||||
s_log.debug("adding: " + inits[i]);
|
s_log.debug("adding: " + inits[i]);
|
||||||
|
|
@ -387,10 +382,10 @@ public class Runtime extends CompoundInitializer {
|
||||||
add((Initializer) Classes.newInstance(inits[i]));
|
add((Initializer) Classes.newInstance(inits[i]));
|
||||||
}
|
}
|
||||||
|
|
||||||
s_log.info("Going to call addWafInitializer()");
|
s_log.debug("Going to call addWafInitializer()");
|
||||||
addWafInitializer();
|
addWafInitializer();
|
||||||
|
|
||||||
s_log.info("Method addRuntimeInitializers completed.");
|
s_log.debug("Method addRuntimeInitializers completed.");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue