Renamed @Service annotation into @Component annotation.
Added missing "name" attribute in some dependencies.
git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@995219 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/dependencymanager/annotation/src/main/java/org/apache/felix/dm/annotation/api/BundleDependency.java b/dependencymanager/annotation/src/main/java/org/apache/felix/dm/annotation/api/BundleDependency.java
index c9911fa..80dd095 100644
--- a/dependencymanager/annotation/src/main/java/org/apache/felix/dm/annotation/api/BundleDependency.java
+++ b/dependencymanager/annotation/src/main/java/org/apache/felix/dm/annotation/api/BundleDependency.java
@@ -62,4 +62,14 @@
* the service properties.
*/
boolean propagate() default false;
+
+ /**
+ * The name used when dynamically configuring this dependency from the init method.
+ * Specifying this attribute allows to dynamically configure the dependency
+ * <code>filter</code> and <code>required</code> flag from the Service's init method.
+ * All unnamed dependencies will be injected before the init() method; so from the init() method, you can
+ * then pick up whatever information needed from already injected (unnamed) dependencies, and configure dynamically
+ * your named dependencies, which will then be calculated once the init() method returns.
+ */
+ String name() default "";
}
diff --git a/dependencymanager/annotation/src/main/java/org/apache/felix/dm/annotation/api/Component.java b/dependencymanager/annotation/src/main/java/org/apache/felix/dm/annotation/api/Component.java
new file mode 100644
index 0000000..d2aa55c
--- /dev/null
+++ b/dependencymanager/annotation/src/main/java/org/apache/felix/dm/annotation/api/Component.java
@@ -0,0 +1,180 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.felix.dm.annotation.api;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * Annotates an OSGi Component class with its dependencies. Components are the main building
+ * blocks for OSGi applications. They can publish themselves as a service, and/or they can have
+ * dependencies. These dependencies will influence their life cycle as component will only be
+ * activated when all required dependencies are available.
+ * By default, all directly implemented interfaces are registered into the OSGi registry,
+ * and the component is instantiated automatically, when the component bundle is started and
+ * when the component dependencies are available. If you need to take control of when and how
+ * much component instances must be created, then you can use the <code>factorySet</code>
+ * annotation attribute.<p>
+ * If a <code>factorySet</code> attribute is set, the component is not started automatically
+ * during bundle startup, and a <code>java.util.Set<Dictionary></code>
+ * object is registered into the OSGi registry on behalf of the component. This Set will act
+ * as a Factory API, and another component may use this Set and add some configuration
+ * dictionaries in it, in order to fire some component activations (there is one component
+ * instantiated per dictionary, which is passed to component instances via a configurable
+ * callback method).
+ *
+ * <h3>Usage Examples</h3>
+ *
+ * <p> Here is a sample showing a X component, which depends on a configuration dependency:<p>
+ * <blockquote>
+ *
+ * <pre>
+ * /**
+ * * This component will be activated once the bundle is started and when all required dependencies
+ * * are available.
+ * */
+ * @Component
+ * class X implements Z {
+ * @ConfigurationDependency(pid="MyPid")
+ * void configure(Dictionary conf) {
+ * // Configure or reconfigure our component.
+ * }
+ *
+ * @Start
+ * void start() {
+ * // Our component is starting and is about to be registered in the OSGi registry as a Z service.
+ * }
+ *
+ * public void doService() {
+ * // ...
+ * }
+ * }
+ * </pre>
+ * </blockquote>
+ *
+ * Here is a sample showing how a Y component may dynamically instantiate several X component instances,
+ * using the {@link #factorySet()} attribute:<p>
+ * <blockquote>
+ *
+ * <pre>
+ * /**
+ * * All component instances will be created/updated/removed by the "Y" component
+ * */
+ * @Component(factorySet="MyComponentFactory", factoryConfigure="configure")
+ * class X implements Z {
+ * void configure(Dictionary conf) {
+ * // Configure or reconfigure our component. The conf is provided by the factory,
+ * // and all public properties (which don't start with a dot) are propagated with the
+ * // service properties specified in the properties annotation attribute.
+ * }
+ *
+ * @ServiceDependency
+ * void bindOtherService(OtherService other) {
+ * // store this require dependency
+ * }
+ *
+ * @Start
+ * void start() {
+ * // Our component is starting and is about to be registered in the OSGi registry as a Z service.
+ * }
+ *
+ * public void doService() {
+ * // ...
+ * }
+ * }
+ *
+ * /**
+ * * This class will instantiate some X component instances
+ * */
+ * @Component
+ * class Y {
+ * @ServiceDependency(filter="(dm.factory.name=MyComponentFactory)")
+ * Set<Dictionary> _XFactory; // This Set acts as a Factory API for creating X component instances.
+ *
+ * @Start
+ * void start() {
+ * // Instantiate a X component instance
+ * Dictionary x1 = new Hashtable() {{ put("foo", "bar1"); }};
+ * _XFactory.add(x1);
+ *
+ * // Instantiate another X component instance
+ * Dictionary x2 = new Hashtable() {{ put("foo", "bar2"); }};
+ * _XFactory.add(x2);
+ *
+ * // Update the first X component instance
+ * x1.put("foo", "bar1_modified");
+ * _XFactory.add(x1);
+ *
+ * // Destroy x1/x2 components (Notice that invoking XFactory.clear() will destroy all X component instances).
+ * _XFactory.remove(x1);
+ * _XFactory.remove(x2);
+ * }
+ * }
+ * </pre>
+ *
+ * </blockquote>
+ */
+@Retention(RetentionPolicy.CLASS)
+@Target(ElementType.TYPE)
+public @interface Component
+{
+ /**
+ * Sets list of provided interfaces. By default, the directly implemented interfaces are provided.
+ */
+ Class<?>[] provides() default {};
+
+ /**
+ * Sets list of provided service properties.
+ */
+ Property[] properties() default {};
+
+ /**
+ * Returns the name of the <code>Factory Set</code> used to dynamically instantiate this component.
+ * When you set this attribute, a <code>java.util.Set<java.lang.Dictionary></code> OSGi Service will
+ * be provided with a <code>dm.factory.name</code> service property matching your specified <code>factorySet</code> attribute.
+ * This Set will be provided once the component bundle is started, even if required dependencies are not available, and the
+ * Set will be unregistered from the OSGi registry once the component bundle is stopped or being updated.<p>
+ * So, basically, another component may then be injected with this set in order to dynamically instantiate some component instances:
+ * <ul>
+ * <li> Each time a new Dictionary is added into the Set, then a new instance of the annotated component will be instantiated.</li>
+ * <li> Each time an existing Dictionary is re-added into the Set, then the corresponding component instance will be updated.</li>
+ * <li> Each time an existing Dictionary is removed from the Set, then the corresponding component instance will be destroyed.</li>
+ * </ul>
+ *
+ * <p>The dictionary registered in the Set will be provided to the created component instance using a callback method that you can
+ * optionally specify in the {@link Component#factoryConfigure()} attribute. Each public properties from that dictionary
+ * (which don't start with a dot) will be propagated along with the annotated component service properties.
+ */
+ String factorySet() default "";
+
+ /**
+ * Sets "configure" callback method name to be called with the factory configuration. This attribute only makes sense if the
+ * {@link #factorySet()} attribute is used. If specified, then this attribute references a callback method, which is called
+ * for providing the configuration supplied by the factory that instantiated this component. The current component service properties will be
+ * also updated with all public properties (which don't start with a dot).
+ */
+ String factoryConfigure() default "";
+
+ /**
+ * Sets the static method used to create the components implementation instance.
+ */
+ String factoryMethod() default "";
+}
diff --git a/dependencymanager/annotation/src/main/java/org/apache/felix/dm/annotation/api/Property.java b/dependencymanager/annotation/src/main/java/org/apache/felix/dm/annotation/api/Property.java
index c87d7e8..5c701a4 100644
--- a/dependencymanager/annotation/src/main/java/org/apache/felix/dm/annotation/api/Property.java
+++ b/dependencymanager/annotation/src/main/java/org/apache/felix/dm/annotation/api/Property.java
@@ -25,7 +25,7 @@
/**
* Annotation used to describe a property key-value pair. It is used when
- * declaring {@link Service#properties()} attribute.
+ * declaring {@link Component#properties()} attribute.
*/
@Retention(RetentionPolicy.CLASS)
@Target( { ElementType.ANNOTATION_TYPE })
diff --git a/dependencymanager/annotation/src/main/java/org/apache/felix/dm/annotation/api/ResourceDependency.java b/dependencymanager/annotation/src/main/java/org/apache/felix/dm/annotation/api/ResourceDependency.java
index 77090ee..43abe42 100644
--- a/dependencymanager/annotation/src/main/java/org/apache/felix/dm/annotation/api/ResourceDependency.java
+++ b/dependencymanager/annotation/src/main/java/org/apache/felix/dm/annotation/api/ResourceDependency.java
@@ -64,4 +64,14 @@
* @return
*/
boolean propagate() default false;
+
+ /**
+ * The name used when dynamically configuring this dependency from the init method.
+ * Specifying this attribute allows to dynamically configure the dependency
+ * <code>filter</code> and <code>required</code> flag from the Service's init method.
+ * All unnamed dependencies will be injected before the init() method; so from the init() method, you can
+ * then pick up whatever information needed from already injected (unnamed) dependencies, and configure dynamically
+ * your named dependencies, which will then be calculated once the init() method returns.
+ */
+ String name() default "";
}
diff --git a/dependencymanager/annotation/src/main/java/org/apache/felix/dm/annotation/api/Service.java b/dependencymanager/annotation/src/main/java/org/apache/felix/dm/annotation/api/Service.java
deleted file mode 100644
index 0c90c9c..0000000
--- a/dependencymanager/annotation/src/main/java/org/apache/felix/dm/annotation/api/Service.java
+++ /dev/null
@@ -1,177 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.dm.annotation.api;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-/**
- * Annotates an OSGi Service class with its dependencies.
- * By default, all directly implemented interfaces are registered into the OSGi registry,
- * and the Service is instantiated automatically, when the Service' bundle is started and
- * when the Service dependencies are available. If you need to take control of when and how
- * much Service instances must be created, then you can use the <code>factorySet</code>
- * Service attribute.<p>
- * If a <code>factorySet</code> attribute is set, the Service is not started automatically
- * during bundle startup, and a <code>java.util.Set<Dictionary></code>
- * object is registered into the OSGi registry on behalf of the Service. This Set will act
- * as a Factory API, and another component may use this Set and add some configuration
- * dictionaries in it, in order to fire some Service activations (there is one Service
- * instantiated per dictionary, which is passed to Service instances via a configurable
- * callback method).
- *
- * <h3>Usage Examples</h3>
- *
- * <p> Here is a sample showing a X service, which depends on a configuration dependency:<p>
- * <blockquote>
- *
- * <pre>
- * /**
- * * This Service will be activated once the bundle is started and when all required dependencies
- * * are available.
- * */
- * @Service
- * class X implements Z {
- * @ConfigurationDependency(pid="MyPid")
- * void configure(Dictionary conf) {
- * // Configure or reconfigure our service.
- * }
- *
- * @Start
- * void start() {
- * // Our Service is starting and is about to be registered in the OSGi registry as a Z service.
- * }
- *
- * public void doService() {
- * // ...
- * }
- * }
- * </pre>
- * </blockquote>
- *
- * Here is a sample showing how a Y service may dynamically instantiate several X Service instances,
- * using the {@link #factorySet()} attribute:<p>
- * <blockquote>
- *
- * <pre>
- * /**
- * * All Service instances will be created/updated/removed by the "Y" Service
- * */
- * @Service(factorySet="MyServiceFactory", factoryConfigure="configure")
- * class X implements Z {
- * void configure(Dictionary conf) {
- * // Configure or reconfigure our service. The conf is provided by the factory,
- * // and all public properties (which don't start with a dot) are propagated with the
- * // Service properties specified in the properties's Service attribute.
- * }
- *
- * @ServiceDependency
- * void bindOtherService(OtherService other) {
- * // store this require dependency
- * }
- *
- * @Start
- * void start() {
- * // Our Service is starting and is about to be registered in the OSGi registry as a Z service.
- * }
- *
- * public void doService() {
- * // ...
- * }
- * }
- *
- * /**
- * * This class will instantiate some X Service instances
- * */
- * @Service
- * class Y {
- * @ServiceDependency(filter="(dm.factory.name=MyServiceFactory)")
- * Set<Dictionary> _XFactory; // This Set acts as a Factory API for creating X Service instances.
- *
- * @Start
- * void start() {
- * // Instantiate a X Service instance
- * Dictionary x1 = new Hashtable() {{ put("foo", "bar1"); }};
- * _XFactory.add(x1);
- *
- * // Instantiate another X Service instance
- * Dictionary x2 = new Hashtable() {{ put("foo", "bar2"); }};
- * _XFactory.add(x2);
- *
- * // Update the first X Service instance
- * x1.put("foo", "bar1_modified");
- * _XFactory.add(x1);
- *
- * // Destroy X Services (Notice that invoking XFactory.clear() will destroy all X Service instances)
- * _XFactory.remove(x1);
- * _XFactory.remove(x2);
- * }
- * }
- * </pre>
- *
- * </blockquote>
- */
-@Retention(RetentionPolicy.CLASS)
-@Target(ElementType.TYPE)
-public @interface Service
-{
- /**
- * Sets list of provided interfaces. By default, the directly implemented interfaces are provided.
- */
- Class<?>[] provides() default {};
-
- /**
- * Sets list of provided service properties.
- */
- Property[] properties() default {};
-
- /**
- * Returns the name of the <code>Factory Set</code> used to dynamically instantiate this Service.
- * When you set this attribute, a <code>java.util.Set<java.lang.Dictionary></code> Service will
- * be provided with a <code>dm.factory.name</code> service property matching your specified <code>factorySet</code> attribute.
- * This Set will be provided once the Service's bundle is started, even if required dependencies are not available, and the
- * Set will be unregistered from the OSGi registry once the Service's bundle is stopped or being updated.<p>
- * So, basically, another component may then be injected with this set in order to dynamically instantiate some Service instances:
- * <ul>
- * <li> Each time a new Dictionary is added into the Set, then a new instance of the annotated service will be instantiated.</li>
- * <li> Each time an existing Dictionary is re-added into the Set, then the corresponding Service instance will be updated.</li>
- * <li> Each time an existing Dictionary is removed from the Set, then the corresponding Service instance will be destroyed.</li>
- * </ul>
- *
- * <p>The dictionary registered in the Set will be provided to the created Service instance using a callback method that you can
- * optionally specify in the {@link Service#factoryConfigure()} attribute. Each public properties from that dictionary
- * (which don't start with a dot) will be propagated along with the annotated Service properties.
- */
- String factorySet() default "";
-
- /**
- * Sets "configure" callback method name to be called with the factory configuration. This attribute only makes sense if the
- * {@link #factorySet()} attribute is used. If specified, then this attribute references a Service callback method, which is called
- * for providing the configuration supplied by the factory that instantiated this Service. The current Service properties will be
- * also updated with all public properties (which don't start with a dot).
- */
- String factoryConfigure() default "";
-
- /**
- * Sets the static method used to create the Service implementation instance.
- */
- String factoryMethod() default "";
-}
diff --git a/dependencymanager/annotation/src/main/java/org/apache/felix/dm/annotation/plugin/bnd/AnnotationCollector.java b/dependencymanager/annotation/src/main/java/org/apache/felix/dm/annotation/plugin/bnd/AnnotationCollector.java
index 897f26f..ec5fd7d 100644
--- a/dependencymanager/annotation/src/main/java/org/apache/felix/dm/annotation/plugin/bnd/AnnotationCollector.java
+++ b/dependencymanager/annotation/src/main/java/org/apache/felix/dm/annotation/plugin/bnd/AnnotationCollector.java
@@ -39,7 +39,7 @@
import org.apache.felix.dm.annotation.api.LifecycleController;
import org.apache.felix.dm.annotation.api.ResourceAdapterService;
import org.apache.felix.dm.annotation.api.ResourceDependency;
-import org.apache.felix.dm.annotation.api.Service;
+import org.apache.felix.dm.annotation.api.Component;
import org.apache.felix.dm.annotation.api.ServiceDependency;
import org.apache.felix.dm.annotation.api.Start;
import org.apache.felix.dm.annotation.api.Stop;
@@ -64,7 +64,7 @@
private final static String A_COMPOSITION = "L" + Composition.class.getName().replace('.', '/') + ";";
private final static String A_LIFCLE_CTRL = "L" + LifecycleController.class.getName().replace('.', '/')+ ";";
- private final static String A_SERVICE = "L" + Service.class.getName().replace('.', '/') + ";";
+ private final static String A_COMPONENT = "L" + Component.class.getName().replace('.', '/') + ";";
private final static String A_SERVICE_DEP = "L" + ServiceDependency.class.getName().replace('.', '/') + ";";
private final static String A_CONFIGURATION_DEPENDENCY = "L" + ConfigurationDependency.class.getName().replace('.', '/') + ";";
private final static String A_BUNDLE_DEPENDENCY = "L" + BundleDependency.class.getName().replace('.', '/') + ";";
@@ -177,9 +177,9 @@
{
m_reporter.trace("Parsed annotation: %s", annotation);
- if (annotation.getName().equals(A_SERVICE))
+ if (annotation.getName().equals(A_COMPONENT))
{
- parseServiceAnnotation(annotation);
+ parseComponentAnnotation(annotation);
}
else if (annotation.getName().equals(A_ASPECT_SERVICE))
{
@@ -243,13 +243,9 @@
}
}
- /**
- * Parses a Service annotation.
- * @param annotation The Service annotation.
- */
- private void parseServiceAnnotation(Annotation annotation)
+ private void parseComponentAnnotation(Annotation annotation)
{
- EntryWriter writer = new EntryWriter(EntryType.Service);
+ EntryWriter writer = new EntryWriter(EntryType.Component);
m_writers.add(writer);
// Register previously parsed Init/Start/Stop/Destroy/Composition annotations
@@ -383,11 +379,7 @@
writer.putString(annotation, EntryParam.removed, null);
// name attribute
- writer.putString(annotation, EntryParam.name, null);
- String name = annotation.get(EntryParam.name.toString());
- if (name != null && ! m_dependencyNames.add(name)) {
- throw new IllegalArgumentException("Duplicate dependency name " + name + " in ServiceDependency annotation from class " + m_className);
- }
+ parseDependencyName(writer, annotation);
// propagate attribute
writer.putString(annotation, EntryParam.propagate, null);
@@ -642,6 +634,7 @@
writer.putString(annotation, EntryParam.required, null);
writer.putString(annotation, EntryParam.stateMask, null);
writer.putString(annotation, EntryParam.propagate, null);
+ parseDependencyName(writer, annotation);
}
private void parseRersourceDependencyAnnotation(Annotation annotation)
@@ -662,8 +655,27 @@
writer.putString(annotation, EntryParam.required, null);
writer.putString(annotation, EntryParam.propagate, null);
writer.putString(annotation, EntryParam.factoryMethod, null);
+ parseDependencyName(writer, annotation);
}
+ /**
+ * Parse the name of a given dependency.
+ * @param writer The writer where to write the dependency name
+ * @param annotation the dependency to be parsed
+ */
+ private void parseDependencyName(EntryWriter writer, Annotation annotation)
+ {
+ String name = annotation.get(EntryParam.name.toString());
+ if (name != null)
+ {
+ if(! m_dependencyNames.add(name))
+ {
+ throw new IllegalArgumentException("Duplicate dependency name " + name + " in Dependency " + annotation + " from class " + m_className);
+ }
+ writer.put(EntryParam.name, name);
+ }
+ }
+
private void parseLifecycleAnnotation(Annotation annotation)
{
Patterns.parseField(m_field, m_descriptor, Patterns.Runnable);
@@ -841,7 +853,7 @@
}
// We must have at least a Service annotation.
- checkServiceDeclared(EntryType.Service, EntryType.AspectService, EntryType.AdapterService,
+ checkServiceDeclared(EntryType.Component, EntryType.AspectService, EntryType.AdapterService,
EntryType.BundleAdapterService,
EntryType.ResourceAdapterService, EntryType.FactoryConfigurationAdapterService);
diff --git a/dependencymanager/annotation/src/main/java/org/apache/felix/dm/annotation/plugin/bnd/DescriptorGenerator.java b/dependencymanager/annotation/src/main/java/org/apache/felix/dm/annotation/plugin/bnd/DescriptorGenerator.java
index 1b9f926..6801024 100644
--- a/dependencymanager/annotation/src/main/java/org/apache/felix/dm/annotation/plugin/bnd/DescriptorGenerator.java
+++ b/dependencymanager/annotation/src/main/java/org/apache/felix/dm/annotation/plugin/bnd/DescriptorGenerator.java
@@ -27,7 +27,7 @@
import java.util.HashMap;
import java.util.Map;
-import org.apache.felix.dm.annotation.api.Service;
+import org.apache.felix.dm.annotation.api.Component;
import aQute.lib.osgi.Analyzer;
import aQute.lib.osgi.Clazz;
diff --git a/dependencymanager/annotation/src/main/java/org/apache/felix/dm/annotation/plugin/bnd/EntryType.java b/dependencymanager/annotation/src/main/java/org/apache/felix/dm/annotation/plugin/bnd/EntryType.java
index 4e0997d..7ec586a 100644
--- a/dependencymanager/annotation/src/main/java/org/apache/felix/dm/annotation/plugin/bnd/EntryType.java
+++ b/dependencymanager/annotation/src/main/java/org/apache/felix/dm/annotation/plugin/bnd/EntryType.java
@@ -5,7 +5,7 @@
*/
public enum EntryType
{
- Service,
+ Component,
AspectService,
AdapterService,
BundleAdapterService,
diff --git a/dependencymanager/runtime/src/main/java/org/apache/felix/dm/runtime/ServiceComponentBuilder.java b/dependencymanager/runtime/src/main/java/org/apache/felix/dm/runtime/AbstractBuilder.java
similarity index 89%
rename from dependencymanager/runtime/src/main/java/org/apache/felix/dm/runtime/ServiceComponentBuilder.java
rename to dependencymanager/runtime/src/main/java/org/apache/felix/dm/runtime/AbstractBuilder.java
index fb99b7a..cc70226 100644
--- a/dependencymanager/runtime/src/main/java/org/apache/felix/dm/runtime/ServiceComponentBuilder.java
+++ b/dependencymanager/runtime/src/main/java/org/apache/felix/dm/runtime/AbstractBuilder.java
@@ -18,21 +18,18 @@
*/
package org.apache.felix.dm.runtime;
-import java.util.Arrays;
-import java.util.Dictionary;
import java.util.List;
+import org.apache.felix.dm.Component;
import org.apache.felix.dm.Dependency;
import org.apache.felix.dm.DependencyManager;
-import org.apache.felix.dm.Component;
import org.osgi.framework.Bundle;
-import org.osgi.framework.BundleContext;
import org.osgi.service.log.LogService;
/**
- * The builder which creates a DependencyManager Service (a Service and all its derived classes (Aspect/Adapters).
+ * base class for all kind of DM component builders (for Component, Aspect, Adapters ...).
*/
-public abstract class ServiceComponentBuilder
+public abstract class AbstractBuilder
{
/**
* Returns the service component type.
@@ -44,7 +41,7 @@
* @param serviceMetaData the service component metadata parsed from the descriptor file.
* @param serviceDependencies the service component dependencies metadata parsed from the descriptor file.
*/
- abstract void buildService(MetaData serviceMetaData, List<MetaData> serviceDependencies, Bundle b,
+ abstract void build(MetaData serviceMetaData, List<MetaData> serviceDependencies, Bundle b,
DependencyManager dm)
throws Exception;
diff --git a/dependencymanager/runtime/src/main/java/org/apache/felix/dm/runtime/AdapterServiceBuilder.java b/dependencymanager/runtime/src/main/java/org/apache/felix/dm/runtime/AdapterServiceBuilder.java
index 60cd31b..7bf20e2 100644
--- a/dependencymanager/runtime/src/main/java/org/apache/felix/dm/runtime/AdapterServiceBuilder.java
+++ b/dependencymanager/runtime/src/main/java/org/apache/felix/dm/runtime/AdapterServiceBuilder.java
@@ -28,7 +28,7 @@
/**
* Builded called when the JSON parser find an adapter service descriptor.
*/
-public class AdapterServiceBuilder extends ServiceComponentBuilder
+public class AdapterServiceBuilder extends AbstractBuilder
{
/** The type attribute specified in the JSON descriptor */
private final static String TYPE = "AdapterService";
@@ -40,7 +40,7 @@
}
@Override
- public void buildService(MetaData srvMeta, List<MetaData> depsMeta, Bundle b, DependencyManager dm)
+ public void build(MetaData srvMeta, List<MetaData> depsMeta, Bundle b, DependencyManager dm)
throws Exception
{
Class<?> adapterImplClass = b.loadClass(srvMeta.getString(Params.impl));
diff --git a/dependencymanager/runtime/src/main/java/org/apache/felix/dm/runtime/AspectServiceBuilder.java b/dependencymanager/runtime/src/main/java/org/apache/felix/dm/runtime/AspectServiceBuilder.java
index 752b8a6..89703dd 100644
--- a/dependencymanager/runtime/src/main/java/org/apache/felix/dm/runtime/AspectServiceBuilder.java
+++ b/dependencymanager/runtime/src/main/java/org/apache/felix/dm/runtime/AspectServiceBuilder.java
@@ -26,7 +26,7 @@
import org.osgi.framework.Bundle;
import org.osgi.service.log.LogService;
-public class AspectServiceBuilder extends ServiceComponentBuilder
+public class AspectServiceBuilder extends AbstractBuilder
{
private final static String TYPE = "AspectService";
@@ -37,7 +37,7 @@
}
@Override
- public void buildService(MetaData srvMeta, List<MetaData> depsMeta, Bundle b, DependencyManager dm)
+ public void build(MetaData srvMeta, List<MetaData> depsMeta, Bundle b, DependencyManager dm)
throws Exception
{
Log.instance().log(LogService.LOG_INFO,
diff --git a/dependencymanager/runtime/src/main/java/org/apache/felix/dm/runtime/BundleAdapterServiceBuilder.java b/dependencymanager/runtime/src/main/java/org/apache/felix/dm/runtime/BundleAdapterServiceBuilder.java
index b914426..b2938da 100644
--- a/dependencymanager/runtime/src/main/java/org/apache/felix/dm/runtime/BundleAdapterServiceBuilder.java
+++ b/dependencymanager/runtime/src/main/java/org/apache/felix/dm/runtime/BundleAdapterServiceBuilder.java
@@ -25,7 +25,7 @@
import org.apache.felix.dm.Component;
import org.osgi.framework.Bundle;
-public class BundleAdapterServiceBuilder extends ServiceComponentBuilder
+public class BundleAdapterServiceBuilder extends AbstractBuilder
{
private final static String TYPE = "BundleAdapterService";
@@ -36,7 +36,7 @@
}
@Override
- public void buildService(MetaData srvMeta, List<MetaData> depsMeta, Bundle b, DependencyManager dm)
+ public void build(MetaData srvMeta, List<MetaData> depsMeta, Bundle b, DependencyManager dm)
throws Exception
{
int stateMask = srvMeta.getInt(Params.stateMask, Bundle.INSTALLED | Bundle.RESOLVED | Bundle.ACTIVE);
diff --git a/dependencymanager/runtime/src/main/java/org/apache/felix/dm/runtime/ServiceBuilder.java b/dependencymanager/runtime/src/main/java/org/apache/felix/dm/runtime/ComponentBuilder.java
similarity index 88%
rename from dependencymanager/runtime/src/main/java/org/apache/felix/dm/runtime/ServiceBuilder.java
rename to dependencymanager/runtime/src/main/java/org/apache/felix/dm/runtime/ComponentBuilder.java
index 95f04c5..de3cc65 100644
--- a/dependencymanager/runtime/src/main/java/org/apache/felix/dm/runtime/ServiceBuilder.java
+++ b/dependencymanager/runtime/src/main/java/org/apache/felix/dm/runtime/ComponentBuilder.java
@@ -28,9 +28,12 @@
import org.osgi.framework.Bundle;
import org.osgi.service.log.LogService;
-public class ServiceBuilder extends ServiceComponentBuilder
+/**
+ * Builds a DependencyManager Component.
+ */
+public class ComponentBuilder extends AbstractBuilder
{
- private final static String TYPE = "Service";
+ private final static String TYPE = "Component";
private final static String DM_FACTORY_NAME = "dm.factory.name";
@Override
@@ -40,7 +43,7 @@
}
@Override
- public void buildService(MetaData srvMeta, List<MetaData> depsMeta, Bundle b, DependencyManager dm)
+ public void build(MetaData srvMeta, List<MetaData> depsMeta, Bundle b, DependencyManager dm)
throws Exception
{
Component service = dm.createComponent();
@@ -50,7 +53,7 @@
if (factory == null)
{
Log.instance().log(LogService.LOG_INFO,
- "ServiceBuilder: building service %s with dependencies %s",
+ "ComponentBuilder: building service %s with dependencies %s",
srvMeta, depsMeta);
String impl = srvMeta.getString(Params.impl);
@@ -79,7 +82,7 @@
else
{
Log.instance().log(LogService.LOG_INFO,
- "ServiceBuilder: providing factory set for service %s with dependencies %s",
+ "ComponentBuilder: providing factory set for service %s with dependencies %s",
srvMeta, depsMeta);
// We don't instantiate the service, but instead we provide a Set in the registry.
diff --git a/dependencymanager/runtime/src/main/java/org/apache/felix/dm/runtime/DependencyManagerRuntime.java b/dependencymanager/runtime/src/main/java/org/apache/felix/dm/runtime/DependencyManagerRuntime.java
index e363e9d..5fc5410 100644
--- a/dependencymanager/runtime/src/main/java/org/apache/felix/dm/runtime/DependencyManagerRuntime.java
+++ b/dependencymanager/runtime/src/main/java/org/apache/felix/dm/runtime/DependencyManagerRuntime.java
@@ -58,7 +58,7 @@
// Instantiates our descriptor parser, and register our service builders into it.
m_parser = new DescriptorParser();
- m_parser.addBuilder(new ServiceBuilder());
+ m_parser.addBuilder(new ComponentBuilder());
m_parser.addBuilder(new AspectServiceBuilder());
m_parser.addBuilder(new AdapterServiceBuilder());
m_parser.addBuilder(new BundleAdapterServiceBuilder());
diff --git a/dependencymanager/runtime/src/main/java/org/apache/felix/dm/runtime/DescriptorParser.java b/dependencymanager/runtime/src/main/java/org/apache/felix/dm/runtime/DescriptorParser.java
index 0da39e5..6e18458 100644
--- a/dependencymanager/runtime/src/main/java/org/apache/felix/dm/runtime/DescriptorParser.java
+++ b/dependencymanager/runtime/src/main/java/org/apache/felix/dm/runtime/DescriptorParser.java
@@ -36,9 +36,9 @@
*/
public class DescriptorParser
{
- private Map<String, ServiceComponentBuilder> m_builders = new HashMap<String, ServiceComponentBuilder>();
+ private Map<String, AbstractBuilder> m_builders = new HashMap<String, AbstractBuilder>();
- public void addBuilder(ServiceComponentBuilder sb)
+ public void addBuilder(AbstractBuilder sb)
{
m_builders.put(sb.getType(), sb);
}
@@ -54,7 +54,7 @@
JSONMetaData serviceMetaData = new JSONMetaData(json);
String type = (String) json.get("type");
- ServiceComponentBuilder builder = m_builders.get(type);
+ AbstractBuilder builder = m_builders.get(type);
if (builder == null)
{
throw new IllegalArgumentException("Invalid descriptor"
@@ -71,6 +71,6 @@
}
// and Invoke the builder
- builder.buildService(serviceMetaData, serviceDependencies, b, dm);
+ builder.build(serviceMetaData, serviceDependencies, b, dm);
}
}
diff --git a/dependencymanager/runtime/src/main/java/org/apache/felix/dm/runtime/FactoryConfigurationAdapterServiceBuilder.java b/dependencymanager/runtime/src/main/java/org/apache/felix/dm/runtime/FactoryConfigurationAdapterServiceBuilder.java
index 8528214..fcab7ef 100644
--- a/dependencymanager/runtime/src/main/java/org/apache/felix/dm/runtime/FactoryConfigurationAdapterServiceBuilder.java
+++ b/dependencymanager/runtime/src/main/java/org/apache/felix/dm/runtime/FactoryConfigurationAdapterServiceBuilder.java
@@ -25,7 +25,7 @@
import org.apache.felix.dm.Component;
import org.osgi.framework.Bundle;
-public class FactoryConfigurationAdapterServiceBuilder extends ServiceComponentBuilder
+public class FactoryConfigurationAdapterServiceBuilder extends AbstractBuilder
{
private final static String TYPE = "FactoryConfigurationAdapterService";
@@ -36,7 +36,7 @@
}
@Override
- public void buildService(MetaData srvMeta, List<MetaData> depsMeta, Bundle b, DependencyManager dm)
+ public void build(MetaData srvMeta, List<MetaData> depsMeta, Bundle b, DependencyManager dm)
throws Exception
{
Class<?> implClass = b.loadClass(srvMeta.getString(Params.impl));
diff --git a/dependencymanager/runtime/src/main/java/org/apache/felix/dm/runtime/ResourceAdapterServiceBuilder.java b/dependencymanager/runtime/src/main/java/org/apache/felix/dm/runtime/ResourceAdapterServiceBuilder.java
index acac992..929dc73 100644
--- a/dependencymanager/runtime/src/main/java/org/apache/felix/dm/runtime/ResourceAdapterServiceBuilder.java
+++ b/dependencymanager/runtime/src/main/java/org/apache/felix/dm/runtime/ResourceAdapterServiceBuilder.java
@@ -25,7 +25,7 @@
import org.apache.felix.dm.Component;
import org.osgi.framework.Bundle;
-public class ResourceAdapterServiceBuilder extends ServiceComponentBuilder
+public class ResourceAdapterServiceBuilder extends AbstractBuilder
{
private final static String TYPE = "ResourceAdapterService";
@@ -36,7 +36,7 @@
}
@Override
- public void buildService(MetaData srvMeta, List<MetaData> depsMeta, Bundle b, DependencyManager dm)
+ public void build(MetaData srvMeta, List<MetaData> depsMeta, Bundle b, DependencyManager dm)
throws Exception
{
String filter = srvMeta.getString(Params.filter, null);
diff --git a/dependencymanager/runtime/src/main/java/org/apache/felix/dm/runtime/ServiceLifecycleHandler.java b/dependencymanager/runtime/src/main/java/org/apache/felix/dm/runtime/ServiceLifecycleHandler.java
index 2b22bdd..d924b2f 100644
--- a/dependencymanager/runtime/src/main/java/org/apache/felix/dm/runtime/ServiceLifecycleHandler.java
+++ b/dependencymanager/runtime/src/main/java/org/apache/felix/dm/runtime/ServiceLifecycleHandler.java
@@ -310,7 +310,6 @@
private void callbackComposites(Component service, String callback)
throws IllegalArgumentException, IllegalAccessException, InvocationTargetException
{
- Object serviceInstance = service.getService();
Object[] composites = service.getCompositionInstances();
for (Object composite: composites)
{
diff --git a/dependencymanager/samples.annotation/src/main/java/org/apache/felix/dm/samples/annotation/SpellChecker.java b/dependencymanager/samples.annotation/src/main/java/org/apache/felix/dm/samples/annotation/SpellChecker.java
index ca84602..6ebc74b 100644
--- a/dependencymanager/samples.annotation/src/main/java/org/apache/felix/dm/samples/annotation/SpellChecker.java
+++ b/dependencymanager/samples.annotation/src/main/java/org/apache/felix/dm/samples/annotation/SpellChecker.java
@@ -21,7 +21,7 @@
import java.util.concurrent.CopyOnWriteArrayList;
import org.apache.felix.dm.annotation.api.Property;
-import org.apache.felix.dm.annotation.api.Service;
+import org.apache.felix.dm.annotation.api.Component;
import org.apache.felix.dm.annotation.api.ServiceDependency;
import org.apache.felix.dm.annotation.api.Start;
import org.apache.felix.dm.annotation.api.Stop;
@@ -35,9 +35,9 @@
* To create a Dictionary Service, you have to go the the web console and define a "Dictionary Services" factory
* configuration instance, which will fire an instantiation of the corresponding dictionary service.
*/
-@Service(provides={SpellChecker.class},
- properties={@Property(name=CommandProcessor.COMMAND_SCOPE, value="dmsample.annotation"),
- @Property(name=CommandProcessor.COMMAND_FUNCTION, values={"spellcheck"})})
+@Component(provides={SpellChecker.class},
+ properties={@Property(name=CommandProcessor.COMMAND_SCOPE, value="dmsample.annotation"),
+ @Property(name=CommandProcessor.COMMAND_FUNCTION, values={"spellcheck"})})
public class SpellChecker
{
/**
diff --git a/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/adapter/AdapterTest.java b/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/adapter/AdapterTest.java
index 0c3a881..2f9b5e7 100644
--- a/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/adapter/AdapterTest.java
+++ b/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/adapter/AdapterTest.java
@@ -20,12 +20,12 @@
import java.util.Map;
-import org.apache.felix.dm.annotation.api.Service;
+import org.apache.felix.dm.annotation.api.Component;
import org.apache.felix.dm.annotation.api.Start;
import org.apache.felix.dm.annotation.api.ServiceDependency;
import org.apache.felix.dm.test.bundle.annotation.sequencer.Sequencer;
-@Service
+@Component
public class AdapterTest
{
@ServiceDependency
diff --git a/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/adapter/ServiceProvider.java b/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/adapter/ServiceProvider.java
index 1651e83..8b8b95a 100644
--- a/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/adapter/ServiceProvider.java
+++ b/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/adapter/ServiceProvider.java
@@ -19,11 +19,11 @@
package org.apache.felix.dm.test.bundle.annotation.adapter;
import org.apache.felix.dm.annotation.api.Property;
-import org.apache.felix.dm.annotation.api.Service;
+import org.apache.felix.dm.annotation.api.Component;
import org.apache.felix.dm.annotation.api.ServiceDependency;
import org.apache.felix.dm.test.bundle.annotation.sequencer.Sequencer;
-@Service(properties = { @Property(name = "param1", value = "value1") })
+@Component(properties = { @Property(name = "param1", value = "value1") })
public class ServiceProvider implements ServiceInterface
{
@ServiceDependency
diff --git a/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/adapter/ServiceProvider2.java b/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/adapter/ServiceProvider2.java
index 8d69eb5..12cc75b 100644
--- a/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/adapter/ServiceProvider2.java
+++ b/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/adapter/ServiceProvider2.java
@@ -18,11 +18,11 @@
*/
package org.apache.felix.dm.test.bundle.annotation.adapter;
-import org.apache.felix.dm.annotation.api.Service;
+import org.apache.felix.dm.annotation.api.Component;
import org.apache.felix.dm.annotation.api.ServiceDependency;
import org.apache.felix.dm.test.bundle.annotation.sequencer.Sequencer;
-@Service
+@Component
public class ServiceProvider2 implements ServiceInterface2
{
@ServiceDependency
diff --git a/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/aspect/AspectTest.java b/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/aspect/AspectTest.java
index 44c3cd3..e95cc87 100644
--- a/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/aspect/AspectTest.java
+++ b/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/aspect/AspectTest.java
@@ -18,10 +18,10 @@
*/
package org.apache.felix.dm.test.bundle.annotation.aspect;
-import org.apache.felix.dm.annotation.api.Service;
+import org.apache.felix.dm.annotation.api.Component;
import org.apache.felix.dm.annotation.api.ServiceDependency;
-@Service
+@Component
public class AspectTest
{
@ServiceDependency
diff --git a/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/aspect/ServiceProvider.java b/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/aspect/ServiceProvider.java
index 3dda109..e05ea1f 100644
--- a/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/aspect/ServiceProvider.java
+++ b/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/aspect/ServiceProvider.java
@@ -18,11 +18,11 @@
*/
package org.apache.felix.dm.test.bundle.annotation.aspect;
-import org.apache.felix.dm.annotation.api.Service;
+import org.apache.felix.dm.annotation.api.Component;
import org.apache.felix.dm.annotation.api.ServiceDependency;
import org.apache.felix.dm.test.bundle.annotation.sequencer.Sequencer;
-@Service
+@Component
public class ServiceProvider implements ServiceInterface
{
@ServiceDependency(filter = "(test=aspect.ServiceProvider)")
diff --git a/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/aspectlifecycle/AspectLifecycleTest.java b/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/aspectlifecycle/AspectLifecycleTest.java
index 234e202..b2f9e27 100644
--- a/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/aspectlifecycle/AspectLifecycleTest.java
+++ b/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/aspectlifecycle/AspectLifecycleTest.java
@@ -18,13 +18,13 @@
*/
package org.apache.felix.dm.test.bundle.annotation.aspectlifecycle;
-import org.apache.felix.dm.annotation.api.Service;
+import org.apache.felix.dm.annotation.api.Component;
import org.apache.felix.dm.annotation.api.ServiceDependency;
/**
* Tests an aspect service, and ensure that its lifecycle methods are properly invoked (init/start/stop/destroy)
*/
-@Service
+@Component
public class AspectLifecycleTest
{
@ServiceDependency
diff --git a/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/aspectlifecycle/ServiceProvider.java b/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/aspectlifecycle/ServiceProvider.java
index 89ad008..2841324 100644
--- a/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/aspectlifecycle/ServiceProvider.java
+++ b/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/aspectlifecycle/ServiceProvider.java
@@ -18,11 +18,11 @@
*/
package org.apache.felix.dm.test.bundle.annotation.aspectlifecycle;
-import org.apache.felix.dm.annotation.api.Service;
+import org.apache.felix.dm.annotation.api.Component;
import org.apache.felix.dm.annotation.api.ServiceDependency;
import org.apache.felix.dm.test.bundle.annotation.sequencer.Sequencer;
-@Service
+@Component
public class ServiceProvider implements ServiceInterface
{
@ServiceDependency(filter = "(test=aspectLifecycle.ServiceProvider)")
diff --git a/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/aspectlifecycledynamicproxy/AspectLifecycleTest.java b/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/aspectlifecycledynamicproxy/AspectLifecycleTest.java
index d63c0c8..cbb9b2c 100644
--- a/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/aspectlifecycledynamicproxy/AspectLifecycleTest.java
+++ b/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/aspectlifecycledynamicproxy/AspectLifecycleTest.java
@@ -18,13 +18,13 @@
*/
package org.apache.felix.dm.test.bundle.annotation.aspectlifecycledynamicproxy;
-import org.apache.felix.dm.annotation.api.Service;
+import org.apache.felix.dm.annotation.api.Component;
import org.apache.felix.dm.annotation.api.ServiceDependency;
/**
* Tests an aspect service, and ensure that its lifecycle methods are properly invoked (init/start/stop/destroy)
*/
-@Service
+@Component
public class AspectLifecycleTest
{
@ServiceDependency
diff --git a/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/aspectlifecycledynamicproxy/ServiceProvider.java b/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/aspectlifecycledynamicproxy/ServiceProvider.java
index 975e8d6..09e63b1 100644
--- a/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/aspectlifecycledynamicproxy/ServiceProvider.java
+++ b/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/aspectlifecycledynamicproxy/ServiceProvider.java
@@ -18,11 +18,11 @@
*/
package org.apache.felix.dm.test.bundle.annotation.aspectlifecycledynamicproxy;
-import org.apache.felix.dm.annotation.api.Service;
+import org.apache.felix.dm.annotation.api.Component;
import org.apache.felix.dm.annotation.api.ServiceDependency;
import org.apache.felix.dm.test.bundle.annotation.sequencer.Sequencer;
-@Service
+@Component
public class ServiceProvider implements ServiceInterface
{
@ServiceDependency(filter = "(test=aspectLifecycle.ServiceProvider)")
diff --git a/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/bundledependency/Consumer.java b/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/bundledependency/Consumer.java
index 64b9da0..307b78b 100644
--- a/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/bundledependency/Consumer.java
+++ b/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/bundledependency/Consumer.java
@@ -19,7 +19,7 @@
package org.apache.felix.dm.test.bundle.annotation.bundledependency;
import org.apache.felix.dm.annotation.api.Destroy;
-import org.apache.felix.dm.annotation.api.Service;
+import org.apache.felix.dm.annotation.api.Component;
import org.apache.felix.dm.annotation.api.Start;
import org.apache.felix.dm.annotation.api.BundleDependency;
import org.apache.felix.dm.annotation.api.ServiceDependency;
@@ -30,7 +30,7 @@
/**
* Simple Consumer which has a BundleDependency dependency.
*/
-@Service
+@Component
public class Consumer
{
protected volatile boolean m_added;
diff --git a/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/bundledependency/ServiceConsumer.java b/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/bundledependency/ServiceConsumer.java
index 05a29ca..8639f8f 100644
--- a/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/bundledependency/ServiceConsumer.java
+++ b/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/bundledependency/ServiceConsumer.java
@@ -18,7 +18,7 @@
*/
package org.apache.felix.dm.test.bundle.annotation.bundledependency;
-import org.apache.felix.dm.annotation.api.Service;
+import org.apache.felix.dm.annotation.api.Component;
import org.apache.felix.dm.annotation.api.Start;
import org.apache.felix.dm.annotation.api.ServiceDependency;
import org.apache.felix.dm.test.bundle.annotation.sequencer.Sequencer;
@@ -26,7 +26,7 @@
/**
* ServiceInterface Consumer.
*/
-@Service
+@Component
public class ServiceConsumer
{
@ServiceDependency(filter="(test=adapter)")
diff --git a/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/composite/Component.java b/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/composite/Composite.java
similarity index 98%
rename from dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/composite/Component.java
rename to dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/composite/Composite.java
index 1e4145c..62f4244 100644
--- a/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/composite/Component.java
+++ b/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/composite/Composite.java
@@ -16,7 +16,7 @@
/**
* The CompositeService is also made up of this Class.
*/
-public class Component
+public class Composite
{
// Injected dependency (from CompositeService)
private Sequencer m_sequencer;
diff --git a/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/composite/CompositeService.java b/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/composite/CompositeService.java
index d80e24b..22514ab 100644
--- a/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/composite/CompositeService.java
+++ b/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/composite/CompositeService.java
@@ -17,7 +17,7 @@
import org.apache.felix.dm.annotation.api.Composition;
import org.apache.felix.dm.annotation.api.Destroy;
import org.apache.felix.dm.annotation.api.Init;
-import org.apache.felix.dm.annotation.api.Service;
+import org.apache.felix.dm.annotation.api.Component;
import org.apache.felix.dm.annotation.api.ServiceDependency;
import org.apache.felix.dm.annotation.api.Start;
import org.apache.felix.dm.annotation.api.Stop;
@@ -26,11 +26,11 @@
/**
* This service is also composed of the Component object.
*/
-@Service
+@Component
public class CompositeService
{
/* We are composed of this object, which will also be injected with our dependencies */
- private Component m_component = new Component();
+ private Composite m_composite = new Composite();
/* This dependency filter will be configured from our init method */
@ServiceDependency(name = "D")
@@ -63,7 +63,7 @@
@Composition
Object[] getComposition()
{
- return new Object[] { this, m_component };
+ return new Object[] { this, m_composite };
}
/**
diff --git a/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/composite/Dependency1.java b/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/composite/Dependency1.java
index 138f46a..07c3cac 100644
--- a/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/composite/Dependency1.java
+++ b/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/composite/Dependency1.java
@@ -12,11 +12,11 @@
package org.apache.felix.dm.test.bundle.annotation.composite;
import org.apache.felix.dm.annotation.api.Property;
-import org.apache.felix.dm.annotation.api.Service;
+import org.apache.felix.dm.annotation.api.Component;
import org.apache.felix.dm.annotation.api.ServiceDependency;
import org.apache.felix.dm.test.bundle.annotation.sequencer.Sequencer;
-@Service(properties = @Property(name = "foo", value = "bar1"))
+@Component(properties = @Property(name = "foo", value = "bar1"))
public class Dependency1 implements Runnable
{
@ServiceDependency
diff --git a/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/composite/Dependency2.java b/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/composite/Dependency2.java
index 62855f0..5b2244e 100644
--- a/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/composite/Dependency2.java
+++ b/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/composite/Dependency2.java
@@ -12,11 +12,11 @@
package org.apache.felix.dm.test.bundle.annotation.composite;
import org.apache.felix.dm.annotation.api.Property;
-import org.apache.felix.dm.annotation.api.Service;
+import org.apache.felix.dm.annotation.api.Component;
import org.apache.felix.dm.annotation.api.ServiceDependency;
import org.apache.felix.dm.test.bundle.annotation.sequencer.Sequencer;
-@Service(properties = @Property(name = "foo", value = "bar2"))
+@Component(properties = @Property(name = "foo", value = "bar2"))
public class Dependency2 implements Runnable
{
@ServiceDependency
diff --git a/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/extraproperties/ExtraAdapterServiceProperties.java b/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/extraproperties/ExtraAdapterServiceProperties.java
index 12588bb..fa3591d 100644
--- a/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/extraproperties/ExtraAdapterServiceProperties.java
+++ b/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/extraproperties/ExtraAdapterServiceProperties.java
@@ -23,7 +23,7 @@
import org.apache.felix.dm.annotation.api.AdapterService;
import org.apache.felix.dm.annotation.api.Property;
-import org.apache.felix.dm.annotation.api.Service;
+import org.apache.felix.dm.annotation.api.Component;
import org.apache.felix.dm.annotation.api.ServiceDependency;
import org.apache.felix.dm.annotation.api.Start;
import org.apache.felix.dm.test.bundle.annotation.sequencer.Sequencer;
@@ -43,7 +43,7 @@
}
- @Service(properties={@Property(name="foo", value="bar")})
+ @Component(properties={@Property(name="foo", value="bar")})
public static class ProviderImpl implements Provider
{
}
@@ -60,7 +60,7 @@
}
}
- @Service
+ @Component
public static class Consumer
{
@ServiceDependency(filter="(test=ExtraAdapterServiceProperties)")
diff --git a/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/extraproperties/ExtraAspectServiceProperties.java b/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/extraproperties/ExtraAspectServiceProperties.java
index 30ab097..dd6d284 100644
--- a/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/extraproperties/ExtraAspectServiceProperties.java
+++ b/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/extraproperties/ExtraAspectServiceProperties.java
@@ -23,7 +23,7 @@
import org.apache.felix.dm.annotation.api.AspectService;
import org.apache.felix.dm.annotation.api.Property;
-import org.apache.felix.dm.annotation.api.Service;
+import org.apache.felix.dm.annotation.api.Component;
import org.apache.felix.dm.annotation.api.ServiceDependency;
import org.apache.felix.dm.annotation.api.Start;
import org.apache.felix.dm.test.bundle.annotation.sequencer.Sequencer;
@@ -38,7 +38,7 @@
{
}
- @Service(properties={@Property(name="foo", value="bar")})
+ @Component(properties={@Property(name="foo", value="bar")})
public static class ProviderImpl implements Provider
{
}
@@ -53,7 +53,7 @@
}
}
- @Service
+ @Component
public static class Consumer
{
@ServiceDependency(filter="(test=ExtraAspectServiceProperties)")
diff --git a/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/extraproperties/ExtraFactoryServiceProperties.java b/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/extraproperties/ExtraFactoryServiceProperties.java
index 3d9385f..f5975ea 100644
--- a/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/extraproperties/ExtraFactoryServiceProperties.java
+++ b/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/extraproperties/ExtraFactoryServiceProperties.java
@@ -25,7 +25,7 @@
import java.util.Set;
import org.apache.felix.dm.annotation.api.Property;
-import org.apache.felix.dm.annotation.api.Service;
+import org.apache.felix.dm.annotation.api.Component;
import org.apache.felix.dm.annotation.api.ServiceDependency;
import org.apache.felix.dm.annotation.api.Start;
import org.apache.felix.dm.test.bundle.annotation.sequencer.Sequencer;
@@ -36,7 +36,7 @@
{
}
- @Service(properties={@Property(name="foo", value="bar")}, factorySet="MyFactory")
+ @Component(properties={@Property(name="foo", value="bar")}, factorySet="MyFactory")
public static class ProviderImpl implements Provider
{
@Start
@@ -46,7 +46,7 @@
}
}
- @Service
+ @Component
public static class ProviderImplFactory
{
@ServiceDependency
@@ -59,7 +59,7 @@
}
}
- @Service
+ @Component
public static class Consumer
{
@ServiceDependency(filter="(test=ExtraFactoryServiceProperties)")
diff --git a/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/extraproperties/ExtraServiceProperties.java b/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/extraproperties/ExtraServiceProperties.java
index d7172e6..388e3e6 100644
--- a/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/extraproperties/ExtraServiceProperties.java
+++ b/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/extraproperties/ExtraServiceProperties.java
@@ -21,7 +21,7 @@
import java.util.HashMap;
import java.util.Map;
-import org.apache.felix.dm.annotation.api.Service;
+import org.apache.felix.dm.annotation.api.Component;
import org.apache.felix.dm.annotation.api.Property;
import org.apache.felix.dm.annotation.api.ServiceDependency;
import org.apache.felix.dm.annotation.api.Start;
@@ -37,7 +37,7 @@
{
}
- @Service(properties={@Property(name="foo", value="bar")})
+ @Component(properties={@Property(name="foo", value="bar")})
public static class ProviderImpl implements Provider
{
@Start
@@ -47,7 +47,7 @@
}
}
- @Service
+ @Component
public static class Consumer
{
@ServiceDependency(filter="(test=ExtraServiceProperties)")
diff --git a/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/factory/ExtraDependency1.java b/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/factory/ExtraDependency1.java
index ef4caf7..e5bf7c5 100644
--- a/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/factory/ExtraDependency1.java
+++ b/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/factory/ExtraDependency1.java
@@ -19,9 +19,9 @@
package org.apache.felix.dm.test.bundle.annotation.factory;
import org.apache.felix.dm.annotation.api.Property;
-import org.apache.felix.dm.annotation.api.Service;
+import org.apache.felix.dm.annotation.api.Component;
-@Service(properties=@Property(name="foo", value="bar"))
+@Component(properties=@Property(name="foo", value="bar"))
public class ExtraDependency1 implements Runnable
{
public void run()
diff --git a/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/factory/ExtraDependency2.java b/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/factory/ExtraDependency2.java
index 7f76e1f..302963f 100644
--- a/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/factory/ExtraDependency2.java
+++ b/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/factory/ExtraDependency2.java
@@ -19,9 +19,9 @@
package org.apache.felix.dm.test.bundle.annotation.factory;
import org.apache.felix.dm.annotation.api.Property;
-import org.apache.felix.dm.annotation.api.Service;
+import org.apache.felix.dm.annotation.api.Component;
-@Service(properties=@Property(name="foo", value="bar2"))
+@Component(properties=@Property(name="foo", value="bar2"))
public class ExtraDependency2 implements Runnable
{
public void run()
diff --git a/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/factory/MyService.java b/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/factory/MyService.java
index 34c89f8..b9b1d18 100644
--- a/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/factory/MyService.java
+++ b/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/factory/MyService.java
@@ -26,7 +26,7 @@
import org.apache.felix.dm.annotation.api.Init;
import org.apache.felix.dm.annotation.api.Property;
-import org.apache.felix.dm.annotation.api.Service;
+import org.apache.felix.dm.annotation.api.Component;
import org.apache.felix.dm.annotation.api.ServiceDependency;
import org.apache.felix.dm.annotation.api.Start;
import org.apache.felix.dm.annotation.api.Stop;
@@ -35,7 +35,7 @@
/**
* This service will be instantiated by our MyServiceFactory class.
*/
-@Service(factorySet = "MyServiceFactory",
+@Component(factorySet = "MyServiceFactory",
factoryConfigure = "configure", properties = { @Property(name = "foo", value = "bar") })
public class MyService implements MyServiceInterface
{
diff --git a/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/factory/MyServiceFactory.java b/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/factory/MyServiceFactory.java
index b132488..e7fbdec 100644
--- a/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/factory/MyServiceFactory.java
+++ b/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/factory/MyServiceFactory.java
@@ -25,13 +25,13 @@
import junit.framework.Assert;
-import org.apache.felix.dm.annotation.api.Service;
+import org.apache.felix.dm.annotation.api.Component;
import org.apache.felix.dm.annotation.api.ServiceDependency;
import org.apache.felix.dm.annotation.api.Start;
import org.apache.felix.dm.test.bundle.annotation.sequencer.Sequencer;
@SuppressWarnings("unchecked")
-@Service
+@Component
public class MyServiceFactory
{
@ServiceDependency(filter = "(dm.factory.name=MyServiceFactory)")
diff --git a/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/factoryconfadapter/ServiceClient.java b/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/factoryconfadapter/ServiceClient.java
index dc6aeba..ed9ea91 100644
--- a/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/factoryconfadapter/ServiceClient.java
+++ b/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/factoryconfadapter/ServiceClient.java
@@ -20,10 +20,10 @@
import java.util.Map;
-import org.apache.felix.dm.annotation.api.Service;
+import org.apache.felix.dm.annotation.api.Component;
import org.apache.felix.dm.annotation.api.ServiceDependency;
-@Service
+@Component
public class ServiceClient
{
@ServiceDependency(changed="changeServiceProvider")
diff --git a/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/multiple/ServiceConsumer.java b/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/multiple/ServiceConsumer.java
index 3bb18bc..a113318 100644
--- a/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/multiple/ServiceConsumer.java
+++ b/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/multiple/ServiceConsumer.java
@@ -18,13 +18,13 @@
*/
package org.apache.felix.dm.test.bundle.annotation.multiple;
-import org.apache.felix.dm.annotation.api.Service;
+import org.apache.felix.dm.annotation.api.Component;
import org.apache.felix.dm.annotation.api.Start;
import org.apache.felix.dm.annotation.api.Stop;
import org.apache.felix.dm.annotation.api.ServiceDependency;
import org.apache.felix.dm.test.bundle.annotation.sequencer.Sequencer;
-@Service
+@Component
public class ServiceConsumer
{
@ServiceDependency
diff --git a/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/multiple/ServiceProvider.java b/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/multiple/ServiceProvider.java
index e6af2ba..ee0efc9 100644
--- a/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/multiple/ServiceProvider.java
+++ b/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/multiple/ServiceProvider.java
@@ -19,13 +19,13 @@
package org.apache.felix.dm.test.bundle.annotation.multiple;
import org.apache.felix.dm.annotation.api.Property;
-import org.apache.felix.dm.annotation.api.Service;
+import org.apache.felix.dm.annotation.api.Component;
import org.apache.felix.dm.annotation.api.Start;
import org.apache.felix.dm.annotation.api.Stop;
import org.apache.felix.dm.annotation.api.ServiceDependency;
import org.apache.felix.dm.test.bundle.annotation.sequencer.Sequencer;
-@Service(properties = { @Property(name = "foo", value = "bar") })
+@Component(properties = { @Property(name = "foo", value = "bar") })
public class ServiceProvider implements ServiceInterface
{
@ServiceDependency
diff --git a/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/multiple/ServiceProvider2.java b/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/multiple/ServiceProvider2.java
index 639c9a5..5db2195 100644
--- a/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/multiple/ServiceProvider2.java
+++ b/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/multiple/ServiceProvider2.java
@@ -19,13 +19,13 @@
package org.apache.felix.dm.test.bundle.annotation.multiple;
import org.apache.felix.dm.annotation.api.Composition;
-import org.apache.felix.dm.annotation.api.Service;
+import org.apache.felix.dm.annotation.api.Component;
import org.apache.felix.dm.annotation.api.Start;
import org.apache.felix.dm.annotation.api.Stop;
import org.apache.felix.dm.annotation.api.ServiceDependency;
import org.apache.felix.dm.test.bundle.annotation.sequencer.Sequencer;
-@Service(provides = { ServiceProvider2.class }, factoryMethod="create")
+@Component(provides = { ServiceProvider2.class }, factoryMethod="create")
public class ServiceProvider2
{
Composite m_composite = new Composite();
diff --git a/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/propagate/ServiceDependencyPropagateTest.java b/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/propagate/ServiceDependencyPropagateTest.java
index 64e1383..2d3aa3c 100644
--- a/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/propagate/ServiceDependencyPropagateTest.java
+++ b/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/propagate/ServiceDependencyPropagateTest.java
@@ -21,7 +21,7 @@
import java.util.Map;
import org.apache.felix.dm.annotation.api.Property;
-import org.apache.felix.dm.annotation.api.Service;
+import org.apache.felix.dm.annotation.api.Component;
import org.apache.felix.dm.annotation.api.ServiceDependency;
import org.apache.felix.dm.annotation.api.Start;
import org.apache.felix.dm.test.bundle.annotation.sequencer.Sequencer;
@@ -31,7 +31,7 @@
*/
public class ServiceDependencyPropagateTest
{
- @Service
+ @Component
public static class Consumer {
private Map m_producerProps;
@@ -55,14 +55,14 @@
}
}
- @Service(provides={Producer.class}, properties={@Property(name="foo", value="bar")})
+ @Component(provides={Producer.class}, properties={@Property(name="foo", value="bar")})
public static class Producer {
@ServiceDependency(propagate=true)
Producer2 m_producer;
}
- @Service(provides={Producer2.class}, properties={@Property(name="foo2", value="bar2")})
+ @Component(provides={Producer2.class}, properties={@Property(name="foo2", value="bar2")})
public static class Producer2 {
}
}
diff --git a/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/publisher/AdapterServiceTestWithPublisher.java b/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/publisher/AdapterServiceTestWithPublisher.java
index 2c00691..2e29749 100644
--- a/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/publisher/AdapterServiceTestWithPublisher.java
+++ b/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/publisher/AdapterServiceTestWithPublisher.java
@@ -25,7 +25,7 @@
import org.apache.felix.dm.annotation.api.Init;
import org.apache.felix.dm.annotation.api.Property;
import org.apache.felix.dm.annotation.api.LifecycleController;
-import org.apache.felix.dm.annotation.api.Service;
+import org.apache.felix.dm.annotation.api.Component;
import org.apache.felix.dm.annotation.api.ServiceDependency;
import org.apache.felix.dm.annotation.api.Start;
import org.apache.felix.dm.test.bundle.annotation.sequencer.Sequencer;
@@ -43,7 +43,7 @@
{
}
- @Service
+ @Component
public static class Consumer
{
@ServiceDependency(filter="(test=AdapterServiceTestWithPublisher)")
@@ -82,7 +82,7 @@
}
}
- @Service(properties={@Property(name="foo", value="bar")})
+ @Component(properties={@Property(name="foo", value="bar")})
public static class ProviderImpl implements Provider
{
@Start
diff --git a/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/publisher/BundleAdapterServiceTestWithPublisher.java b/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/publisher/BundleAdapterServiceTestWithPublisher.java
index 07f4036..5333cc5 100644
--- a/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/publisher/BundleAdapterServiceTestWithPublisher.java
+++ b/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/publisher/BundleAdapterServiceTestWithPublisher.java
@@ -25,7 +25,7 @@
import org.apache.felix.dm.annotation.api.Init;
import org.apache.felix.dm.annotation.api.Property;
import org.apache.felix.dm.annotation.api.LifecycleController;
-import org.apache.felix.dm.annotation.api.Service;
+import org.apache.felix.dm.annotation.api.Component;
import org.apache.felix.dm.annotation.api.ServiceDependency;
import org.apache.felix.dm.annotation.api.Start;
import org.apache.felix.dm.test.bundle.annotation.sequencer.Sequencer;
@@ -40,7 +40,7 @@
{
}
- @Service
+ @Component
public static class Consumer
{
@ServiceDependency(filter="(test=BundleAdapterServiceTestWithPublisher)")
diff --git a/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/publisher/FactoryConfigurationAdapterServiceTestWithPublisher.java b/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/publisher/FactoryConfigurationAdapterServiceTestWithPublisher.java
index 78bba0e..1aabef2 100644
--- a/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/publisher/FactoryConfigurationAdapterServiceTestWithPublisher.java
+++ b/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/publisher/FactoryConfigurationAdapterServiceTestWithPublisher.java
@@ -28,7 +28,7 @@
import org.apache.felix.dm.annotation.api.Init;
import org.apache.felix.dm.annotation.api.LifecycleController;
import org.apache.felix.dm.annotation.api.Property;
-import org.apache.felix.dm.annotation.api.Service;
+import org.apache.felix.dm.annotation.api.Component;
import org.apache.felix.dm.annotation.api.ServiceDependency;
import org.apache.felix.dm.annotation.api.Start;
import org.apache.felix.dm.test.bundle.annotation.sequencer.Sequencer;
@@ -44,7 +44,7 @@
{
}
- @Service
+ @Component
public static class Consumer
{
@ServiceDependency(filter="(test=FactoryConfigurationAdapterServiceTestWithPublisher)")
@@ -77,7 +77,7 @@
}
}
- @Service
+ @Component
public static class Configurator
{
@ServiceDependency
diff --git a/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/publisher/FactoryServiceTestWthPublisher.java b/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/publisher/FactoryServiceTestWthPublisher.java
index a55d578..360b693 100644
--- a/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/publisher/FactoryServiceTestWthPublisher.java
+++ b/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/publisher/FactoryServiceTestWthPublisher.java
@@ -27,7 +27,7 @@
import org.apache.felix.dm.annotation.api.Init;
import org.apache.felix.dm.annotation.api.Property;
import org.apache.felix.dm.annotation.api.LifecycleController;
-import org.apache.felix.dm.annotation.api.Service;
+import org.apache.felix.dm.annotation.api.Component;
import org.apache.felix.dm.annotation.api.ServiceDependency;
import org.apache.felix.dm.annotation.api.Start;
import org.apache.felix.dm.test.bundle.annotation.sequencer.Sequencer;
@@ -42,7 +42,7 @@
{
}
- @Service
+ @Component
public static class Consumer
{
@ServiceDependency(filter="(test=FactoryServiceTestWthPublisher)")
@@ -72,7 +72,7 @@
}
}
- @Service(factorySet="MyFactory", properties={@Property(name="foo", value="bar")})
+ @Component(factorySet="MyFactory", properties={@Property(name="foo", value="bar")})
public static class ProviderImpl implements Provider
{
@LifecycleController
@@ -102,7 +102,7 @@
}
}
- @Service
+ @Component
public static class ProviderImplFactory
{
@ServiceDependency(filter="(dm.factory.name=MyFactory)")
diff --git a/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/publisher/ResourceAdapterServiceTestWithPublisher.java b/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/publisher/ResourceAdapterServiceTestWithPublisher.java
index 328ce93..2fd9d83 100644
--- a/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/publisher/ResourceAdapterServiceTestWithPublisher.java
+++ b/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/publisher/ResourceAdapterServiceTestWithPublisher.java
@@ -32,7 +32,7 @@
import org.apache.felix.dm.annotation.api.LifecycleController;
import org.apache.felix.dm.annotation.api.Property;
import org.apache.felix.dm.annotation.api.ResourceAdapterService;
-import org.apache.felix.dm.annotation.api.Service;
+import org.apache.felix.dm.annotation.api.Component;
import org.apache.felix.dm.annotation.api.ServiceDependency;
import org.apache.felix.dm.annotation.api.Start;
import org.apache.felix.dm.test.bundle.annotation.sequencer.Sequencer;
@@ -49,7 +49,7 @@
{
}
- @Service
+ @Component
public static class Consumer
{
@ServiceDependency(filter="(test=ResourceAdapterServiceTestWithPublisher)")
@@ -86,7 +86,7 @@
}
}
- @Service
+ @Component
public static class ResourceProvider
{
private volatile BundleContext m_context;
diff --git a/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/publisher/ServiceTestWthPublisher.java b/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/publisher/ServiceTestWthPublisher.java
index 573dc9d..8bb7490 100644
--- a/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/publisher/ServiceTestWthPublisher.java
+++ b/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/publisher/ServiceTestWthPublisher.java
@@ -24,7 +24,7 @@
import org.apache.felix.dm.annotation.api.Init;
import org.apache.felix.dm.annotation.api.LifecycleController;
import org.apache.felix.dm.annotation.api.Property;
-import org.apache.felix.dm.annotation.api.Service;
+import org.apache.felix.dm.annotation.api.Component;
import org.apache.felix.dm.annotation.api.ServiceDependency;
import org.apache.felix.dm.annotation.api.Start;
import org.apache.felix.dm.test.bundle.annotation.sequencer.Sequencer;
@@ -38,7 +38,7 @@
{
}
- @Service
+ @Component
public static class Consumer
{
@ServiceDependency(filter="(test=ServiceTestWthPublisher)")
@@ -64,7 +64,7 @@
}
}
- @Service(properties={@Property(name="foo", value="bar")})
+ @Component(properties={@Property(name="foo", value="bar")})
public static class ProviderImpl implements Provider
{
@LifecycleController
diff --git a/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/resource/ResourceConsumer.java b/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/resource/ResourceConsumer.java
index 2e51e4d..4184118 100644
--- a/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/resource/ResourceConsumer.java
+++ b/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/resource/ResourceConsumer.java
@@ -23,7 +23,7 @@
import junit.framework.Assert;
import org.apache.felix.dm.annotation.api.ResourceDependency;
-import org.apache.felix.dm.annotation.api.Service;
+import org.apache.felix.dm.annotation.api.Component;
import org.apache.felix.dm.annotation.api.ServiceDependency;
import org.apache.felix.dm.annotation.api.Start;
import org.apache.felix.dm.annotation.api.Stop;
@@ -32,7 +32,7 @@
/**
* A Component which has a resource dependency.
*/
-@Service
+@Component
public class ResourceConsumer
{
@ServiceDependency(required=true,filter = "(test=resource)")
diff --git a/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/resource/ResourceProvider.java b/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/resource/ResourceProvider.java
index 6c64224..7259da2 100644
--- a/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/resource/ResourceProvider.java
+++ b/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/resource/ResourceProvider.java
@@ -28,7 +28,7 @@
import org.apache.felix.dm.ResourceHandler;
import org.apache.felix.dm.ResourceUtil;
import org.apache.felix.dm.annotation.api.Destroy;
-import org.apache.felix.dm.annotation.api.Service;
+import org.apache.felix.dm.annotation.api.Component;
import org.apache.felix.dm.annotation.api.ServiceDependency;
import org.osgi.framework.BundleContext;
import org.osgi.framework.Filter;
@@ -37,7 +37,7 @@
/**
* Provides some simple resources.
*/
-@Service
+@Component
public class ResourceProvider
{
private volatile BundleContext m_context;
diff --git a/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/resource/ServiceConsumer.java b/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/resource/ServiceConsumer.java
index 6e6dedc..862b020 100644
--- a/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/resource/ServiceConsumer.java
+++ b/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/resource/ServiceConsumer.java
@@ -18,7 +18,7 @@
*/
package org.apache.felix.dm.test.bundle.annotation.resource;
-import org.apache.felix.dm.annotation.api.Service;
+import org.apache.felix.dm.annotation.api.Component;
import org.apache.felix.dm.annotation.api.Start;
import org.apache.felix.dm.annotation.api.ServiceDependency;
import org.apache.felix.dm.test.bundle.annotation.sequencer.Sequencer;
@@ -27,7 +27,7 @@
* A Component with a dependency over the ServiceInterface, which is actually provided
* by a ResourceAdapter.
*/
-@Service
+@Component
public class ServiceConsumer
{
@ServiceDependency
diff --git a/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/simple/Consumer.java b/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/simple/Consumer.java
index 8d0c9eb..4ebcbfc 100644
--- a/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/simple/Consumer.java
+++ b/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/simple/Consumer.java
@@ -18,7 +18,7 @@
*/
package org.apache.felix.dm.test.bundle.annotation.simple;
-import org.apache.felix.dm.annotation.api.Service;
+import org.apache.felix.dm.annotation.api.Component;
import org.apache.felix.dm.annotation.api.Start;
import org.apache.felix.dm.annotation.api.Stop;
import org.apache.felix.dm.annotation.api.ServiceDependency;
@@ -27,7 +27,7 @@
/**
* Consumes a service which is provided by the {@link Producer} class.
*/
-@Service
+@Component
public class Consumer
{
@ServiceDependency
diff --git a/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/simple/Producer.java b/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/simple/Producer.java
index 47b468f..ba3e7d0 100644
--- a/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/simple/Producer.java
+++ b/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/simple/Producer.java
@@ -18,7 +18,7 @@
*/
package org.apache.felix.dm.test.bundle.annotation.simple;
-import org.apache.felix.dm.annotation.api.Service;
+import org.apache.felix.dm.annotation.api.Component;
import org.apache.felix.dm.annotation.api.Start;
import org.apache.felix.dm.annotation.api.Stop;
import org.apache.felix.dm.annotation.api.ServiceDependency;
@@ -27,7 +27,7 @@
/**
* Provides a <code>Runnable</code> service, which is required by the {@link Consumer} class.
*/
-@Service
+@Component
public class Producer implements Runnable
{
@ServiceDependency
diff --git a/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/temporal/TemporalTest.java b/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/temporal/TemporalTest.java
index 5d56066..2bb7c65 100644
--- a/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/temporal/TemporalTest.java
+++ b/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/temporal/TemporalTest.java
@@ -18,7 +18,7 @@
*/
package org.apache.felix.dm.test.bundle.annotation.temporal;
-import org.apache.felix.dm.annotation.api.Service;
+import org.apache.felix.dm.annotation.api.Component;
import org.apache.felix.dm.annotation.api.Start;
import org.apache.felix.dm.annotation.api.Stop;
import org.apache.felix.dm.annotation.api.ServiceDependency;
@@ -27,7 +27,7 @@
/**
* Service using an annotated Temporal Service dependendency.
*/
-@Service(provides = {})
+@Component(provides = {})
public class TemporalTest implements Runnable
{
Thread m_thread;