Skip to content

Commit

Permalink
Move org.eclipse.equinox.event to use automatic manifest generation
Browse files Browse the repository at this point in the history
This enable the new automatic manifest generation for
org.eclipse.equinox.event and use annotations for the component.
  • Loading branch information
laeubi committed Apr 4, 2023
1 parent 1d3fd2d commit 773882e
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 59 deletions.
14 changes: 2 additions & 12 deletions bundles/org.eclipse.equinox.event/.project
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,7 @@
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.ManifestBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.SchemaBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.ds.core.builder</name>
<name>org.eclipse.pde.BndBuilder</name>
<arguments>
</arguments>
</buildCommand>
Expand All @@ -32,7 +22,7 @@
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.pde.PluginNature</nature>
<nature>org.eclipse.pde.BndNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.pde.api.tools.apiAnalysisNature</nature>
</natures>
Expand Down
28 changes: 0 additions & 28 deletions bundles/org.eclipse.equinox.event/META-INF/MANIFEST.MF

This file was deleted.

7 changes: 0 additions & 7 deletions bundles/org.eclipse.equinox.event/OSGI-INF/component.xml

This file was deleted.

9 changes: 0 additions & 9 deletions bundles/org.eclipse.equinox.event/build.properties
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,6 @@
# Contributors:
# IBM Corporation - initial API and implementation
###############################################################################
bin.includes = META-INF/,\
plugin*.properties,\
about.html,\
.,\
OSGI-INF/component.xml,\
OSGI-INF/
output.. = bin/
src.includes = about.html
source.. = src/

## Configuration for TCK tests to execute for this project
pom.model.property.tck.artifact = org.osgi.test.cases.event
18 changes: 18 additions & 0 deletions bundles/org.eclipse.equinox.event/pde.bnd
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
Bundle-Name: %bundleName
Bundle-Version: 1.6.200.qualifier
Bundle-SymbolicName: org.eclipse.equinox.event
Bundle-Vendor: %bundleVendor
Bundle-Localization: plugin
Bundle-ActivationPolicy: lazy
Automatic-Module-Name: org.eclipse.equinox.event
Export-Package: org.eclipse.equinox.internal.event;x-internal:=true, \
org.eclipse.equinox.internal.event.mapper;x-internal:=true

-dsannotations-options: version;maximum=1.3
-runee: JavaSE-1.8
-includeresource: plugin.properties,\
about.html

-buildpath: org.eclipse.osgi, \
org.osgi.service.event

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2009, 2018 IBM Corporation and others.
* Copyright (c) 2009, 2023 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
Expand All @@ -10,25 +10,31 @@
*
* Contributors:
* IBM Corporation - initial API and implementation
* Christoph Läubrich - switch to annotations
*******************************************************************************/
package org.eclipse.equinox.internal.event;

import org.eclipse.equinox.internal.event.mapper.EventRedeliverer;
import org.osgi.annotation.bundle.Capability;
import org.osgi.framework.BundleContext;
import org.osgi.service.event.Event;
import org.osgi.service.event.EventAdmin;
import org.osgi.service.component.annotations.*;
import org.osgi.service.event.*;

@Component(service = EventAdmin.class)
@Capability(namespace = "osgi.implementation", name = EventConstants.EVENT_ADMIN_IMPLEMENTATION, uses = Event.class, version = EventConstants.EVENT_ADMIN_SPECIFICATION_VERSION)
public class EventComponent implements EventAdmin {
private EventRedeliverer eventRedeliverer;
private EventAdminImpl eventAdmin;

@Activate
void activate(BundleContext context) {
eventAdmin = new EventAdminImpl(context);
eventAdmin.start();
eventRedeliverer = new EventRedeliverer(context, eventAdmin);
eventRedeliverer.open();
}

@Deactivate
void deactivate(BundleContext context) {
eventRedeliverer.close();
eventAdmin.stop();
Expand Down

0 comments on commit 773882e

Please sign in to comment.