Skip to content

Commit

Permalink
fault tolerant if scheduler should not start for some odd reason
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelwechner committed Jul 16, 2012
1 parent 65b4d70 commit 581bdfb
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/webapp/src/java/org/wyona/yanel/servlet/YanelServlet.java
Expand Up @@ -237,10 +237,11 @@ public void init(ServletConfig config) throws ServletException {
}

if (yanelInstance.isSchedulerEnabled()) {
log.warn("Startup scheduler ...");
scheduler = StdSchedulerFactory.getDefaultScheduler();
try {
log.warn("DEBUG: Startup scheduler ...");
scheduler = StdSchedulerFactory.getDefaultScheduler();

Realm[] realms = yanelInstance.getRealmConfiguration().getRealms();
Realm[] realms = yanelInstance.getRealmConfiguration().getRealms();
for (int i = 0; i < realms.length; i++) {
if (realms[i] instanceof org.wyona.yanel.core.map.RealmWithConfigurationExceptionImpl) {
String eMessage = ((org.wyona.yanel.core.map.RealmWithConfigurationExceptionImpl) realms[i]).getConfigurationException().getMessage();
Expand All @@ -267,7 +268,12 @@ public void init(ServletConfig config) throws ServletException {
scheduler.scheduleJob(jobDetail, trigger);
*/

scheduler.start();
scheduler.start();
} catch(Exception e) {
log.error(e, e); // INFO: Let's be fault tolerant in case the scheduler should not start
}
} else {
log.info("The scheduler is currently disabled.");
}
} catch (Exception e) {
log.error(e.getMessage(), e);
Expand Down

0 comments on commit 581bdfb

Please sign in to comment.