Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 232356
Collapse All | Expand All

(-)META-INF/MANIFEST.MF (-1 / +2 lines)
Lines 2-8 Link Here
2
Bundle-ManifestVersion: 2
2
Bundle-ManifestVersion: 2
3
Bundle-Name: %bundleName
3
Bundle-Name: %bundleName
4
Bundle-SymbolicName: org.eclipse.equinox.p2.ui.sdk.scheduler;singleton:=true
4
Bundle-SymbolicName: org.eclipse.equinox.p2.ui.sdk.scheduler;singleton:=true
5
Bundle-Version: 1.0.100.qualifier
5
Bundle-Version: 1.1.0.qualifier
6
Bundle-Activator: org.eclipse.equinox.internal.p2.ui.sdk.scheduler.AutomaticUpdatePlugin
6
Bundle-Activator: org.eclipse.equinox.internal.p2.ui.sdk.scheduler.AutomaticUpdatePlugin
7
Bundle-Vendor: %providerName
7
Bundle-Vendor: %providerName
8
Bundle-Localization: plugin
8
Bundle-Localization: plugin
Lines 19-24 Link Here
19
 org.eclipse.equinox.internal.p2.core.helpers,
19
 org.eclipse.equinox.internal.p2.core.helpers,
20
 org.eclipse.equinox.internal.p2.engine,
20
 org.eclipse.equinox.internal.p2.engine,
21
 org.eclipse.equinox.internal.p2.engine.phases,
21
 org.eclipse.equinox.internal.p2.engine.phases,
22
 org.eclipse.equinox.internal.p2.garbagecollector,
22
 org.eclipse.equinox.internal.p2.metadata.query,
23
 org.eclipse.equinox.internal.p2.metadata.query,
23
 org.eclipse.equinox.internal.p2.ui.actions,
24
 org.eclipse.equinox.internal.p2.ui.actions,
24
 org.eclipse.equinox.internal.p2.ui.query,
25
 org.eclipse.equinox.internal.p2.ui.query,
(-)src/org/eclipse/equinox/internal/p2/ui/sdk/scheduler/AutomaticUpdateScheduler.java (-1 / +28 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2008, 2010 IBM Corporation and others.
2
 * Copyright (c) 2008, 2011 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 14-19 Link Here
14
import com.ibm.icu.util.ULocale;
14
import com.ibm.icu.util.ULocale;
15
import org.eclipse.core.runtime.*;
15
import org.eclipse.core.runtime.*;
16
import org.eclipse.equinox.internal.p2.core.helpers.ServiceHelper;
16
import org.eclipse.equinox.internal.p2.core.helpers.ServiceHelper;
17
import org.eclipse.equinox.internal.p2.garbagecollector.GarbageCollector;
17
import org.eclipse.equinox.internal.provisional.p2.updatechecker.*;
18
import org.eclipse.equinox.internal.provisional.p2.updatechecker.*;
18
import org.eclipse.equinox.p2.core.IProvisioningAgent;
19
import org.eclipse.equinox.p2.core.IProvisioningAgent;
19
import org.eclipse.equinox.p2.engine.IProfile;
20
import org.eclipse.equinox.p2.engine.IProfile;
Lines 77-85 Link Here
77
	}
78
	}
78
79
79
	public void earlyStartup() {
80
	public void earlyStartup() {
81
		garbageCollect();
80
		scheduleUpdate();
82
		scheduleUpdate();
81
	}
83
	}
82
84
85
	/**
86
	 * Invokes the garbage collector to discard unused plugins, if specified by a 
87
	 * corresponding preference.
88
	 */
89
	private void garbageCollect() {
90
		// Nothing to do if we don't know what profile we are checking
91
		if (profileId == null)
92
			return;
93
		//check if gc is enabled
94
		IPreferenceStore pref = AutomaticUpdatePlugin.getDefault().getPreferenceStore();
95
		if (!pref.getBoolean(PreferenceConstants.PREF_GC_ON_STARTUP))
96
			return;
97
		IProvisioningAgent agent = (IProvisioningAgent) ServiceHelper.getService(AutomaticUpdatePlugin.getContext(), IProvisioningAgent.SERVICE_NAME);
98
		GarbageCollector collector = (GarbageCollector) agent.getService(GarbageCollector.SERVICE_NAME);
99
		if (collector == null)
100
			return;
101
		IProfileRegistry registry = (IProfileRegistry) agent.getService(IProfileRegistry.SERVICE_NAME);
102
		if (registry == null)
103
			return;
104
		IProfile profile = registry.getProfile(profileId);
105
		if (profile == null)
106
			return;
107
		collector.runGC(profile);
108
	}
109
83
	public void shutdown() {
110
	public void shutdown() {
84
		removeUpdateListener();
111
		removeUpdateListener();
85
	}
112
	}
(-)src/org/eclipse/equinox/internal/p2/ui/sdk/scheduler/PreferenceConstants.java (-1 / +2 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 *  Copyright (c) 2008, 2010 IBM Corporation and others.
2
 *  Copyright (c) 2008, 2011 IBM Corporation and others.
3
 *  All rights reserved. This program and the accompanying materials
3
 *  All rights reserved. This program and the accompanying materials
4
 *  are made available under the terms of the Eclipse Public License v1.0
4
 *  are made available under the terms of the Eclipse Public License v1.0
5
 *  which accompanies this distribution, and is available at
5
 *  which accompanies this distribution, and is available at
Lines 28-31 Link Here
28
	public static final String PREF_REMIND_240Minutes = "4 Hours";//$NON-NLS-1$
28
	public static final String PREF_REMIND_240Minutes = "4 Hours";//$NON-NLS-1$
29
	public static final String PREF_AUTO_UPDATE_INIT = "autoUpdateInit"; //$NON-NLS-1$
29
	public static final String PREF_AUTO_UPDATE_INIT = "autoUpdateInit"; //$NON-NLS-1$
30
	public static final String PREF_MIGRATED_34 = "migrated34Prefs"; //$NON-NLS-1$
30
	public static final String PREF_MIGRATED_34 = "migrated34Prefs"; //$NON-NLS-1$
31
	public static final String PREF_GC_ON_STARTUP = "gcOnStartup"; //$NON-NLS-1$
31
}
32
}

Return to bug 232356