Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 142960 Details for
Bug 246406
[performance][api] Timeout waiting when loading SystemPreferencesManager$ModelChangeListener during startup
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Patch finally fixing the issue
bug246406_timeout.diff.txt (text/plain), 11.69 KB, created by
Martin Oberhuber
on 2009-07-29 19:59:32 EDT
(
hide
)
Description:
Patch finally fixing the issue
Filename:
MIME Type:
Creator:
Martin Oberhuber
Created:
2009-07-29 19:59:32 EDT
Size:
11.69 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.rse.core-feature >Index: feature.xml >=================================================================== >RCS file: /cvsroot/dsdp/org.eclipse.tm.rse/features/org.eclipse.rse.core-feature/feature.xml,v >retrieving revision 1.37 >diff -u -r1.37 feature.xml >--- feature.xml 14 May 2009 08:14:42 -0000 1.37 >+++ feature.xml 29 Jul 2009 23:59:18 -0000 >@@ -1,5 +1,5 @@ > <?xml version="1.0" encoding="UTF-8"?> <!-- >- Copyright (c) 2005, 2008 IBM Corporation and others. >+ Copyright (c) 2005, 2009 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 >@@ -12,7 +12,7 @@ > <feature > id="org.eclipse.rse.core" > label="%featureName" >- version="3.1.0.qualifier" >+ version="3.1.1.qualifier" > provider-name="%providerName" > plugin="org.eclipse.rse.core"> > >#P org.eclipse.rse.ui >Index: META-INF/MANIFEST.MF >=================================================================== >RCS file: /cvsroot/dsdp/org.eclipse.tm.rse/plugins/org.eclipse.rse.ui/META-INF/MANIFEST.MF,v >retrieving revision 1.39 >diff -u -r1.39 MANIFEST.MF >--- META-INF/MANIFEST.MF 29 Sep 2008 18:41:06 -0000 1.39 >+++ META-INF/MANIFEST.MF 29 Jul 2009 23:59:20 -0000 >@@ -2,7 +2,7 @@ > Bundle-ManifestVersion: 2 > Bundle-Name: %pluginName > Bundle-SymbolicName: org.eclipse.rse.ui;singleton:=true >-Bundle-Version: 3.1.0.qualifier >+Bundle-Version: 3.1.1.qualifier > Bundle-Activator: org.eclipse.rse.ui.RSEUIPlugin > Bundle-Localization: plugin > Require-Bundle: org.eclipse.core.runtime, >Index: UI/org/eclipse/rse/ui/SystemPreferencesManager.java >=================================================================== >RCS file: /cvsroot/dsdp/org.eclipse.tm.rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/SystemPreferencesManager.java,v >retrieving revision 1.13 >diff -u -r1.13 SystemPreferencesManager.java >--- UI/org/eclipse/rse/ui/SystemPreferencesManager.java 18 Aug 2008 20:40:24 -0000 1.13 >+++ UI/org/eclipse/rse/ui/SystemPreferencesManager.java 29 Jul 2009 23:59:20 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************** >- * Copyright (c) 2000, 2008 IBM Corporation. All rights reserved. >+ * Copyright (c) 2000, 2009 IBM Corporation. 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 http://www.eclipse.org/legal/epl-v10.html >@@ -18,17 +18,14 @@ > * David McKnight (IBM) - [237300] Problem with setDefaultHistory for SystemHistoryCombo. > * David McKnight (IBM) - [240991] RSE startup creates display on worker thread before workbench. > * David McKnight (IBM) - [240991] Avoiding calling SystemBasePluging.getWorkbench() >+ * Martin Oberhuber (Wind River) - [246406] Timeout waiting when loading RSE > ********************************************************************************/ > package org.eclipse.rse.ui; > > import java.util.ArrayList; > import java.util.List; > >-import org.eclipse.core.runtime.IProgressMonitor; >-import org.eclipse.core.runtime.IStatus; > import org.eclipse.core.runtime.Preferences; >-import org.eclipse.core.runtime.Status; >-import org.eclipse.core.runtime.jobs.Job; > import org.eclipse.rse.core.IRSEPreferenceNames; > import org.eclipse.rse.core.RSECorePlugin; > import org.eclipse.rse.core.events.ISystemModelChangeEvent; >@@ -39,8 +36,10 @@ > import org.eclipse.rse.core.events.ISystemResourceChangeListener; > import org.eclipse.rse.core.model.IHost; > import org.eclipse.rse.core.model.ISystemRegistry; >-import org.eclipse.ui.IWorkbench; >-import org.eclipse.ui.PlatformUI; >+import org.osgi.framework.Bundle; >+import org.osgi.framework.BundleContext; >+import org.osgi.framework.BundleEvent; >+import org.osgi.framework.BundleListener; > > /** > * A utility class that encapsulates all global preferences for the remote system framework >@@ -493,28 +492,26 @@ > > if (!alreadyListening) { > // FIXME bug 240991: With the current workaround, we might miss events >- // Instead of adding the listener deferred in a job, the SystemRegistry >+ // Instead of adding the listener deferred, the SystemRegistry > // should send events via the IRSEInteractionProvider >- Job addListenerJob = new Job("Add Listener"){ //$NON-NLS-1$ >- public IStatus run(IProgressMonitor monitor){ >- while (!PlatformUI.isWorkbenchRunning()){ >- try { >- //Checks in the loop are fast enough so we can poll often >- Thread.sleep(100); >+ Bundle bnd = RSEUIPlugin.getDefault().getBundle(); >+ if (bnd.getState() == Bundle.ACTIVE) { >+ // addListenerJob.schedule(); >+ fModelChangeListener = new ModelChangeListener(); >+ RSECorePlugin.getTheSystemRegistry().addSystemModelChangeListener(fModelChangeListener); >+ } else { >+ final BundleContext ctx = bnd.getBundleContext(); >+ ctx.addBundleListener(new BundleListener() { >+ public void bundleChanged(BundleEvent event) { >+ if (event.getType() == BundleEvent.STARTED) { >+ // addListenerJob.schedule(); >+ fModelChangeListener = new ModelChangeListener(); >+ RSECorePlugin.getTheSystemRegistry().addSystemModelChangeListener(fModelChangeListener); >+ ctx.removeBundleListener(this); > } >- catch (InterruptedException e){} > } >- >- IWorkbench wb = PlatformUI.getWorkbench(); >- if (!wb.isClosing()) { >- fModelChangeListener = new ModelChangeListener(); >- RSECorePlugin.getTheSystemRegistry().addSystemModelChangeListener(fModelChangeListener); >- } >- return Status.OK_STATUS; >- } >- }; >- addListenerJob.setSystem(true); >- addListenerJob.schedule(); >+ }); >+ } > } > } > >Index: UI/org/eclipse/rse/ui/SystemBasePlugin.java >=================================================================== >RCS file: /cvsroot/dsdp/org.eclipse.tm.rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/SystemBasePlugin.java,v >retrieving revision 1.10 >diff -u -r1.10 SystemBasePlugin.java >--- UI/org/eclipse/rse/ui/SystemBasePlugin.java 29 Sep 2008 18:41:06 -0000 1.10 >+++ UI/org/eclipse/rse/ui/SystemBasePlugin.java 29 Jul 2009 23:59:20 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************** >- * Copyright (c) 2002, 2008 IBM Corporation and others. All rights reserved. >+ * Copyright (c) 2002, 2009 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 http://www.eclipse.org/legal/epl-v10.html >@@ -16,6 +16,7 @@ > * David McKnight (IBM) - [243263] NPE on expanding a filter > * David McKnight (IBM) - [244454] SystemBasePlugin.getWorkBench() incorrectly returns null when called during Eclipse startup > * David McKnight (IBM) [246406] [performance] Timeout waiting when loading SystemPreferencesManager$ModelChangeListener during startup >+ * Martin Oberhuber (Wind River) - [246406] Timeout waiting when loading RSE > ********************************************************************************/ > > package org.eclipse.rse.ui; >@@ -58,9 +59,13 @@ > // static variables > private static SystemBasePlugin baseInst = null; > >- /** >- * Logger object for logging messages for servicing purposes. >- */ >+ /** >+ * Logger object for logging messages for servicing purposes. >+ * >+ * @deprecated do not use use this directly, use {@link #getLogger()} >+ * instead for lazy loading of the Logger. We do not guarantee >+ * that this variable is ever initialized. >+ */ > protected static Logger log = null; > > /** >@@ -343,7 +348,7 @@ > boolean ok = false; > try { > URL url = bundle.getEntry("/"+fileName); //$NON-NLS-1$ >- if (url != null) { >+ if (url != null) { > mf = SystemUIMessageFile.getMessageFile(fileName, url); > ok = true; > } >@@ -459,19 +464,19 @@ > switch (type) > { > case SystemMessage.ERROR: >- log.logError(message.toString(), ex); >+ getBaseDefault().getLogger().logError(message.toString(), ex); > break; > case SystemMessage.WARNING: >- log.logWarning(message.toString(), ex); >+ getBaseDefault().getLogger().logWarning(message.toString(), ex); > break; > case SystemMessage.INFORMATION: > case SystemMessage.COMPLETION: >- log.logInfo(message.toString(), ex); >+ getBaseDefault().getLogger().logInfo(message.toString(), ex); > break; > case SystemMessage.INQUIRY: > case SystemMessage.UNEXPECTED: > default: >- log.logInfo(message.toString(), ex); >+ getBaseDefault().getLogger().logInfo(message.toString(), ex); > break; > } > } >@@ -488,7 +493,7 @@ > */ > public static void logInfo(String message) > { >- log.logInfo(message); >+ getBaseDefault().getLogger().logInfo(message); > } > > // ----------------- >@@ -508,7 +513,7 @@ > */ > public static void logWarning(String message) > { >- log.logWarning(message); >+ getBaseDefault().getLogger().logWarning(message); > } > > /** >@@ -523,7 +528,7 @@ > */ > public static void logError(String message) > { >- log.logError(message, null); >+ getBaseDefault().getLogger().logError(message, null); > } > > /** >@@ -541,7 +546,7 @@ > */ > public static void logError(String message, Throwable exception) > { >- log.logError(message, exception); >+ getBaseDefault().getLogger().logError(message, exception); > } > > /** >@@ -556,7 +561,7 @@ > */ > public static void logDebugMessage(String prefix, String message) > { >- log.logDebugMessage(prefix, message); >+ getBaseDefault().getLogger().logDebugMessage(prefix, message); > } > > /** >@@ -609,11 +614,8 @@ > > super.start(context); > >- // logger >- if (log == null) { >- log = LoggerFactory.getLogger(this); >- log.logInfo("Loading " + this.getClass()); //$NON-NLS-1$ >- } >+ // // bug 246406: initialize the logger lazily >+ // getLogger(); > > addWindowListener(); > } >@@ -622,7 +624,9 @@ > * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext) > */ > public void stop(BundleContext context) throws Exception { >- logDebugMessage(this.getClass().getName(), "SHUTDOWN"); //$NON-NLS-1$ >+ if (Logger.DEBUG) { >+ logDebugMessage(this.getClass().getName(), "SHUTDOWN"); //$NON-NLS-1$ >+ } > LoggerFactory.freeLogger(this); > super.stop(context); > } >@@ -739,12 +743,16 @@ > } > > /** >- * Returns an image descriptor from the base IDE. Looks only in the "icons/full/" directories. >+ * Returns an image descriptor from the base IDE. Looks only in the >+ * "icons/full/" directories. > * >- * @see org.eclipse.ui.views.navigator.ResourceNavigatorActionGroup#getImageDescriptor(java.lang.String) >+ * @deprecated use {@link org.eclipse.ui.ISharedImages} via >+ * PlatformUI.getWorkbench().getSharedImages() > */ > public ImageDescriptor getImageDescriptorFromIDE(String relativePath) > { >+ // This code is from >+ // org.eclipse.ui.views.navigator.ResourceNavigatorActionGroup#getImageDescriptor(java.lang.String) > Hashtable registry = getImageDescriptorRegistry(); > ImageDescriptor descriptor = (ImageDescriptor)registry.get(relativePath); > if (descriptor == null) { >@@ -778,6 +786,11 @@ > */ > public Logger getLogger() > { >+ // logger >+ if (log == null) { >+ log = LoggerFactory.getLogger(this); >+ log.logInfo("Loading " + this.getClass()); //$NON-NLS-1$ >+ } > return log; > } >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 246406
:
113492
|
113632
|
113744
|
113784
| 142960