diff options
author | John Arthorne | 2010-02-23 22:39:50 +0000 |
---|---|---|
committer | John Arthorne | 2010-02-23 22:39:50 +0000 |
commit | c6d7628d9c64f0c3eac2bc944dfbf93276a78424 (patch) | |
tree | 2a51e302fdb2f17ad7fd968731d6d6b6c1cd8a05 /bundles/org.eclipse.equinox.p2.updatechecker | |
parent | 949f0639af3f31c73bec885843c445006a9b427c (diff) | |
download | rt.equinox.p2-c6d7628d9c64f0c3eac2bc944dfbf93276a78424.tar.gz rt.equinox.p2-c6d7628d9c64f0c3eac2bc944dfbf93276a78424.tar.xz rt.equinox.p2-c6d7628d9c64f0c3eac2bc944dfbf93276a78424.zip |
Bug 303700 - Update checker should use DS and an agent service factory
Diffstat (limited to 'bundles/org.eclipse.equinox.p2.updatechecker')
7 files changed, 49 insertions, 55 deletions
diff --git a/bundles/org.eclipse.equinox.p2.updatechecker/.project b/bundles/org.eclipse.equinox.p2.updatechecker/.project index 2ad31f02c..c6151439a 100644 --- a/bundles/org.eclipse.equinox.p2.updatechecker/.project +++ b/bundles/org.eclipse.equinox.p2.updatechecker/.project @@ -25,6 +25,11 @@ <arguments> </arguments> </buildCommand> + <buildCommand> + <name>org.eclipse.pde.ds.core.builder</name> + <arguments> + </arguments> + </buildCommand> </buildSpec> <natures> <nature>org.eclipse.pde.PluginNature</nature> diff --git a/bundles/org.eclipse.equinox.p2.updatechecker/META-INF/MANIFEST.MF b/bundles/org.eclipse.equinox.p2.updatechecker/META-INF/MANIFEST.MF index 5a2850d66..e13001822 100644 --- a/bundles/org.eclipse.equinox.p2.updatechecker/META-INF/MANIFEST.MF +++ b/bundles/org.eclipse.equinox.p2.updatechecker/META-INF/MANIFEST.MF @@ -5,11 +5,11 @@ Bundle-Name: %pluginName Bundle-Vendor: %providerName Bundle-Localization: plugin Bundle-Version: 1.1.0.qualifier -Bundle-Activator: org.eclipse.equinox.internal.p2.updatechecker.Activator Import-Package: org.eclipse.equinox.internal.p2.core.helpers, org.eclipse.equinox.internal.provisional.p2.director, org.eclipse.equinox.internal.provisional.p2.metadata, org.eclipse.equinox.p2.core, + org.eclipse.equinox.p2.core.spi, org.eclipse.equinox.p2.engine, org.eclipse.equinox.p2.metadata, org.eclipse.equinox.p2.metadata.query, @@ -24,3 +24,5 @@ Bundle-RequiredExecutionEnvironment: J2SE-1.5, Export-Package: org.eclipse.equinox.internal.p2.updatechecker;x-internal:=true, org.eclipse.equinox.internal.provisional.p2.updatechecker;x-friends:="org.eclipse.equinox.p2.ui.sdk.scheduler" Require-Bundle: org.eclipse.equinox.common;bundle-version="[3.3.0,4.0)" +Service-Component: OSGI-INF/updatechecker.xml +Bundle-ActivationPolicy: lazy diff --git a/bundles/org.eclipse.equinox.p2.updatechecker/OSGI-INF/updatechecker.xml b/bundles/org.eclipse.equinox.p2.updatechecker/OSGI-INF/updatechecker.xml new file mode 100644 index 000000000..97a3e7887 --- /dev/null +++ b/bundles/org.eclipse.equinox.p2.updatechecker/OSGI-INF/updatechecker.xml @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="UTF-8"?> +<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" name="org.eclipse.equinox.p2.updatechecker"> + <implementation class="org.eclipse.equinox.internal.p2.updatechecker.UpdateCheckerComponent"/> + <service> + <provide interface="org.eclipse.equinox.p2.core.spi.IAgentServiceFactory"/> + </service> + <property name="p2.agent.servicename" type="String" value="org.eclipse.equinox.internal.provisional.p2.updatechecker.IUpdateChecker"/> +</scr:component>
\ No newline at end of file diff --git a/bundles/org.eclipse.equinox.p2.updatechecker/build.properties b/bundles/org.eclipse.equinox.p2.updatechecker/build.properties index ca5030900..c15f3da6f 100644 --- a/bundles/org.eclipse.equinox.p2.updatechecker/build.properties +++ b/bundles/org.eclipse.equinox.p2.updatechecker/build.properties @@ -1,19 +1,10 @@ -############################################################################### -# Copyright (c) 2005, 2007 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 -# http://www.eclipse.org/legal/epl-v10.html -# -# Contributors: -# IBM Corporation - initial API and implementation -############################################################################### -source.. = src/ output.. = bin/ bin.includes = META-INF/,\ .,\ about.html,\ - plugin.properties + plugin.properties,\ + OSGI-INF/ src.includes = about.html -javacTarget=jsr14 -javacSource=1.5 +javacSource = 1.5 +javacTarget = jsr14 +source.. = src/ diff --git a/bundles/org.eclipse.equinox.p2.updatechecker/src/org/eclipse/equinox/internal/p2/updatechecker/Activator.java b/bundles/org.eclipse.equinox.p2.updatechecker/src/org/eclipse/equinox/internal/p2/updatechecker/Activator.java deleted file mode 100644 index 3bb8a9d6e..000000000 --- a/bundles/org.eclipse.equinox.p2.updatechecker/src/org/eclipse/equinox/internal/p2/updatechecker/Activator.java +++ /dev/null @@ -1,39 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007, 2008 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 - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.equinox.internal.p2.updatechecker; - -import org.eclipse.equinox.internal.p2.core.helpers.ServiceHelper; -import org.eclipse.equinox.internal.provisional.p2.updatechecker.IUpdateChecker; -import org.eclipse.equinox.p2.core.IProvisioningAgent; -import org.osgi.framework.BundleActivator; -import org.osgi.framework.BundleContext; - -/** - * Activator class that registers the update checker service. - */ -public class Activator implements BundleActivator { - public static final String ID = "org.eclipse.equinox.p2.updatechecker"; //$NON-NLS-1$ - private static BundleContext context; - - public static BundleContext getContext() { - return context; - } - - public void start(BundleContext bundleContext) throws Exception { - context = bundleContext; - IProvisioningAgent agent = (IProvisioningAgent) ServiceHelper.getService(bundleContext, IProvisioningAgent.SERVICE_NAME); - agent.registerService(IUpdateChecker.SERVICE_NAME, new UpdateChecker(agent)); - } - - public void stop(BundleContext bundleContext) throws Exception { - context = null; - } -} diff --git a/bundles/org.eclipse.equinox.p2.updatechecker/src/org/eclipse/equinox/internal/p2/updatechecker/UpdateChecker.java b/bundles/org.eclipse.equinox.p2.updatechecker/src/org/eclipse/equinox/internal/p2/updatechecker/UpdateChecker.java index 03a57da01..5fecf3b97 100644 --- a/bundles/org.eclipse.equinox.p2.updatechecker/src/org/eclipse/equinox/internal/p2/updatechecker/UpdateChecker.java +++ b/bundles/org.eclipse.equinox.p2.updatechecker/src/org/eclipse/equinox/internal/p2/updatechecker/UpdateChecker.java @@ -88,7 +88,7 @@ public class UpdateChecker implements IUpdateChecker { } catch (InterruptedException e) { // nothing } catch (Exception e) { - LogHelper.log(new Status(IStatus.ERROR, Activator.ID, "Exception in update check thread", e)); //$NON-NLS-1$ + LogHelper.log(new Status(IStatus.ERROR, UpdateCheckerComponent.BUNDLE_ID, "Exception in update check thread", e)); //$NON-NLS-1$ } } } diff --git a/bundles/org.eclipse.equinox.p2.updatechecker/src/org/eclipse/equinox/internal/p2/updatechecker/UpdateCheckerComponent.java b/bundles/org.eclipse.equinox.p2.updatechecker/src/org/eclipse/equinox/internal/p2/updatechecker/UpdateCheckerComponent.java new file mode 100644 index 000000000..e5c4e4d94 --- /dev/null +++ b/bundles/org.eclipse.equinox.p2.updatechecker/src/org/eclipse/equinox/internal/p2/updatechecker/UpdateCheckerComponent.java @@ -0,0 +1,27 @@ +/******************************************************************************* + * Copyright (c) 2010 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 + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ + +package org.eclipse.equinox.internal.p2.updatechecker; + +import org.eclipse.equinox.p2.core.IProvisioningAgent; +import org.eclipse.equinox.p2.core.spi.IAgentServiceFactory; + +/** + * Component for instantiating update checker service instances. + */ +public class UpdateCheckerComponent implements IAgentServiceFactory { + public static final String BUNDLE_ID = "org.eclipse.equinox.p2.updatechecker"; //$NON-NLS-1$ + + public Object createService(IProvisioningAgent agent) { + return new UpdateChecker(agent); + } + +} |