You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@karaf.apache.org by jb...@apache.org on 2015/06/25 12:43:46 UTC

[1/2] karaf git commit: don't wait for services for default url handler protocols

Repository: karaf
Updated Branches:
  refs/heads/karaf-3.0.x 42a081d34 -> 399ad55e7


don't wait for services for default url handler protocols

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

Branch: refs/heads/karaf-3.0.x
Commit: cfa88a01d09ab226704d5f7842fca28f8530fc05
Parents: c5bd09e
Author: Phillip Balli <pb...@cisco.com>
Authored: Thu Apr 3 17:24:14 2014 -0500
Committer: Phillip Balli <pb...@cisco.com>
Committed: Thu Apr 3 17:24:14 2014 -0500

----------------------------------------------------------------------
 .../karaf/features/internal/BundleManager.java  | 31 +++++++++++---------
 1 file changed, 17 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/karaf/blob/cfa88a01/features/core/src/main/java/org/apache/karaf/features/internal/BundleManager.java
----------------------------------------------------------------------
diff --git a/features/core/src/main/java/org/apache/karaf/features/internal/BundleManager.java b/features/core/src/main/java/org/apache/karaf/features/internal/BundleManager.java
index cd744f0..25a5884 100644
--- a/features/core/src/main/java/org/apache/karaf/features/internal/BundleManager.java
+++ b/features/core/src/main/java/org/apache/karaf/features/internal/BundleManager.java
@@ -67,6 +67,7 @@ public class BundleManager {
     private final BundleContext bundleContext;
     private final RegionsPersistence regionsPersistence;
     private final long refreshTimeout;
+    private List<String> defaultProtocols = Arrays.asList("http", "https", "ftp", "file", "jar");
 
     public BundleManager(BundleContext bundleContext) {
         this(bundleContext, null);
@@ -195,22 +196,24 @@ public class BundleManager {
      * @param protocol
      */
     private void waitForUrlHandler(String protocol) {
-        try {
-            Filter filter = bundleContext.createFilter("(&(" + Constants.OBJECTCLASS + "=" + URLStreamHandlerService.class.getName() + ")(url.handler.protocol=" + protocol + "))");
-            if (filter == null) {
-                return;
-            }
-            ServiceTracker<URLStreamHandlerService, URLStreamHandlerService> urlHandlerTracker = new ServiceTracker<URLStreamHandlerService, URLStreamHandlerService>(bundleContext, filter, null);
+        if (!defaultProtocols.contains(protocol)) {
             try {
-                urlHandlerTracker.open();
-                urlHandlerTracker.waitForService(30000);
-            } catch (InterruptedException e) {
-                LOGGER.debug("Interrupted while waiting for URL handler for protocol {}.", protocol);
-            } finally {
-                urlHandlerTracker.close();
+                Filter filter = bundleContext.createFilter("(&(" + Constants.OBJECTCLASS + "=" + URLStreamHandlerService.class.getName() + ")(url.handler.protocol=" + protocol + "))");
+                if (filter == null) {
+                    return;
+                }
+                ServiceTracker<URLStreamHandlerService, URLStreamHandlerService> urlHandlerTracker = new ServiceTracker<URLStreamHandlerService, URLStreamHandlerService>(bundleContext, filter, null);
+                try {
+                    urlHandlerTracker.open();
+                    urlHandlerTracker.waitForService(30000);
+                } catch (InterruptedException e) {
+                    LOGGER.debug("Interrupted while waiting for URL handler for protocol {}.", protocol);
+                } finally {
+                    urlHandlerTracker.close();
+                }
+            } catch (Exception ex) {
+                LOGGER.error("Error creating service tracker.", ex);
             }
-        } catch (Exception ex) {
-            LOGGER.error("Error creating service tracker.", ex);
         }
     }
 


[2/2] karaf git commit: Merge branch 'karaf-3.0.x' of https://github.com/entropydown/karaf into karaf-3.0.x

Posted by jb...@apache.org.
Merge branch 'karaf-3.0.x' of https://github.com/entropydown/karaf into karaf-3.0.x


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

Branch: refs/heads/karaf-3.0.x
Commit: 399ad55e7f9100e7dbbba7c21102bceea4b94b22
Parents: 42a081d cfa88a0
Author: Jean-Baptiste Onofré <jb...@apache.org>
Authored: Thu Jun 25 11:04:16 2015 +0200
Committer: Jean-Baptiste Onofré <jb...@apache.org>
Committed: Thu Jun 25 11:04:16 2015 +0200

----------------------------------------------------------------------
 .../karaf/features/internal/BundleManager.java  | 31 +++++++++++---------
 1 file changed, 17 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/karaf/blob/399ad55e/features/core/src/main/java/org/apache/karaf/features/internal/BundleManager.java
----------------------------------------------------------------------