karaf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbono...@apache.org
Subject [1/2] karaf git commit: [KARAF-5055] Use karaf shutdown timeout when notifying the service wrapper in Main
Date Thu, 23 Mar 2017 14:18:29 GMT
Repository: karaf
Updated Branches:
  refs/heads/master ac9bcf48d -> 64d2ef60a


[KARAF-5055] Use karaf shutdown timeout when notifying the service wrapper in Main


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

Branch: refs/heads/master
Commit: e5f4f5c4852b3b825bdfe411665c37721ba921fb
Parents: ac9bcf4
Author: jpoth <poth.john@gmail.com>
Authored: Wed Mar 22 13:43:08 2017 +0100
Committer: Jean-Baptiste Onofré <jbonofre@apache.org>
Committed: Thu Mar 23 14:38:19 2017 +0100

----------------------------------------------------------------------
 .../src/main/java/org/apache/karaf/main/Main.java | 18 +++++++-----------
 1 file changed, 7 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/karaf/blob/e5f4f5c4/main/src/main/java/org/apache/karaf/main/Main.java
----------------------------------------------------------------------
diff --git a/main/src/main/java/org/apache/karaf/main/Main.java b/main/src/main/java/org/apache/karaf/main/Main.java
index 685677e..ea82f31 100644
--- a/main/src/main/java/org/apache/karaf/main/Main.java
+++ b/main/src/main/java/org/apache/karaf/main/Main.java
@@ -638,11 +638,13 @@ public class Main {
             return true;
         }
         try {
-            int step = 5000;
-
-            // Notify the callback asap
+            int timeout = config.shutdownTimeout;
+            if (config.shutdownTimeout <= 0) {
+                timeout = Integer.MAX_VALUE;
+            }
+            
             if (shutdownCallback != null) {
-                shutdownCallback.waitingForShutdown(step);
+                shutdownCallback.waitingForShutdown(timeout);
             }
 
             exiting = true;
@@ -659,15 +661,9 @@ public class Main {
                 }.start();
             }
 
-            int timeout = config.shutdownTimeout;
-            if (config.shutdownTimeout <= 0) {
-                timeout = Integer.MAX_VALUE;
-            }
+            int step = 5000;      
             while (timeout > 0) {
                 timeout -= step;
-                if (shutdownCallback != null) {
-                    shutdownCallback.waitingForShutdown(step * 2);
-                }
                 FrameworkEvent event = framework.waitForStop(step);
                 if (event.getType() != FrameworkEvent.WAIT_TIMEDOUT) {
                     if (activatorManager != null) {


Mime
View raw message