ode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sean...@apache.org
Subject svn commit: r783964 - /ode/branches/APACHE_ODE_1.X/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/cron/CronScheduler.java
Date Fri, 12 Jun 2009 00:58:59 GMT
Author: seanahn
Date: Fri Jun 12 00:58:59 2009
New Revision: 783964

URL: http://svn.apache.org/viewvc?rev=783964&view=rev
Log:
seems tests sometimes fail without cleaning up the listeners array

Modified:
    ode/branches/APACHE_ODE_1.X/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/cron/CronScheduler.java

Modified: ode/branches/APACHE_ODE_1.X/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/cron/CronScheduler.java
URL: http://svn.apache.org/viewvc/ode/branches/APACHE_ODE_1.X/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/cron/CronScheduler.java?rev=783964&r1=783963&r2=783964&view=diff
==============================================================================
--- ode/branches/APACHE_ODE_1.X/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/cron/CronScheduler.java
(original)
+++ ode/branches/APACHE_ODE_1.X/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/cron/CronScheduler.java
Fri Jun 12 00:58:59 2009
@@ -54,6 +54,18 @@
     public void shutdown() {
         _shuttingDown = true;
         _schedulerTimer.cancel();
+
+        for( TerminationListener listener : _systemTerminationListeners ) {
+            listener.terminate();
+        }
+        _systemTerminationListeners.clear();
+
+        for( Collection<TerminationListener> listeners : _terminationListenersByPid.values()
) {
+            for( TerminationListener listener : listeners ) {
+                listener.terminate();
+            }
+        }
+        _terminationListenersByPid.clear();
     }
     
     public void cancelProcessCronJobs(QName pid, boolean undeployed) {
@@ -66,6 +78,7 @@
             Collection<TerminationListener> listeners = _terminationListenersByPid.get(pid);
             if( listeners != null ) {
                 listenersToTerminate.addAll(listeners);
+                listeners.clear();
             }
             if( undeployed ) {
                 _terminationListenersByPid.remove(pid);



Mime
View raw message