|
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 |