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 78383 Details for
Bug 200735
[Persistence][api] Delete a profile that contains a connection and restart, profile is back without connections
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Adds a Quiesce state to System Profiles
patch.txt (text/plain), 7.37 KB, created by
Kevin Doyle
on 2007-09-13 16:46:55 EDT
(
hide
)
Description:
Adds a Quiesce state to System Profiles
Filename:
MIME Type:
Creator:
Kevin Doyle
Created:
2007-09-13 16:46:55 EDT
Size:
7.37 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.rse.core >Index: src/org/eclipse/rse/internal/core/model/SystemProfileManager.java >=================================================================== >RCS file: /cvsroot/dsdp/org.eclipse.tm.rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/internal/core/model/SystemProfileManager.java,v >retrieving revision 1.5 >diff -u -r1.5 SystemProfileManager.java >--- src/org/eclipse/rse/internal/core/model/SystemProfileManager.java 30 Aug 2007 19:42:39 -0000 1.5 >+++ src/org/eclipse/rse/internal/core/model/SystemProfileManager.java 13 Sep 2007 20:41:22 -0000 >@@ -14,6 +14,7 @@ > * David Dykstal (IBM) - created and used RSEPreferencesManager > * - moved SystemPreferencesManager to a new plugin > * Kevin Doyle (IBM) - [197199] Renaming a Profile doesn't cause a save >+ * Kevin Doyle (IBM) - [200735] Delete a profile and it returns after restart with no connections > ********************************************************************************/ > > package org.eclipse.rse.internal.core.model; >@@ -178,7 +179,7 @@ > RSEPreferencesManager.renameActiveProfile(oldName, newName); > } > // Commit the profile to reflect the name change >- RSECorePlugin.getThePersistenceManager().commitProfile(profile, 5000); >+ profile.commit(); > // Delete the profile by the old name, which is done in a separate job. > RSECorePlugin.getThePersistenceManager().deleteProfile(profile.getPersistenceProvider(), oldName); > } >Index: src/org/eclipse/rse/internal/core/model/SystemProfile.java >=================================================================== >RCS file: /cvsroot/dsdp/org.eclipse.tm.rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/internal/core/model/SystemProfile.java,v >retrieving revision 1.4 >diff -u -r1.4 SystemProfile.java >--- src/org/eclipse/rse/internal/core/model/SystemProfile.java 11 May 2007 04:05:14 -0000 1.4 >+++ src/org/eclipse/rse/internal/core/model/SystemProfile.java 13 Sep 2007 20:41:22 -0000 >@@ -14,6 +14,7 @@ > * David Dykstal (IBM) - 142806: refactoring persistence framework > * Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType > * Martin Oberhuber (Wind River) - [177523] Unify singleton getter methods >+ * Kevin Doyle (IBM) - [200735] Delete a profile and it returns after restart with no connections > ********************************************************************************/ > > package org.eclipse.rse.internal.core.model; >@@ -50,6 +51,7 @@ > private boolean isActive = true; > private String name = null; > private boolean defaultPrivate = false; >+ private boolean quiesceState = false; > > /** > * Default constructor >@@ -212,8 +214,14 @@ > public boolean commit() > { > boolean result = false; >- if (!RSECorePlugin.getThePersistenceManager().isBusy()) { >- result = RSECorePlugin.getThePersistenceManager().commitProfile(this, 5000); >+ if (!quiesceState) { >+ // Need to check if busy otherwise Initialize RSE job will take forever >+ // because all the commit's are waiting to acquire a lock. >+ if (!RSECorePlugin.getThePersistenceManager().isBusy()) { >+ result = RSECorePlugin.getThePersistenceManager().commitProfile(this, 5000); >+ } >+ } else { >+ setDirty(true); > } > return result; > } >@@ -250,4 +258,28 @@ > this.provider = provider; > } > >+ /** >+ * Sets the quiesce state of the profile. If this is set to true >+ * then commits will be ignored. If this is set to false then >+ * it will check if the profile is dirty and commit the profile >+ * if needed and future commits won't be ignored. >+ * @param state The quiesce state of the profile. >+ */ >+ public void setQuiesceState(final boolean state) { >+ quiesceState = state; >+ // If we are changing the quiesce state to false >+ // and the profile is dirty then we need to do a commit >+ if (!quiesceState && isDirty()) { >+ commit(); >+ } >+ } >+ >+ /** >+ * Returns the quiesce state of the profile. >+ * @return <code>true</code> if the profile is in the quiesce state >+ * else <code>false</code>. >+ */ >+ public boolean getQuiesceState() { >+ return quiesceState; >+ } > } >\ No newline at end of file >Index: src/org/eclipse/rse/internal/persistence/RSEPersistenceManager.java >=================================================================== >RCS file: /cvsroot/dsdp/org.eclipse.tm.rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/internal/persistence/RSEPersistenceManager.java,v >retrieving revision 1.14 >diff -u -r1.14 RSEPersistenceManager.java >--- src/org/eclipse/rse/internal/persistence/RSEPersistenceManager.java 11 Sep 2007 01:51:17 -0000 1.14 >+++ src/org/eclipse/rse/internal/persistence/RSEPersistenceManager.java 13 Sep 2007 20:41:22 -0000 >@@ -17,6 +17,7 @@ > * Martin Oberhuber (Wind River) - [175680] Deprecate obsolete ISystemRegistry methods > * Martin Oberhuber (Wind River) - [196919] Fix deadlock with workspace operations > * Martin Oberhuber (Wind River) - [202416] Protect against NPEs when importing DOM >+ * Kevin Doyle (IBM) - [200735] Delete a profile and it returns after restart with no connections > ********************************************************************************/ > > package org.eclipse.rse.internal.persistence; >@@ -149,7 +150,7 @@ > for (int idx = 0; idx < profiles.length; idx++) { > ISystemProfile profile = profiles[idx]; > try { >- boolean ok = commitProfile(profile, timeout); >+ boolean ok = profile.commit(); > if (!ok) { > failed.add(profile); > } >#P org.eclipse.rse.ui >Index: model/org/eclipse/rse/ui/internal/model/SystemRegistry.java >=================================================================== >RCS file: /cvsroot/dsdp/org.eclipse.tm.rse/plugins/org.eclipse.rse.ui/model/org/eclipse/rse/ui/internal/model/SystemRegistry.java,v >retrieving revision 1.35 >diff -u -r1.35 SystemRegistry.java >--- model/org/eclipse/rse/ui/internal/model/SystemRegistry.java 3 Aug 2007 15:02:01 -0000 1.35 >+++ model/org/eclipse/rse/ui/internal/model/SystemRegistry.java 13 Sep 2007 20:41:22 -0000 >@@ -35,6 +35,7 @@ > * David McKnight (IBM) - [165674] Sort subsystem configurations to be in deterministic order > * Martin Oberhuber (Wind River) - [165674] Sort subsystem configurations by priority then Id > * Martin Oberhuber (Wind River) - [194898] Avoid NPE when doing EVENT_REFRESH_REMOTE on a subsys without filters >+ * Kevin Doyle (IBM) - [200735] Delete a profile and it returns after restart with no connections > ********************************************************************************/ > > package org.eclipse.rse.ui.internal.model; >@@ -90,6 +91,7 @@ > import org.eclipse.rse.internal.core.model.SystemModelChangeEvent; > import org.eclipse.rse.internal.core.model.SystemModelChangeEventManager; > import org.eclipse.rse.internal.core.model.SystemPreferenceChangeManager; >+import org.eclipse.rse.internal.core.model.SystemProfile; > import org.eclipse.rse.internal.core.model.SystemProfileManager; > import org.eclipse.rse.internal.core.model.SystemRemoteChangeEventManager; > import org.eclipse.rse.services.clientserver.messages.SystemMessage; >@@ -732,6 +734,11 @@ > */ > public void deleteSystemProfile(ISystemProfile profile) throws Exception > { >+ // Set the profile into Quiesce state >+ if (profile instanceof SystemProfile) { >+ ((SystemProfile) profile).setQuiesceState(true); >+ } >+ > // step 0: load the world! > loadAll(); // force the world into memory! >
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 200735
:
78383