Skip to content

Commit

Permalink
Add a component property type for Agentservice name
Browse files Browse the repository at this point in the history
  • Loading branch information
laeubi committed Mar 17, 2024
1 parent e0ce87e commit a9a5013
Show file tree
Hide file tree
Showing 12 changed files with 64 additions and 70 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
dsVersion=V1_3
dsVersion=V1_4
eclipse.preferences.version=1
enabled=true
generateBundleActivationPolicyLazy=true
Expand Down
2 changes: 1 addition & 1 deletion bundles/org.eclipse.equinox.p2.core/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.equinox.p2.core;singleton:=true
Bundle-Version: 2.11.0.qualifier
Bundle-Version: 2.12.0.qualifier
Bundle-Activator: org.eclipse.equinox.internal.p2.core.Activator
Bundle-Vendor: %providerName
Bundle-Localization: plugin
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,15 @@

import org.eclipse.equinox.internal.provisional.p2.core.eventbus.IProvisioningEventBus;
import org.eclipse.equinox.p2.core.IProvisioningAgent;
import org.eclipse.equinox.p2.core.spi.AgentServicename;
import org.eclipse.equinox.p2.core.spi.IAgentServiceFactory;
import org.osgi.service.component.annotations.Component;

/**
* Factory for creating {@link IProvisioningEventBus} instances.
*/
@Component(service = IAgentServiceFactory.class, property = IAgentServiceFactory.PROP_CREATED_SERVICE_NAME + "="
+ IProvisioningEventBus.SERVICE_NAME, name = "org.eclipse.equinox.p2.core.eventbus")
@Component(service = IAgentServiceFactory.class, name = "org.eclipse.equinox.p2.core.eventbus")
@AgentServicename(IProvisioningEventBus.class)
public class EventBusComponent implements IAgentServiceFactory {
@Override
public Object createService(IProvisioningAgent agent) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/*******************************************************************************
* Copyright (c) 2024 Christoph Läubrich and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*
* Contributors:
* Christoph Läubrich - initial API and implementation
*******************************************************************************/
package org.eclipse.equinox.p2.core.spi;

import static java.lang.annotation.ElementType.TYPE;
import static java.lang.annotation.RetentionPolicy.CLASS;

import java.lang.annotation.Retention;
import java.lang.annotation.Target;
import org.osgi.service.component.annotations.ComponentPropertyType;

/**
* This component property type can be used to annotate a declarative service
* component that provides an {@link IAgentServiceFactory} to provides the
* required {@link IAgentServiceFactory#PROP_CREATED_SERVICE_NAME}.
*
* @since 2.12
*/
@Retention(CLASS)
@Target(TYPE)
@ComponentPropertyType
public @interface AgentServicename {

public static final String PREFIX_ = "p2."; //$NON-NLS-1$

Class<?> value();

}
47 changes: 0 additions & 47 deletions bundles/org.eclipse.equinox.p2.engine/.settings/.api_filters

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
dsVersion=V1_4
eclipse.preferences.version=1
enabled=true
generateBundleActivationPolicyLazy=true
path=OSGI-INF
validationErrorLevel=error
validationErrorLevel.missingImplicitUnbindMethod=error
5 changes: 3 additions & 2 deletions bundles/org.eclipse.equinox.p2.engine/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.equinox.p2.engine;singleton:=true
Bundle-Version: 2.10.0.qualifier
Bundle-Version: 2.10.100.qualifier
Bundle-Activator: org.eclipse.equinox.internal.p2.engine.EngineActivator
Bundle-Vendor: %providerName
Bundle-Localization: plugin
Expand Down Expand Up @@ -30,7 +30,8 @@ Require-Bundle: org.eclipse.equinox.common,
Eclipse-RegisterBuddy: org.eclipse.equinox.p2.metadata.repository
Bundle-RequiredExecutionEnvironment: JavaSE-17
Bundle-ActivationPolicy: lazy
Service-Component: OSGI-INF/profileRegistry.xml, OSGI-INF/engine.xml
Service-Component: OSGI-INF/org.eclipse.equinox.p2.engine.registry.xml,
OSGI-INF/org.eclipse.equinox.p2.engine.xml
Import-Package: javax.xml.parsers,
org.bouncycastle.openpgp;version="1.65.0",
org.eclipse.core.internal.preferences,
Expand Down
1 change: 1 addition & 0 deletions bundles/org.eclipse.equinox.p2.engine/OSGI-INF/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/*.xml
8 changes: 0 additions & 8 deletions bundles/org.eclipse.equinox.p2.engine/OSGI-INF/engine.xml

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,24 @@
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*
*
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
package org.eclipse.equinox.internal.p2.engine;

import org.eclipse.equinox.p2.core.IProvisioningAgent;
import org.eclipse.equinox.p2.core.spi.AgentServicename;
import org.eclipse.equinox.p2.core.spi.IAgentServiceFactory;
import org.eclipse.equinox.p2.engine.IEngine;
import org.osgi.service.component.annotations.Component;

/**
* Component that provides a factory that can create and initialize
* {@link IEngine} instances.
*/
@Component(name = "org.eclipse.equinox.p2.engine", service = IAgentServiceFactory.class)
@AgentServicename(IEngine.class)
public class EngineComponent implements IAgentServiceFactory {

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,16 @@
import org.eclipse.equinox.internal.provisional.p2.core.eventbus.IProvisioningEventBus;
import org.eclipse.equinox.p2.core.IAgentLocation;
import org.eclipse.equinox.p2.core.IProvisioningAgent;
import org.eclipse.equinox.p2.core.spi.AgentServicename;
import org.eclipse.equinox.p2.core.spi.IAgentServiceFactory;
import org.eclipse.equinox.p2.engine.IProfileRegistry;
import org.osgi.service.component.annotations.Component;

/**
* Instantiates default instances of {@link IProfileRegistry}.
*/
@Component(name = "org.eclipse.equinox.p2.engine.registry", service = IAgentServiceFactory.class)
@AgentServicename(IProfileRegistry.class)
public class ProfileRegistryComponent implements IAgentServiceFactory {

@Override
Expand Down

0 comments on commit a9a5013

Please sign in to comment.