diff options
Diffstat (limited to 'bundles')
2 files changed, 18 insertions, 4 deletions
diff --git a/bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/framework/internal/core/AbstractBundle.java b/bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/framework/internal/core/AbstractBundle.java index 5f99fe9f2..d2a784926 100644 --- a/bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/framework/internal/core/AbstractBundle.java +++ b/bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/framework/internal/core/AbstractBundle.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2003, 2010 IBM Corporation and others. + * Copyright (c) 2003, 2011 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -39,6 +39,19 @@ import org.osgi.framework.wiring.BundleWiring; * This class is abstract and is extended by BundleHost and BundleFragment. */ public abstract class AbstractBundle implements Bundle, Comparable<Bundle>, KeyedElement, BundleStartLevel, BundleReference { + private final static long STATE_CHANGE_TIMEOUT; + static { + long stateChangeWait = 5000; + try { + String prop = FrameworkProperties.getProperty("equinox.statechange.timeout"); //$NON-NLS-1$ + if (prop != null) + stateChangeWait = Long.parseLong(prop); + } catch (Throwable t) { + // use default 5000 + stateChangeWait = 5000; + } + STATE_CHANGE_TIMEOUT = stateChangeWait; + } /** The Framework this bundle is part of */ protected final Framework framework; /** The state of the bundle. */ @@ -1080,7 +1093,7 @@ public abstract class AbstractBundle implements Bundle, Comparable<Bundle>, Keye Debug.println(" Waiting for state to change in bundle " + this); //$NON-NLS-1$ start = System.currentTimeMillis(); } - statechangeLock.wait(5000); + statechangeLock.wait(STATE_CHANGE_TIMEOUT); /* * wait for other thread to * finish changing state diff --git a/bundles/org.eclipse.osgi/eclipseAdaptor/src/org/eclipse/core/runtime/internal/adaptor/EclipseLazyStarter.java b/bundles/org.eclipse.osgi/eclipseAdaptor/src/org/eclipse/core/runtime/internal/adaptor/EclipseLazyStarter.java index 6254a230e..727f73c14 100644 --- a/bundles/org.eclipse.osgi/eclipseAdaptor/src/org/eclipse/core/runtime/internal/adaptor/EclipseLazyStarter.java +++ b/bundles/org.eclipse.osgi/eclipseAdaptor/src/org/eclipse/core/runtime/internal/adaptor/EclipseLazyStarter.java @@ -100,7 +100,8 @@ public class EclipseLazyStarter implements ClassLoadingStatsHook, AdaptorHook, H // The bundle must be started. // Note that another thread may already be starting this bundle; - // In this case we will timeout after 5 seconds and record the BundleException + // In this case we will timeout after a default of 5 seconds and record the BundleException + long startTime = System.currentTimeMillis(); try { // do not persist the start of this bundle managers[i].getBaseClassLoader().getDelegate().setLazyTrigger(); @@ -111,7 +112,7 @@ public class EclipseLazyStarter implements ClassLoadingStatsHook, AdaptorHook, H StatusException status = (StatusException) cause; if ((status.getStatusCode() & StatusException.CODE_ERROR) == 0) { if (status.getStatus() instanceof Thread) { - String message = NLS.bind(EclipseAdaptorMsg.ECLIPSE_CLASSLOADER_CONCURRENT_STARTUP, new Object[] {Thread.currentThread(), name, status.getStatus(), bundle, new Integer(5000)}); + String message = NLS.bind(EclipseAdaptorMsg.ECLIPSE_CLASSLOADER_CONCURRENT_STARTUP, new Object[] {Thread.currentThread(), name, status.getStatus(), bundle, new Long(System.currentTimeMillis() - startTime)}); adaptor.getFrameworkLog().log(new FrameworkLogEntry(FrameworkAdaptor.FRAMEWORK_SYMBOLICNAME, FrameworkLogEntry.WARNING, 0, message, 0, e, null)); } continue; |