tomee-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rmannibu...@apache.org
Subject tomee git commit: making quartz optional when not used for simple main(String[])
Date Fri, 20 Feb 2015 16:37:59 GMT
Repository: tomee
Updated Branches:
  refs/heads/develop 27e36efa9 -> a89dae644


making quartz optional when not used for simple main(String[])


Project: http://git-wip-us.apache.org/repos/asf/tomee/repo
Commit: http://git-wip-us.apache.org/repos/asf/tomee/commit/a89dae64
Tree: http://git-wip-us.apache.org/repos/asf/tomee/tree/a89dae64
Diff: http://git-wip-us.apache.org/repos/asf/tomee/diff/a89dae64

Branch: refs/heads/develop
Commit: a89dae644bd3747287ff2e492a0b223aa258efff
Parents: 27e36ef
Author: Romain Manni-Bucau <rmannibucau@apache.org>
Authored: Fri Feb 20 17:37:48 2015 +0100
Committer: Romain Manni-Bucau <rmannibucau@apache.org>
Committed: Fri Feb 20 17:37:48 2015 +0100

----------------------------------------------------------------------
 .../openejb/assembler/classic/Assembler.java    | 30 ++++++++++++--------
 1 file changed, 18 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tomee/blob/a89dae64/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/Assembler.java
----------------------------------------------------------------------
diff --git a/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/Assembler.java
b/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/Assembler.java
index 3b5c656..9bc0cc0 100644
--- a/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/Assembler.java
+++ b/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/Assembler.java
@@ -1120,20 +1120,24 @@ public class Assembler extends AssemblerTool implements org.apache.openejb.spi.A
     }
 
     private void resumePersistentSchedulers(final AppContext appContext) {
-        final Scheduler globalScheduler = SystemInstance.get().getComponent(Scheduler.class);
-        final Collection<Scheduler> schedulers = new ArrayList<Scheduler>();
-        for (final BeanContext ejb : appContext.getBeanContexts()) {
-            final Scheduler scheduler = ejb.get(Scheduler.class);
-            if (scheduler == null || scheduler == globalScheduler || schedulers.contains(scheduler))
{
-                continue;
-            }
+        try { // if quartz is missing
+            final Scheduler globalScheduler = SystemInstance.get().getComponent(Scheduler.class);
+            final Collection<Scheduler> schedulers = new ArrayList<Scheduler>();
+            for (final BeanContext ejb : appContext.getBeanContexts()) {
+                final Scheduler scheduler = ejb.get(Scheduler.class);
+                if (scheduler == null || scheduler == globalScheduler || schedulers.contains(scheduler))
{
+                    continue;
+                }
 
-            schedulers.add(scheduler);
-            try {
-                scheduler.resumeAll();
-            } catch (final Exception e) {
-                logger.warning("Can't resume scheduler for " + ejb.getEjbName(), e);
+                schedulers.add(scheduler);
+                try {
+                    scheduler.resumeAll();
+                } catch (final Exception e) {
+                    logger.warning("Can't resume scheduler for " + ejb.getEjbName(), e);
+                }
             }
+        } catch (final NoClassDefFoundError ncdfe) {
+            // no-op
         }
     }
 
@@ -1533,6 +1537,8 @@ public class Assembler extends AssemblerTool implements org.apache.openejb.spi.A
                 EjbTimerServiceImpl.shutdown();
             } catch (final Exception e) {
                 logger.warning("Unable to shutdown scheduler", e);
+            } catch (final NoClassDefFoundError ncdfe) {
+                // no-op
             }
 
             logger.debug("Undeploying Applications");


Mime
View raw message