cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cschnei...@apache.org
Subject cxf-dosgi git commit: [DOSGI-221] Make getHttpService wait to avoid returning null
Date Wed, 08 Jul 2015 07:07:35 GMT
Repository: cxf-dosgi
Updated Branches:
  refs/heads/master 828c950a5 -> fc700c600


[DOSGI-221] Make getHttpService wait to avoid returning null


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

Branch: refs/heads/master
Commit: fc700c600208627b0e90a77bd8913fbaf3897301
Parents: 828c950
Author: Christian Schneider <chris@die-schneider.net>
Authored: Wed Jul 8 09:07:22 2015 +0200
Committer: Christian Schneider <chris@die-schneider.net>
Committed: Wed Jul 8 09:07:22 2015 +0200

----------------------------------------------------------------------
 .../apache/cxf/dosgi/dsw/handlers/HttpServiceManager.java    | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/fc700c60/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/HttpServiceManager.java
----------------------------------------------------------------------
diff --git a/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/HttpServiceManager.java
b/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/HttpServiceManager.java
index d55f7c1..1d2ec62 100644
--- a/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/HttpServiceManager.java
+++ b/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/HttpServiceManager.java
@@ -43,6 +43,7 @@ import org.slf4j.LoggerFactory;
 public class HttpServiceManager {
 
     private static final Logger LOG = LoggerFactory.getLogger(HttpServiceManager.class);
+    private static final long SERVICE_LOOKUP_TIMEOUT = 100000;
     private ServiceTracker tracker;
     private BundleContext bundleContext;
     private Map<Long, String> exportedAliases = Collections.synchronizedMap(new HashMap<Long,
String>());
@@ -88,7 +89,12 @@ public class HttpServiceManager {
     }
 
     protected HttpService getHttpService() {
-        Object service = tracker.getService();
+        Object service = null;
+        try {
+            service = tracker.waitForService(120000);
+        } catch (InterruptedException ex) {
+            LOG.warn("waitForService interrupeted", ex);
+        }
         if (service == null) {
             throw new RuntimeException("No HTTPService found");
         }


Mime
View raw message