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 199926 Details for
Bug 232356
[GC] Option to remove the plugins automatically when uninstall feature
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]
Fix v01
patch.txt (text/plain), 5.13 KB, created by
John Arthorne
on 2011-07-19 14:11:26 EDT
(
hide
)
Description:
Fix v01
Filename:
MIME Type:
Creator:
John Arthorne
Created:
2011-07-19 14:11:26 EDT
Size:
5.13 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.equinox.p2.ui.sdk.scheduler >Index: META-INF/MANIFEST.MF >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.ui.sdk.scheduler/META-INF/MANIFEST.MF,v >retrieving revision 1.16 >diff -u -r1.16 MANIFEST.MF >--- META-INF/MANIFEST.MF 21 Dec 2010 15:59:32 -0000 1.16 >+++ META-INF/MANIFEST.MF 19 Jul 2011 18:09:54 -0000 >@@ -2,7 +2,7 @@ > Bundle-ManifestVersion: 2 > Bundle-Name: %bundleName > Bundle-SymbolicName: org.eclipse.equinox.p2.ui.sdk.scheduler;singleton:=true >-Bundle-Version: 1.0.100.qualifier >+Bundle-Version: 1.1.0.qualifier > Bundle-Activator: org.eclipse.equinox.internal.p2.ui.sdk.scheduler.AutomaticUpdatePlugin > Bundle-Vendor: %providerName > Bundle-Localization: plugin >@@ -19,6 +19,7 @@ > org.eclipse.equinox.internal.p2.core.helpers, > org.eclipse.equinox.internal.p2.engine, > org.eclipse.equinox.internal.p2.engine.phases, >+ org.eclipse.equinox.internal.p2.garbagecollector, > org.eclipse.equinox.internal.p2.metadata.query, > org.eclipse.equinox.internal.p2.ui.actions, > org.eclipse.equinox.internal.p2.ui.query, >Index: src/org/eclipse/equinox/internal/p2/ui/sdk/scheduler/AutomaticUpdateScheduler.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.ui.sdk.scheduler/src/org/eclipse/equinox/internal/p2/ui/sdk/scheduler/AutomaticUpdateScheduler.java,v >retrieving revision 1.15 >diff -u -r1.15 AutomaticUpdateScheduler.java >--- src/org/eclipse/equinox/internal/p2/ui/sdk/scheduler/AutomaticUpdateScheduler.java 22 Feb 2010 01:09:59 -0000 1.15 >+++ src/org/eclipse/equinox/internal/p2/ui/sdk/scheduler/AutomaticUpdateScheduler.java 19 Jul 2011 18:09:54 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2008, 2010 IBM Corporation and others. >+ * Copyright (c) 2008, 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 >@@ -14,6 +14,7 @@ > import com.ibm.icu.util.ULocale; > import org.eclipse.core.runtime.*; > import org.eclipse.equinox.internal.p2.core.helpers.ServiceHelper; >+import org.eclipse.equinox.internal.p2.garbagecollector.GarbageCollector; > import org.eclipse.equinox.internal.provisional.p2.updatechecker.*; > import org.eclipse.equinox.p2.core.IProvisioningAgent; > import org.eclipse.equinox.p2.engine.IProfile; >@@ -77,9 +78,35 @@ > } > > public void earlyStartup() { >+ garbageCollect(); > scheduleUpdate(); > } > >+ /** >+ * Invokes the garbage collector to discard unused plugins, if specified by a >+ * corresponding preference. >+ */ >+ private void garbageCollect() { >+ // Nothing to do if we don't know what profile we are checking >+ if (profileId == null) >+ return; >+ //check if gc is enabled >+ IPreferenceStore pref = AutomaticUpdatePlugin.getDefault().getPreferenceStore(); >+ if (!pref.getBoolean(PreferenceConstants.PREF_GC_ON_STARTUP)) >+ return; >+ IProvisioningAgent agent = (IProvisioningAgent) ServiceHelper.getService(AutomaticUpdatePlugin.getContext(), IProvisioningAgent.SERVICE_NAME); >+ GarbageCollector collector = (GarbageCollector) agent.getService(GarbageCollector.SERVICE_NAME); >+ if (collector == null) >+ return; >+ IProfileRegistry registry = (IProfileRegistry) agent.getService(IProfileRegistry.SERVICE_NAME); >+ if (registry == null) >+ return; >+ IProfile profile = registry.getProfile(profileId); >+ if (profile == null) >+ return; >+ collector.runGC(profile); >+ } >+ > public void shutdown() { > removeUpdateListener(); > } >Index: src/org/eclipse/equinox/internal/p2/ui/sdk/scheduler/PreferenceConstants.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.ui.sdk.scheduler/src/org/eclipse/equinox/internal/p2/ui/sdk/scheduler/PreferenceConstants.java,v >retrieving revision 1.5 >diff -u -r1.5 PreferenceConstants.java >--- src/org/eclipse/equinox/internal/p2/ui/sdk/scheduler/PreferenceConstants.java 9 Sep 2010 22:45:58 -0000 1.5 >+++ src/org/eclipse/equinox/internal/p2/ui/sdk/scheduler/PreferenceConstants.java 19 Jul 2011 18:09:54 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2008, 2010 IBM Corporation and others. >+ * Copyright (c) 2008, 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 >@@ -28,4 +28,5 @@ > public static final String PREF_REMIND_240Minutes = "4 Hours";//$NON-NLS-1$ > public static final String PREF_AUTO_UPDATE_INIT = "autoUpdateInit"; //$NON-NLS-1$ > public static final String PREF_MIGRATED_34 = "migrated34Prefs"; //$NON-NLS-1$ >+ public static final String PREF_GC_ON_STARTUP = "gcOnStartup"; //$NON-NLS-1$ > }
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 232356
:
113065
|
184266
| 199926