servicemix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gno...@apache.org
Subject svn commit: r1134284 - /servicemix/smx4/specs/trunk/locator/src/main/java/org/apache/servicemix/specs/locator/OsgiLocator.java
Date Fri, 10 Jun 2011 11:54:43 GMT
Author: gnodet
Date: Fri Jun 10 11:54:43 2011
New Revision: 1134284

URL: http://svn.apache.org/viewvc?rev=1134284&view=rev
Log:
[SMX4-860] Add a configurable timeout

Modified:
    servicemix/smx4/specs/trunk/locator/src/main/java/org/apache/servicemix/specs/locator/OsgiLocator.java

Modified: servicemix/smx4/specs/trunk/locator/src/main/java/org/apache/servicemix/specs/locator/OsgiLocator.java
URL: http://svn.apache.org/viewvc/servicemix/smx4/specs/trunk/locator/src/main/java/org/apache/servicemix/specs/locator/OsgiLocator.java?rev=1134284&r1=1134283&r2=1134284&view=diff
==============================================================================
--- servicemix/smx4/specs/trunk/locator/src/main/java/org/apache/servicemix/specs/locator/OsgiLocator.java
(original)
+++ servicemix/smx4/specs/trunk/locator/src/main/java/org/apache/servicemix/specs/locator/OsgiLocator.java
Fri Jun 10 11:54:43 2011
@@ -26,6 +26,16 @@ import java.util.concurrent.locks.Reentr
 
 public class OsgiLocator {
 
+    private static long timeout = 5000l;
+    static {
+        try {
+            String prop = System.getProperty("org.apache.servicemix.specs.timeout");
+            if (prop != null) {
+                timeout = Long.parseLong(prop);
+            }
+        } catch (Throwable t) { }
+    }
+
     private static Map<String, List<Callable<Class>>> factories;
     
     private static ReadWriteLock lock = new ReentrantReadWriteLock();
@@ -73,7 +83,6 @@ public class OsgiLocator {
     }
 
     public static <T> Class<? extends T> locate(Class<T> factoryClass,
String factoryId) {
-        long timeout = 5000;
         long t0 = -1;
         long t1 = t0;
         while (t1 - t0 < timeout) {



Mime
View raw message