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 112920 Details for
Bug 245918
[dstore] Customization of connection timeout does not work
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Patch fixing the problem
Bug245918_defaultPrefs.diff.txt (text/plain), 7.62 KB, created by
Martin Oberhuber
on 2008-09-18 13:13:21 EDT
(
hide
)
Description:
Patch fixing the problem
Filename:
MIME Type:
Creator:
Martin Oberhuber
Created:
2008-09-18 13:13:21 EDT
Size:
7.62 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.rse.connectorservice.dstore >Index: src/org/eclipse/rse/internal/connectorservice/dstore/Activator.java >=================================================================== >RCS file: /cvsroot/dsdp/org.eclipse.tm.rse/plugins/org.eclipse.rse.connectorservice.dstore/src/org/eclipse/rse/internal/connectorservice/dstore/Activator.java,v >retrieving revision 1.10 >diff -u -r1.10 Activator.java >--- src/org/eclipse/rse/internal/connectorservice/dstore/Activator.java 21 May 2008 14:45:17 -0000 1.10 >+++ src/org/eclipse/rse/internal/connectorservice/dstore/Activator.java 18 Sep 2008 17:06:51 -0000 >@@ -7,10 +7,10 @@ > * > * Initial Contributors: > * The following IBM employees contributed to the Remote System Explorer >- * component that contains this file: David McKnight, Kushal Munir, >- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson, >+ * component that contains this file: David McKnight, Kushal Munir, >+ * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson, > * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley. >- * >+ * > * Contributors: > * Martin Oberhuber (Wind River) - [168870] refactor org.eclipse.rse.core package of the UI plugin > * David McKnight (IBM) - [216252] [api][nls] Resource Strings specific to subsystems should be moved from rse.ui into files.ui / shells.ui / processes.ui where possible >@@ -18,15 +18,19 @@ > * David McKnight (IBM) - [227406] [dstore] DStoreFileService must listen to buffer size preference changes > * David McKnight (IBM) - [228334][api][breaking][dstore] Default DataStore connection timeout is too short > * David McKnight (IBM) - [233160] [dstore] SSL/non-SSL alert are not appropriate >+ * Martin Oberhuber (Wind River) - [245918] Allow customization of DStore Preferences > *******************************************************************************/ > > package org.eclipse.rse.internal.connectorservice.dstore; > >-import org.eclipse.jface.preference.IPreferenceStore; >+import org.eclipse.core.runtime.Platform; >+import org.eclipse.core.runtime.preferences.DefaultScope; >+import org.eclipse.core.runtime.preferences.IEclipsePreferences; > import org.eclipse.rse.connectorservice.dstore.IUniversalDStoreConstants; > import org.eclipse.rse.ui.ISystemPreferencesConstants; > import org.eclipse.rse.ui.RSEUIPlugin; > import org.eclipse.rse.ui.SystemBasePlugin; >+import org.eclipse.ui.preferences.ScopedPreferenceStore; > import org.osgi.framework.BundleContext; > > /** >@@ -36,9 +40,9 @@ > > //The shared instance. > private static Activator plugin; >- >+ > public final static String PLUGIN_ID = "org.eclipse.rse.connectorservice.dstore"; //$NON-NLS-1$ >- >+ > /** > * The constructor. > */ >@@ -49,38 +53,70 @@ > /** > * This method is called upon plug-in activation > */ >- public void start(BundleContext context) throws Exception >+ public void start(BundleContext context) throws Exception > { > super.start(context); > > initializeDefaultPreferences(); > } >- >- >+ >+ /** >+ * A Preference Store that gives direct access to Default Preferences. >+ */ >+ private static class DefaultPreferenceStore extends ScopedPreferenceStore { >+ private IEclipsePreferences[] defaultNodes; >+ public DefaultPreferenceStore(String qualifier) { >+ super(new DefaultScope(), qualifier); >+ defaultNodes = new IEclipsePreferences[] { >+ new DefaultScope().getNode(qualifier) }; >+ } >+ public boolean hasDefault(String key) { >+ return Platform.getPreferencesService().get(key, null, defaultNodes) != null; >+ } >+ } >+ > public void initializeDefaultPreferences() { >- IPreferenceStore store = RSEUIPlugin.getDefault().getPreferenceStore(); >+ >+ // [245918] Since our Preferences are stored in RSEUIPlugin, we cannot >+ // use the core.runtime.preferences extension in order to do >+ // initialization in the correct order (allow overriding by >+ // plugin_customization.ini). We therefore explicitly check each >+ // Preference slot, and only set a there isn't one set already. Note >+ // that requires explicit access to the DefaultScope(). >+ // TODO move Preferences to our own PreferenceStore to simplify this >+ DefaultPreferenceStore store = new DefaultPreferenceStore(RSEUIPlugin.getDefault().getBundle().getSymbolicName()); >+ //IPreferenceStore store = RSEUIPlugin.getDefault().getPreferenceStore(); > //Preferences store = RSECorePlugin.getDefault().getPluginPreferences(); > >- store.setDefault(IUniversalDStoreConstants.RESID_PREF_SOCKET_TIMEOUT, IDStoreDefaultPreferenceConstants.DEFAULT_PREF_SOCKET_TIMEOUT); >- >+ if (!store.hasDefault(IUniversalDStoreConstants.RESID_PREF_SOCKET_TIMEOUT)) >+ store.setDefault(IUniversalDStoreConstants.RESID_PREF_SOCKET_TIMEOUT, IDStoreDefaultPreferenceConstants.DEFAULT_PREF_SOCKET_TIMEOUT); >+ > // do keepalive >- store.setDefault(IUniversalDStoreConstants.RESID_PREF_DO_KEEPALIVE, IDStoreDefaultPreferenceConstants.DEFAULT_PREF_DO_KEEPALIVE); >- >- // socket read timeout >- store.setDefault(IUniversalDStoreConstants.RESID_PREF_SOCKET_READ_TIMEOUT, IDStoreDefaultPreferenceConstants.DEFAULT_PREF_SOCKET_READ_TIMEOUT); >- >+ if (!store.hasDefault(IUniversalDStoreConstants.RESID_PREF_DO_KEEPALIVE)) >+ store.setDefault(IUniversalDStoreConstants.RESID_PREF_DO_KEEPALIVE, IDStoreDefaultPreferenceConstants.DEFAULT_PREF_DO_KEEPALIVE); >+ >+ // socket read timeout >+ if (!store.hasDefault(IUniversalDStoreConstants.RESID_PREF_SOCKET_READ_TIMEOUT)) >+ store.setDefault(IUniversalDStoreConstants.RESID_PREF_SOCKET_READ_TIMEOUT, IDStoreDefaultPreferenceConstants.DEFAULT_PREF_SOCKET_READ_TIMEOUT); >+ > // keepalive response timeout >- store.setDefault(IUniversalDStoreConstants.RESID_PREF_KEEPALIVE_RESPONSE_TIMEOUT, IDStoreDefaultPreferenceConstants.DEFAULT_PREF_KEEPALIVE_RESPONSE_TIMEOUT); >- >+ if (!store.hasDefault(IUniversalDStoreConstants.RESID_PREF_KEEPALIVE_RESPONSE_TIMEOUT)) >+ store.setDefault(IUniversalDStoreConstants.RESID_PREF_KEEPALIVE_RESPONSE_TIMEOUT, >+ IDStoreDefaultPreferenceConstants.DEFAULT_PREF_KEEPALIVE_RESPONSE_TIMEOUT); >+ > // show mismatched server warning >- store.setDefault(IUniversalDStoreConstants.ALERT_MISMATCHED_SERVER, IDStoreDefaultPreferenceConstants.DEFAULT_ALERT_MISMATCHED_SERVER); >+ if (!store.hasDefault(IUniversalDStoreConstants.ALERT_MISMATCHED_SERVER)) >+ store.setDefault(IUniversalDStoreConstants.ALERT_MISMATCHED_SERVER, IDStoreDefaultPreferenceConstants.DEFAULT_ALERT_MISMATCHED_SERVER); > > // cache remote classes >- store.setDefault(IUniversalDStoreConstants.RESID_PREF_CACHE_REMOTE_CLASSES, IDStoreDefaultPreferenceConstants.DEFAULT_PREF_CACHE_REMOTE_CLASSES); >- >+ if (!store.hasDefault(IUniversalDStoreConstants.RESID_PREF_CACHE_REMOTE_CLASSES)) >+ store.setDefault(IUniversalDStoreConstants.RESID_PREF_CACHE_REMOTE_CLASSES, IDStoreDefaultPreferenceConstants.DEFAULT_PREF_CACHE_REMOTE_CLASSES); >+ > // alert defaults >- store.setDefault(ISystemPreferencesConstants.ALERT_SSL, ISystemPreferencesConstants.DEFAULT_ALERT_SSL); >- store.setDefault(ISystemPreferencesConstants.ALERT_NONSSL, ISystemPreferencesConstants.DEFAULT_ALERT_NON_SSL); >+ if (!store.hasDefault(ISystemPreferencesConstants.ALERT_SSL)) >+ store.setDefault(ISystemPreferencesConstants.ALERT_SSL, ISystemPreferencesConstants.DEFAULT_ALERT_SSL); >+ if (!store.hasDefault(ISystemPreferencesConstants.ALERT_NONSSL)) >+ store.setDefault(ISystemPreferencesConstants.ALERT_NONSSL, ISystemPreferencesConstants.DEFAULT_ALERT_NON_SSL); > } > > /** >@@ -103,6 +139,6 @@ > protected void initializeImageRegistry() > { > // TODO Auto-generated method stub >- >+ > } > }
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 245918
:
112903
|
112910
|
112920
|
112928