diff --git a/log/pom.xml b/log/pom.xml index 70b132a877..614f5a2743 100644 --- a/log/pom.xml +++ b/log/pom.xml @@ -20,7 +20,7 @@ org.apache.felix felix-parent - 6 + 9 ../pom/pom.xml 4.0.0 @@ -49,6 +49,36 @@ org.osgi osgi.core 6.0.0 + provided + + + org.osgi + org.osgi.namespace.service + 1.0.0 + + + org.osgi + osgi.annotation + 8.1.0 + true + + + org.osgi + org.osgi.service.component.annotations + 1.5.1 + true + + + org.osgi + org.osgi.service.cm + 1.6.0 + provided + + + biz.aQute.bnd + biz.aQute.bnd.annotation + 6.4.1 + true org.osgi @@ -61,24 +91,15 @@ org.apache.felix maven-bundle-plugin - 3.5.0 + 5.1.9 true org.osgi.service.log,org.osgi.service.log.admin - org.apache.felix.log - ${pom.artifactId} - ${pom.artifactId}.Activator + ${project.artifactId} The Apache Software Foundation META-INF/LICENSE=LICENSE,META-INF/NOTICE=NOTICE,META-INF/DEPENDENCIES=DEPENDENCIES - - ="org.osgi.service.log.LogReaderService";uses:="org.osgi.service.log,org.osgi.service.log.admin", - osgi.service;objectClass:List="org.osgi.service.log.LogService,org.osgi.service.log.LoggerFactory";uses:="org.osgi.service.log,org.osgi.service.log.admin", - osgi.service;objectClass:List="org.osgi.service.log.admin.LoggerAdmin";uses:="org.osgi.service.log,org.osgi.service.log.admin" - ]]> + <_reproducible>true diff --git a/log/src/main/java/org/apache/felix/log/Activator.java b/log/src/main/java/org/apache/felix/log/Activator.java index b1c0a50033..ec507bc989 100644 --- a/log/src/main/java/org/apache/felix/log/Activator.java +++ b/log/src/main/java/org/apache/felix/log/Activator.java @@ -21,10 +21,12 @@ import java.util.Dictionary; import java.util.Hashtable; +import org.osgi.annotation.bundle.Header; import org.osgi.framework.BundleActivator; import org.osgi.framework.BundleContext; import org.osgi.framework.Constants; import org.osgi.framework.ServiceRegistration; +import org.osgi.service.cm.annotations.RequireConfigurationAdmin; import org.osgi.service.log.LogLevel; import org.osgi.service.log.LogReaderService; import org.osgi.service.log.LogService; @@ -54,6 +56,8 @@ * the historic log information. The default value is false. * */ +@Header(name = Constants.BUNDLE_ACTIVATOR, value = "${@class}") +@RequireConfigurationAdmin public final class Activator implements BundleActivator { /** The name of the property that defines the maximum size of the log. */ diff --git a/log/src/main/java/org/apache/felix/log/LogReaderServiceImpl.java b/log/src/main/java/org/apache/felix/log/LogReaderServiceImpl.java index d5ce5f4823..1952ee8f81 100644 --- a/log/src/main/java/org/apache/felix/log/LogReaderServiceImpl.java +++ b/log/src/main/java/org/apache/felix/log/LogReaderServiceImpl.java @@ -23,6 +23,8 @@ import java.util.List; import java.util.Vector; +import org.osgi.annotation.bundle.Capability; +import org.osgi.namespace.service.ServiceNamespace; import org.osgi.service.log.LogEntry; import org.osgi.service.log.LogListener; import org.osgi.service.log.LogReaderService; @@ -37,6 +39,11 @@ * notifications about {@link org.osgi.service.log.LogEntry} objects when they are created * through the {@link org.osgi.service.log.LogService}. */ +@Capability( + namespace = ServiceNamespace.SERVICE_NAMESPACE, + attribute = { "objectClass:List=\"org.osgi.service.log.LogReaderService\"" }, + uses = LogReaderService.class +) final class LogReaderServiceImpl implements LogReaderService { /** The log implementation. */ diff --git a/log/src/main/java/org/apache/felix/log/LogServiceImpl.java b/log/src/main/java/org/apache/felix/log/LogServiceImpl.java index 7a9acf3282..a58e841825 100644 --- a/log/src/main/java/org/apache/felix/log/LogServiceImpl.java +++ b/log/src/main/java/org/apache/felix/log/LogServiceImpl.java @@ -18,14 +18,22 @@ */ package org.apache.felix.log; +import org.osgi.annotation.bundle.Capability; import org.osgi.framework.Bundle; import org.osgi.framework.ServiceReference; +import org.osgi.namespace.service.ServiceNamespace; import org.osgi.service.log.LogService; import org.osgi.service.log.Logger; +import org.osgi.service.log.LoggerFactory; /** * Implementation of the OSGi {@link LogService}. */ +@Capability( + namespace = ServiceNamespace.SERVICE_NAMESPACE, + attribute = { "objectClass:List=\"org.osgi.service.log.LogService,org.osgi.service.log.LoggerFactory\"" }, + uses = {LogService.class, LoggerFactory.class} +) final class LogServiceImpl implements LogService { /** The bundle associated with this implementation. */ diff --git a/log/src/main/java/org/apache/felix/log/LoggerAdminImpl.java b/log/src/main/java/org/apache/felix/log/LoggerAdminImpl.java index aa53e37f8d..67857e9cc4 100644 --- a/log/src/main/java/org/apache/felix/log/LoggerAdminImpl.java +++ b/log/src/main/java/org/apache/felix/log/LoggerAdminImpl.java @@ -24,12 +24,19 @@ import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentMap; +import org.osgi.annotation.bundle.Capability; import org.osgi.framework.Bundle; +import org.osgi.namespace.service.ServiceNamespace; import org.osgi.service.log.FormatterLogger; import org.osgi.service.log.Logger; import org.osgi.service.log.admin.LoggerAdmin; import org.osgi.service.log.admin.LoggerContext; +@Capability( + namespace = ServiceNamespace.SERVICE_NAMESPACE, + attribute = { "objectClass:List=\"org.osgi.service.log.admin.LoggerAdmin\"" }, + uses = LoggerAdmin.class +) public class LoggerAdminImpl implements LoggerAdmin { private final Log m_log;