karaf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbono...@apache.org
Subject karaf git commit: [KARAF-5055] Use karaf shutdown timeout when notifying the service wrapper in Main
Date Thu, 23 Mar 2017 14:20:00 GMT
Repository: karaf
Updated Branches:
  refs/heads/karaf-4.0.x ba028a16a -> 3293f91b6


[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/3293f91b
Tree: http://git-wip-us.apache.org/repos/asf/karaf/tree/3293f91b
Diff: http://git-wip-us.apache.org/repos/asf/karaf/diff/3293f91b

Branch: refs/heads/karaf-4.0.x
Commit: 3293f91b63f6abf30d2867972b3e5f075c24f3fe
Parents: ba028a1
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 15:19:53 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/3293f91b/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 2921368..48dcb5b 100644
--- a/main/src/main/java/org/apache/karaf/main/Main.java
+++ b/main/src/main/java/org/apache/karaf/main/Main.java
@@ -603,11 +603,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;
@@ -624,15 +626,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) {
                     activatorManager.stopKarafActivators();


Mime
View raw message