X-Git-Url: http://git.argeo.org/?a=blobdiff_plain;f=base%2Fruntime%2Forg.argeo.osgi.boot%2Fsrc%2Fmain%2Fjava%2Forg%2Fargeo%2Fosgi%2Fboot%2FOsgiBoot.java;h=300ebb82dd48ba2802b3328cd832fd3a3dc1dbbe;hb=3a3d316af102ba410d1d9e6de349d0c8f7ac044f;hp=8d07219dfb9d29cbcc8662d16b0055822bc60282;hpb=f40fc2eb2a212596df7a2855684f43d0204504d5;p=lgpl%2Fargeo-commons.git diff --git a/base/runtime/org.argeo.osgi.boot/src/main/java/org/argeo/osgi/boot/OsgiBoot.java b/base/runtime/org.argeo.osgi.boot/src/main/java/org/argeo/osgi/boot/OsgiBoot.java index 8d07219df..300ebb82d 100644 --- a/base/runtime/org.argeo.osgi.boot/src/main/java/org/argeo/osgi/boot/OsgiBoot.java +++ b/base/runtime/org.argeo.osgi.boot/src/main/java/org/argeo/osgi/boot/OsgiBoot.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2007-2012 Mathieu Baudier + * Copyright (C) 2007-2012 Argeo GmbH * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -274,9 +274,9 @@ public class OsgiBoot { public void startBundles() { // default and active start levels from System properties Integer defaultStartLevel = new Integer(Integer.parseInt(OsgiBootUtils - .getProperty(PROP_OSGI_BUNDLES_DEFAULTSTARTLEVEL))); - Integer activeStartLevel = new Integer( - OsgiBootUtils.getProperty(PROP_OSGI_STARTLEVEL)); + .getProperty(PROP_OSGI_BUNDLES_DEFAULTSTARTLEVEL, "4"))); + Integer activeStartLevel = new Integer(OsgiBootUtils.getProperty( + PROP_OSGI_STARTLEVEL, "6")); SortedMap/* > */startLevels = new TreeMap(); computeStartLevels(startLevels, System.getProperties(), @@ -414,11 +414,12 @@ public class OsgiBoot { // monitors that all bundles are started long beginMonitor = System.currentTimeMillis(); - boolean allStarted = false; + boolean allStarted = !(startedBundles.size() > 0); List/* */notStarted = new ArrayList(); - while (allStarted - && (System.currentTimeMillis() - beginMonitor) > defaultTimeout) { + while (!allStarted + && (System.currentTimeMillis() - beginMonitor) < defaultTimeout) { notStarted = new ArrayList(); + allStarted = true; for (int i = 0; i < startedBundles.size(); i++) { Bundle bundle = (Bundle) startedBundles.get(i); // TODO check behaviour of lazs bundles @@ -516,7 +517,7 @@ public class OsgiBoot { int currentState = bundle.getState(); while (!(currentState == Bundle.RESOLVED || currentState == Bundle.ACTIVE)) { long now = System.currentTimeMillis(); - if ((now - startBegin) > defaultTimeout) + if ((now - startBegin) > defaultTimeout * 10) throw new Exception("Bundle " + bundle.getSymbolicName() + " was not RESOLVED or ACTIVE after " + (now - startBegin) + "ms (originalState=" @@ -848,15 +849,15 @@ public class OsgiBoot { /** Creates an URL from a location */ protected String locationToUrl(String baseUrl, String location) { - int extInd = location.lastIndexOf('.'); - String ext = null; - if (extInd > 0) - ext = location.substring(extInd); - - if (baseUrl.startsWith("reference:") && ".jar".equals(ext)) - return "file:" + location; - else - return baseUrl + location; + // int extInd = location.lastIndexOf('.'); + // String ext = null; + // if (extInd > 0) + // ext = location.substring(extInd); + // + // if (baseUrl.startsWith("reference:") && ".jar".equals(ext)) + // return "file:" + location; + // else + return baseUrl + location; } /** Transforms a relative path in a full system path. */