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 236709 | Differences between
and this patch

Collapse All | Expand All

(-)a/update/org.eclipse.update.configurator/src/org/eclipse/update/internal/configurator/BundleGroupComponent.java (-4 / +6 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2009, 2010 IBM Corporation and others.
2
 * Copyright (c) 2009, 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 21-30 import org.eclipse.core.runtime.IBundleGroupProvider; Link Here
21
public class BundleGroupComponent implements IBundleGroupProvider {
21
public class BundleGroupComponent implements IBundleGroupProvider {
22
22
23
	public IBundleGroup[] getBundleGroups() {
23
	public IBundleGroup[] getBundleGroups() {
24
		// if we are not reconciler then defer bundle group registration
25
		if (!ConfigurationActivator.isReconciling())
26
			return new IBundleGroup[0];
24
		ConfigurationActivator activator = ConfigurationActivator.getConfigurator();
27
		ConfigurationActivator activator = ConfigurationActivator.getConfigurator();
28
		// we manually registered the group in the activator; return no groups
29
		// the manually registered service will handle the groups we know about
25
		if (activator.bundleGroupProviderSR != null)
30
		if (activator.bundleGroupProviderSR != null)
26
			// we manually registered the group in the activator; return no groups
27
			// the manually registered service will handle the groups we know about
28
			return new IBundleGroup[0];
31
			return new IBundleGroup[0];
29
		return activator.getBundleGroups();
32
		return activator.getBundleGroups();
30
	}
33
	}
Lines 32-36 public class BundleGroupComponent implements IBundleGroupProvider { Link Here
32
	public String getName() {
35
	public String getName() {
33
		return ConfigurationActivator.getConfigurator().getName();
36
		return ConfigurationActivator.getConfigurator().getName();
34
	}
37
	}
35
36
}
38
}
(-)a/update/org.eclipse.update.configurator/src/org/eclipse/update/internal/configurator/ConfigurationActivator.java (-12 / +27 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2003, 2010 IBM Corporation and others.
2
 * Copyright (c) 2003, 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 10-31 Link Here
10
 *******************************************************************************/
10
 *******************************************************************************/
11
package org.eclipse.update.internal.configurator;
11
package org.eclipse.update.internal.configurator;
12
12
13
import org.osgi.framework.InvalidSyntaxException;
14
15
import java.io.*;
13
import java.io.*;
16
import java.net.*;
14
import java.net.MalformedURLException;
15
import java.net.URL;
17
import java.util.*;
16
import java.util.*;
18
17
import org.eclipse.core.runtime.IBundleGroup;
19
import org.eclipse.core.runtime.*;
18
import org.eclipse.core.runtime.IBundleGroupProvider;
20
import org.eclipse.osgi.framework.log.*;
19
import org.eclipse.osgi.framework.log.FrameworkLog;
21
import org.eclipse.osgi.service.datalocation.*;
20
import org.eclipse.osgi.service.datalocation.Location;
22
import org.eclipse.osgi.service.debug.*;
21
import org.eclipse.osgi.service.debug.DebugOptions;
23
import org.eclipse.osgi.util.ManifestElement;
22
import org.eclipse.osgi.util.ManifestElement;
24
import org.eclipse.osgi.util.NLS;
23
import org.eclipse.osgi.util.NLS;
25
import org.eclipse.update.configurator.*;
24
import org.eclipse.update.configurator.IPlatformConfiguration;
25
import org.eclipse.update.configurator.IPlatformConfigurationFactory;
26
import org.osgi.framework.*;
26
import org.osgi.framework.*;
27
import org.osgi.service.packageadmin.*;
27
import org.osgi.service.packageadmin.PackageAdmin;
28
import org.osgi.service.startlevel.*;
28
import org.osgi.service.startlevel.StartLevel;
29
29
30
public class ConfigurationActivator implements BundleActivator, IBundleGroupProvider, IConfigurationConstants {
30
public class ConfigurationActivator implements BundleActivator, IBundleGroupProvider, IConfigurationConstants {
31
31
Lines 87-92 public class ConfigurationActivator implements BundleActivator, IBundleGroupProv Link Here
87
		registerBundleGroupProvider();
87
		registerBundleGroupProvider();
88
	}
88
	}
89
	
89
	
90
91
	public static Object getService(BundleContext context, Class clazz) {
92
		if (context == null)
93
			return null;
94
		ServiceReference reference = context.getServiceReference(clazz);
95
		if (reference == null)
96
			return null;
97
		Object result = context.getService(reference);
98
		context.ungetService(reference);
99
		return result;
100
	}
101
90
	/**
102
	/**
91
	 * Returns whether the update configurator should be doing its own reconciling work
103
	 * Returns whether the update configurator should be doing its own reconciling work
92
	 */
104
	 */
Lines 97-102 public class ConfigurationActivator implements BundleActivator, IBundleGroupProv Link Here
97
	}
109
	}
98
110
99
	private void registerBundleGroupProvider() {
111
	private void registerBundleGroupProvider() {
112
		// don't register if p2 is present, defer to them.
113
		if (!isReconciling())
114
			return;
100
		final String serviceName = IBundleGroupProvider.class.getName();
115
		final String serviceName = IBundleGroupProvider.class.getName();
101
		try {
116
		try {
102
			//don't register the service if this bundle has already registered it declaratively
117
			//don't register the service if this bundle has already registered it declaratively

Return to bug 236709