Big refactoring, renamed "Service" to "Component" whenever it was referring to the thing that has dependencies and registers itself as a service.
git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@994964 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/dependencymanager/core/pom.xml b/dependencymanager/core/pom.xml
index 18ea88f..becf540 100644
--- a/dependencymanager/core/pom.xml
+++ b/dependencymanager/core/pom.xml
@@ -50,7 +50,7 @@
<Bundle-Name>Apache Felix Dependency Manager</Bundle-Name>
<Bundle-Description>A bundle that provides a run-time service dependency manager.</Bundle-Description>
<Bundle-Vendor>The Apache Software Foundation</Bundle-Vendor>
- <Export-Package>org.apache.felix.dm;version="3.0.0"</Export-Package>
+ <Export-Package>org.apache.felix.dm;version="3.0.0",org.apache.felix.dm.tracker;version="3.0.0"</Export-Package>
<Import-Package>!org.apache.felix.dm,*</Import-Package>
<Private-Package>org.apache.felix.dm.impl,org.apache.felix.dm.impl.dependencies,org.apache.felix.dm.impl.tracker,org.apache.felix.dm.impl.metatype</Private-Package>
<!-- Uncomment this line to include source code in the bundle.
diff --git a/dependencymanager/core/src/main/java/org/apache/felix/dm/BundleDependency.java b/dependencymanager/core/src/main/java/org/apache/felix/dm/BundleDependency.java
index 4acb8ac..8c95784 100644
--- a/dependencymanager/core/src/main/java/org/apache/felix/dm/BundleDependency.java
+++ b/dependencymanager/core/src/main/java/org/apache/felix/dm/BundleDependency.java
@@ -13,54 +13,54 @@
import org.osgi.framework.Bundle;
-public interface BundleDependency extends Dependency, ServiceComponentDependency
+public interface BundleDependency extends Dependency, ComponentDependencyDeclaration
{
/**
- * Sets the callbacks for this service. These callbacks can be used as hooks whenever a
+ * Sets the callbacks for this dependency. These callbacks can be used as hooks whenever a
* dependency is added or removed. When you specify callbacks, the auto configuration feature
* is automatically turned off, because we're assuming you don't need it in this case.
*
- * @param added the method to call when a service was added
- * @param removed the method to call when a service was removed
- * @return this service dependency
+ * @param added the method to call when a bundle was added
+ * @param removed the method to call when a bundle was removed
+ * @return this bundle dependency
*/
BundleDependency setCallbacks(String added, String removed);
/**
- * Sets the callbacks for this service. These callbacks can be used as hooks whenever a
+ * Sets the callbacks for this dependency. These callbacks can be used as hooks whenever a
* dependency is added, changed or removed. When you specify callbacks, the auto configuration
* feature is automatically turned off, because we're assuming you don't need it in this case.
*
- * @param added the method to call when a service was added
- * @param changed the method to call when a service was changed
- * @param removed the method to call when a service was removed
- * @return this service dependency
+ * @param added the method to call when a bundle was added
+ * @param changed the method to call when a bundle was changed
+ * @param removed the method to call when a bundle was removed
+ * @return this bundle dependency
*/
BundleDependency setCallbacks(String added, String changed, String removed);
/**
- * Sets the callbacks for this service. These callbacks can be used as hooks whenever a
+ * Sets the callbacks for this dependency. These callbacks can be used as hooks whenever a
* dependency is added or removed. They are called on the instance you provide. When you
* specify callbacks, the auto configuration feature is automatically turned off, because
* we're assuming you don't need it in this case.
*
* @param instance the instance to call the callbacks on
- * @param added the method to call when a service was added
- * @param removed the method to call when a service was removed
- * @return this service dependency
+ * @param added the method to call when a bundle was added
+ * @param removed the method to call when a bundle was removed
+ * @return this bundle dependency
*/
BundleDependency setCallbacks(Object instance, String added, String removed);
/**
- * Sets the callbacks for this service. These callbacks can be used as hooks whenever a
+ * Sets the callbacks for this dependency. These callbacks can be used as hooks whenever a
* dependency is added, changed or removed. They are called on the instance you provide. When
* you specify callbacks, the auto configuration feature is automatically turned off, because
* we're assuming you don't need it in this case.
*
* @param instance the instance to call the callbacks on
- * @param added the method to call when a service was added
- * @param changed the method to call when a service was changed
- * @param removed the method to call when a service was removed
+ * @param added the method to call when a bundle was added
+ * @param changed the method to call when a bundle was changed
+ * @param removed the method to call when a bundle was removed
* @return this service dependency
*/
BundleDependency setCallbacks(Object instance, String added, String changed, String removed);
diff --git a/dependencymanager/core/src/main/java/org/apache/felix/dm/Component.java b/dependencymanager/core/src/main/java/org/apache/felix/dm/Component.java
new file mode 100644
index 0000000..24cf9ce
--- /dev/null
+++ b/dependencymanager/core/src/main/java/org/apache/felix/dm/Component.java
@@ -0,0 +1,297 @@
+/*
+ * 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;
+
+import java.util.Dictionary;
+import java.util.List;
+
+import org.osgi.framework.ServiceRegistration;
+
+/**
+ * Component interface. Components are the main building blocks for OSGi applications.
+ * They can publish themselves as a service, and they can have dependencies. These
+ * dependencies will influence their life cycle as component will only be activated
+ * when all required dependencies are available.
+ *
+ * @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
+ */
+public interface Component {
+ /**
+ * Adds a new dependency to this component.
+ *
+ * @param dependency the dependency to add
+ * @return this component
+ */
+ public Component add(Dependency dependency);
+ public Component add(List dependencies);
+
+ /**
+ * Removes a dependency from this component.
+ *
+ * @param dependency the dependency to remove
+ * @return this component
+ */
+ public Component remove(Dependency dependency);
+
+ /**
+ * Sets the public interface under which this component should be registered
+ * in the OSGi service registry.
+ *
+ * @param serviceName the name of the service interface
+ * @param properties the properties for this service
+ * @return this component
+ */
+ public Component setInterface(String serviceName, Dictionary properties);
+
+ /**
+ * Sets the public interfaces under which this component should be registered
+ * in the OSGi service registry.
+ *
+ * @param serviceNames the names of the service interface
+ * @param properties the properties for these services
+ * @return this component
+ */
+ public Component setInterface(String[] serviceNames, Dictionary properties);
+
+ /**
+ * Sets the implementation for this component. You can actually specify
+ * an instance you have instantiated manually, or a <code>Class</code>
+ * that will be instantiated using its default constructor when the
+ * required dependencies are resolved, effectively giving you a lazy
+ * instantiation mechanism.
+ *
+ * There are four special methods that are called when found through
+ * reflection to give you life cycle management options:
+ * <ol>
+ * <li><code>init()</code> is invoked after the instance has been
+ * created and dependencies have been resolved, and can be used to
+ * initialize the internal state of the instance or even to add more
+ * dependencies based on runtime state</li>
+ * <li><code>start()</code> is invoked right before the service is
+ * registered</li>
+ * <li><code>stop()</code> is invoked right after the service is
+ * unregistered</li>
+ * <li><code>destroy()</code> is invoked after all dependencies are
+ * removed</li>
+ * </ol>
+ * In short, this allows you to initialize your instance before it is
+ * registered, perform some post-initialization and pre-destruction code
+ * as well as final cleanup. If a method is not defined, it simply is not
+ * called, so you can decide which one(s) you need. If you need even more
+ * fine-grained control, you can register as a service state listener too.
+ *
+ * @param implementation the implementation
+ * @return this component
+ * @see ComponentStateListener
+ */
+ public Component setImplementation(Object implementation);
+
+ /**
+ * Returns a list of dependencies.
+ *
+ * @return a list of dependencies
+ */
+ public List getDependencies();
+
+ /**
+ * Returns the service registration for this component. The method
+ * will return <code>null</code> if no service registration is
+ * available, for example if this component is not registered as a
+ * service at all.
+ *
+ * @return the service registration
+ */
+ public ServiceRegistration getServiceRegistration();
+
+ /**
+ * Returns the component instance for this component. The method will
+ * return <code>null</code> if no component instance is available.
+ *
+ * @return the component instance
+ */
+ public Object getService();
+
+ /**
+ * Returns the service properties associated with the component.
+ *
+ * @return the properties or <code>null</code> if there are none
+ */
+ public Dictionary getServiceProperties();
+
+ /**
+ * Sets the service properties associated with the component. If the service
+ * was already registered, it will be updated.
+ *
+ * @param serviceProperties the properties
+ */
+ public Component setServiceProperties(Dictionary serviceProperties);
+
+ /**
+ * Sets the names of the methods used as callbacks. These methods, when found, are
+ * invoked as part of the life cycle management of the component implementation. The
+ * dependency manager will look for a method of this name with the following signatures,
+ * in this order:
+ * <ol>
+ * <li>method(Component component)</li>
+ * <li>method()</li>
+ * </ol>
+ *
+ * @param init the name of the init method
+ * @param start the name of the start method
+ * @param stop the name of the stop method
+ * @param destroy the name of the destroy method
+ * @return the component
+ */
+ public Component setCallbacks(String init, String start, String stop, String destroy);
+ /**
+ * Sets the names of the methods used as callbacks. These methods, when found, are
+ * invoked on the specified instance as part of the life cycle management of the component
+ * implementation.
+ * <p>
+ * See setCallbacks(String init, String start, String stop, String destroy) for more
+ * information on the signatures. Specifying an instance means you can create a manager
+ * that will be invoked whenever the life cycle of a component changes and this manager
+ * can then decide how to expose this life cycle to the actual component, offering an
+ * important indirection when developing your own component models.
+ */
+ public Component setCallbacks(Object instance, String init, String start, String stop, String destroy);
+
+ // listener
+ /**
+ * Adds a component state listener to this component.
+ *
+ * @param listener the state listener
+ */
+ public void addStateListener(ComponentStateListener listener);
+
+ /**
+ * Removes a component state listener from this component.
+ *
+ * @param listener the state listener
+ */
+ public void removeStateListener(ComponentStateListener listener);
+
+ /**
+ * Starts the component. This activates the dependency tracking mechanism
+ * for this component.
+ */
+ public void start();
+
+ /**
+ * Stops the component. This deactivates the dependency tracking mechanism
+ * for this component.
+ */
+ public void stop();
+
+ /**
+ * Sets the factory to use to create the implementation. You can specify
+ * both the factory class and method to invoke. The method should return
+ * the implementation, and can use any method to create it. Actually, this
+ * can be used together with <code>setComposition</code> to create a
+ * composition of instances that work together to implement a component. The
+ * factory itself can also be instantiated lazily by not specifying an
+ * instance, but a <code>Class</code>.
+ *
+ * @param factory the factory instance or class
+ * @param createMethod the name of the create method
+ */
+ public Component setFactory(Object factory, String createMethod);
+
+ /**
+ * Sets the factory to use to create the implementation. You specify the
+ * method to invoke. The method should return the implementation, and can
+ * use any method to create it. Actually, this can be used together with
+ * <code>setComposition</code> to create a composition of instances that
+ * work together to implement a component.
+ * <p>
+ * Note that currently, there is no default for the factory, so please use
+ * <code>setFactory(factory, createMethod)</code> instead.
+ *
+ * @param createMethod the name of the create method
+ */
+ public Component setFactory(String createMethod);
+
+ /**
+ * Sets the instance and method to invoke to get back all instances that
+ * are part of a composition and need dependencies injected. All of them
+ * will be searched for any of the dependencies. The method that is
+ * invoked must return an <code>Object[]</code>.
+ *
+ * @param instance the instance that has the method
+ * @param getMethod the method to invoke
+ */
+ public Component setComposition(Object instance, String getMethod);
+
+ /**
+ * Sets the method to invoke on the service implementation to get back all
+ * instances that are part of a composition and need dependencies injected.
+ * All of them will be searched for any of the dependencies. The method that
+ * is invoked must return an <code>Object[]</code>.
+ *
+ * @param getMethod the method to invoke
+ */
+ public Component setComposition(String getMethod);
+
+ /**
+ * Returns the composition instances that make up this component, or just the
+ * component instance if it does not have a composition, or an empty array if
+ * the component has not even been instantiated.
+ */
+ public Object[] getCompositionInstances();
+
+ /**
+ * Returns the dependency manager associated with this component.
+ */
+ public DependencyManager getDependencyManager();
+
+ /**
+ * Configures auto configuration of injected classes in the component instance.
+ * The following injections are currently performed, unless you explicitly
+ * turn them off:
+ * <dl>
+ * <dt>BundleContext</dt><dd>the bundle context of the bundle</dd>
+ * <dt>ServiceRegistration</dt><dd>the service registration used to register your service</dd>
+ * <dt>DependencyManager</dt><dd>the dependency manager instance</dd>
+ * <dt>Component</dt><dd>the component instance of the dependency manager</dd>
+ * </dl>
+ *
+ * @param clazz the class (from the list above)
+ * @param autoConfig <code>false</code> to turn off auto configuration
+ */
+ public Component setAutoConfig(Class clazz, boolean autoConfig);
+
+ /**
+ * Configures auto configuration of injected classes in the component instance.
+ *
+ * @param clazz the class (from the list above)
+ * @param instanceName the name of the instance to inject the class into
+ * @see setAutoConfig(Class, boolean)
+ */
+ public Component setAutoConfig(Class clazz, String instanceName);
+
+ /**
+ * Returns the status of auto configuration of the specified class.
+ */
+ public boolean getAutoConfig(Class clazz);
+
+ /**
+ * Returns the instance variable name of auto configuration of the specified class.
+ */
+ public String getAutoConfigInstance(Class clazz);
+}
diff --git a/dependencymanager/core/src/main/java/org/apache/felix/dm/ServiceComponent.java b/dependencymanager/core/src/main/java/org/apache/felix/dm/ComponentDeclaration.java
similarity index 79%
rename from dependencymanager/core/src/main/java/org/apache/felix/dm/ServiceComponent.java
rename to dependencymanager/core/src/main/java/org/apache/felix/dm/ComponentDeclaration.java
index 1f68f4f..1a180f2 100644
--- a/dependencymanager/core/src/main/java/org/apache/felix/dm/ServiceComponent.java
+++ b/dependencymanager/core/src/main/java/org/apache/felix/dm/ComponentDeclaration.java
@@ -19,24 +19,24 @@
package org.apache.felix.dm;
/**
- * Describes a service component. Service components form descriptions of services
+ * Describes a component. Component declarations form descriptions of components
* that are managed by the dependency manager. They can be used to query their state
* for monitoring tools. The dependency manager shell command is an example of
* such a tool.
*
* @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
*/
-public interface ServiceComponent {
+public interface ComponentDeclaration {
/** Names for the states of this component. */
public static final String[] STATE_NAMES = { "unregistered", "registered" };
/** State constant for an unregistered component. */
public static final int STATE_UNREGISTERED = 0;
/** State constant for a registered component. */
public static final int STATE_REGISTERED = 1;
- /** Returns a list of dependencies associated with this service component. */
- public ServiceComponentDependency[] getComponentDependencies();
- /** Returns the name of this service component. */
+ /** Returns a list of dependencies associated with this component. */
+ public ComponentDependencyDeclaration[] getComponentDependencies();
+ /** Returns the name of this component. */
public String getName();
- /** Returns the state of this service component. */
+ /** Returns the state of this component. */
public int getState();
}
diff --git a/dependencymanager/core/src/main/java/org/apache/felix/dm/ServiceComponentDependency.java b/dependencymanager/core/src/main/java/org/apache/felix/dm/ComponentDependencyDeclaration.java
similarity index 93%
rename from dependencymanager/core/src/main/java/org/apache/felix/dm/ServiceComponentDependency.java
rename to dependencymanager/core/src/main/java/org/apache/felix/dm/ComponentDependencyDeclaration.java
index e9439b2..2d4e11b 100644
--- a/dependencymanager/core/src/main/java/org/apache/felix/dm/ServiceComponentDependency.java
+++ b/dependencymanager/core/src/main/java/org/apache/felix/dm/ComponentDependencyDeclaration.java
@@ -19,14 +19,14 @@
package org.apache.felix.dm;
/**
- * Describes a service component dependency. They form descriptions of dependencies
+ * Describes a component dependency. They form descriptions of dependencies
* that are managed by the dependency manager. They can be used to query their state
* for monitoring tools. The dependency manager shell command is an example of
* such a tool.
*
* @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
*/
-public interface ServiceComponentDependency {
+public interface ComponentDependencyDeclaration {
/** Names for the states of this dependency. */
public static final String[] STATE_NAMES = {
"optional unavailable",
diff --git a/dependencymanager/core/src/main/java/org/apache/felix/dm/ComponentStateListener.java b/dependencymanager/core/src/main/java/org/apache/felix/dm/ComponentStateListener.java
new file mode 100644
index 0000000..8c397f0
--- /dev/null
+++ b/dependencymanager/core/src/main/java/org/apache/felix/dm/ComponentStateListener.java
@@ -0,0 +1,62 @@
+/*
+ * 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;
+
+/**
+ * This interface can be used to register a component state listener. Component
+ * state listeners are called whenever a component state changes. You get notified
+ * when the component is starting, started, stopping and stopped. Each callback
+ * includes a reference to the component in question.
+ *
+ * @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
+ */
+public interface ComponentStateListener {
+ /**
+ * Called when the component is starting. At this point, the required
+ * dependencies have been injected, but the service has not been registered
+ * yet.
+ *
+ * @param component the component
+ */
+ public void starting(Component component);
+
+ /**
+ * Called when the component is started. At this point, the component has been
+ * registered.
+ *
+ * @param component the component
+ */
+ public void started(Component component);
+
+ /**
+ * Called when the component is stopping. At this point, the component is still
+ * registered.
+ *
+ * @param component the component
+ */
+ public void stopping(Component component);
+
+ /**
+ * Called when the component is stopped. At this point, the component has been
+ * unregistered.
+ *
+ * @param component the component
+ */
+ public void stopped(Component component);
+}
diff --git a/dependencymanager/core/src/main/java/org/apache/felix/dm/ConfigurationDependency.java b/dependencymanager/core/src/main/java/org/apache/felix/dm/ConfigurationDependency.java
index a82a9e9..d00dcf0 100644
--- a/dependencymanager/core/src/main/java/org/apache/felix/dm/ConfigurationDependency.java
+++ b/dependencymanager/core/src/main/java/org/apache/felix/dm/ConfigurationDependency.java
@@ -11,12 +11,11 @@
*/
package org.apache.felix.dm;
-
/**
* Configuration dependency that can track the availability of a (valid) configuration. To use
* it, specify a PID for the configuration. The dependency is always required, because if it is
* not, it does not make sense to use the dependency manager. In that scenario, simply register
- * your service as a <code>ManagedService(Factory)</code> and handle everything yourself. Also,
+ * your component as a <code>ManagedService(Factory)</code> and handle everything yourself. Also,
* only managed services are supported, not factories. There are a couple of things you need to
* be aware of when implementing the <code>updated(Dictionary)</code> method:
* <ul>
@@ -30,7 +29,7 @@
*
* @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
*/
-public interface ConfigurationDependency extends Dependency, ServiceComponentDependency
+public interface ConfigurationDependency extends Dependency, ComponentDependencyDeclaration
{
ConfigurationDependency setCallback(String callback);
@@ -72,5 +71,4 @@
ConfigurationDependency add(PropertyMetaData properties);
ConfigurationDependency setInstanceBound(boolean isInstanceBound);
-
}
diff --git a/dependencymanager/core/src/main/java/org/apache/felix/dm/Dependency.java b/dependencymanager/core/src/main/java/org/apache/felix/dm/Dependency.java
index 8388eeb..804b4c1 100644
--- a/dependencymanager/core/src/main/java/org/apache/felix/dm/Dependency.java
+++ b/dependencymanager/core/src/main/java/org/apache/felix/dm/Dependency.java
@@ -20,25 +20,24 @@
import java.util.Dictionary;
-
/**
- * Generic dependency for a service. A dependency can be required or not.
- * A dependency will be activated by the service it belongs to. The service
+ * Generic dependency for a component. A dependency can be required or not.
+ * A dependency will be activated by the component it belongs to. The component
* will call the <code>start(Service service)</code> and
* <code>stop(Service service)</code> methods.
*
* After it has been started, a dependency must callback
- * the associated service's <code>dependencyAvailable()</code> and
+ * the associated component's <code>dependencyAvailable()</code> and
* <code>dependencyUnavailable()</code>
* methods. State changes of the dependency itself may only be made as long as
- * the dependency is not 'active', meaning it is associated with a running service.
+ * the dependency is not 'active', meaning it is associated with a running component.
*
* @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
*/
public interface Dependency {
/**
* Returns <code>true</code> if this a required dependency. Required dependencies
- * are dependencies that must be available before the service can be activated.
+ * are dependencies that must be available before the component can be activated.
*
* @return <code>true</code> if the dependency is required
*/
@@ -61,11 +60,11 @@
/**
* Returns <code>true>code> if auto configuration is enabled for this dependency.
- * Auto configuration means that a dependency is injected in the service instance
+ * Auto configuration means that a dependency is injected in the component instance
* when it's available, and if it's unavailable, a "null object" will be inserted
* instead.
*
- * @return <code>true>code> if auto configuration is enabled for this dependency
+ * @return <code>true</code> if auto configuration is enabled for this dependency
*/
public boolean isAutoConfig();
@@ -84,7 +83,7 @@
public Object getAutoConfigInstance();
/**
- * Returns the name of the member in the class of the service instance
+ * Returns the name of the member in the class of the component instance
* to inject into. If you specify this, not all members of the right
* type will be injected, only the member whose name matches.
*
diff --git a/dependencymanager/core/src/main/java/org/apache/felix/dm/DependencyActivatorBase.java b/dependencymanager/core/src/main/java/org/apache/felix/dm/DependencyActivatorBase.java
index 719ff24..81a9835 100644
--- a/dependencymanager/core/src/main/java/org/apache/felix/dm/DependencyActivatorBase.java
+++ b/dependencymanager/core/src/main/java/org/apache/felix/dm/DependencyActivatorBase.java
@@ -20,8 +20,8 @@
import java.util.List;
+import org.apache.felix.dm.impl.ComponentImpl;
import org.apache.felix.dm.impl.Logger;
-import org.apache.felix.dm.impl.ServiceImpl;
import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;
@@ -40,7 +40,7 @@
private Logger m_logger;
/**
- * Initialize the dependency manager. Here you can add all services and their dependencies.
+ * Initialize the dependency manager. Here you can add all components and their dependencies.
* If something goes wrong and you do not want your bundle to be started, you can throw an
* exception. This exception will be passed on to the <code>start()</code> method of the
* bundle activator, causing the bundle not to start.
@@ -52,9 +52,10 @@
public abstract void init(BundleContext context, DependencyManager manager) throws Exception;
/**
- * Destroy the dependency manager. Here you can remove all services and their dependencies.
+ * Destroy the dependency manager. Here you can remove all components and their dependencies.
* Actually, the base class will clean up your dependencies anyway, so most of the time you
* don't need to do anything here.
+ * <p>
* If something goes wrong and you do not want your bundle to be stopped, you can throw an
* exception. This exception will be passed on to the <code>stop()</code> method of the
* bundle activator, causing the bundle not to stop.
@@ -121,12 +122,12 @@
}
/**
- * Creates a new service.
+ * Creates a new component.
*
- * @return the new service
+ * @return the new component
*/
- public Service createService() {
- return m_manager.createService();
+ public Component createComponent() {
+ return m_manager.createComponent();
}
/**
@@ -158,8 +159,9 @@
}
/**
- * Creates a new configuration property MetaData.
- * @return a new configuration property MetaData
+ * Creates a new configuration property metadata.
+ *
+ * @return the configuration property metadata
*/
public PropertyMetaData createPropertyMetaData() {
return m_manager.createPropertyMetaData();
@@ -173,55 +175,92 @@
public BundleDependency createBundleDependency() {
return m_manager.createBundleDependency();
}
-
+
+ /**
+ * Creates a new resource dependency.
+ *
+ * @return the resource dependency
+ */
public ResourceDependency createResourceDependency() {
return m_manager.createResourceDependency();
}
- public Service createAspectService(Class serviceInterface, String serviceFilter, int ranking, String attributeName) {
+ /**
+ * Creates a new aspect service.
+ *
+ * @return the aspect service
+ */
+ public Component createAspectService(Class serviceInterface, String serviceFilter, int ranking, String attributeName) {
return m_manager.createAspectService(serviceInterface, serviceFilter, ranking, attributeName);
}
-
- public Service createAdapterService(Class serviceInterface, String serviceFilter) {
+
+ /**
+ * Creates a new adapter service.
+ *
+ * @return the adapter service
+ */
+ public Component createAdapterService(Class serviceInterface, String serviceFilter) {
return m_manager.createAdapterService(serviceInterface, serviceFilter);
}
-
- public Service createResourceAdapter(String resourceFilter, boolean propagate, Object callbackInstance, String callbackChanged) {
+
+ /**
+ * Creates a new resource adapter service.
+ *
+ * @return the resource adapter service
+ */
+ public Component createResourceAdapter(String resourceFilter, boolean propagate, Object callbackInstance, String callbackChanged) {
return m_manager.createResourceAdapterService(resourceFilter, propagate, callbackInstance, callbackChanged);
}
-
- public Service createResourceAdapter(String resourceFilter, Object propagateCallbackInstance, String propagateCallbackMethod, Object callbackInstance, String callbackChanged) {
+
+ /**
+ * Creates a new resource adapter service.
+ *
+ * @return the resource adapter service
+ */
+ public Component createResourceAdapter(String resourceFilter, Object propagateCallbackInstance, String propagateCallbackMethod, Object callbackInstance, String callbackChanged) {
return m_manager.createResourceAdapterService(resourceFilter, propagateCallbackInstance, propagateCallbackMethod, callbackInstance, callbackChanged);
}
- public Service createBundleAdapterService(int bundleStateMask, String bundleFilter, boolean propagate) {
+ /**
+ * Creates a new bundle adapter service.
+ *
+ * @return the bundle adapter service
+ */
+ public Component createBundleAdapterService(int bundleStateMask, String bundleFilter, boolean propagate) {
return m_manager.createBundleAdapterService(bundleStateMask, bundleFilter, propagate);
}
- public Service createFactoryConfigurationAdapterService(String factoryPid, String update, boolean propagate) {
+ /**
+ * Creates a new factory configuration adapter service.
+ *
+ * @return the factory configuration adapter service
+ */
+ public Component createFactoryConfigurationAdapterService(String factoryPid, String update, boolean propagate) {
return m_manager.createFactoryConfigurationAdapterService(factoryPid, update, propagate);
}
- public Service createFactoryConfigurationAdapterService(String factoryPid, String update, boolean propagate,
- String heading, String desc, String localization, PropertyMetaData[] propertiesMetaData)
- {
- return m_manager.createFactoryConfigurationAdapterService(factoryPid, update, propagate,
- heading, desc, localization, propertiesMetaData);
+ /**
+ * Creates a new factory configuration adapter service.
+ *
+ * @return the factory configuration adapter service
+ */
+ public Component createFactoryConfigurationAdapterService(String factoryPid, String update, boolean propagate, String heading, String desc, String localization, PropertyMetaData[] propertiesMetaData) {
+ return m_manager.createFactoryConfigurationAdapterService(factoryPid, update, propagate, heading, desc, localization, propertiesMetaData);
}
/**
- * Cleans up all services and their dependencies.
+ * Cleans up all components and their dependencies.
*
* @param manager the dependency manager
*/
private void cleanup(DependencyManager manager) {
List services = manager.getServices();
for (int i = services.size() - 1; i >= 0; i--) {
- Service service = (Service) services.get(i);
+ Component service = (Component) services.get(i);
manager.remove(service);
// remove any state listeners that are still registered
- if (service instanceof ServiceImpl) {
- ServiceImpl si = (ServiceImpl) service;
+ if (service instanceof ComponentImpl) {
+ ComponentImpl si = (ComponentImpl) service;
si.removeStateListeners();
}
}
diff --git a/dependencymanager/core/src/main/java/org/apache/felix/dm/DependencyManager.java b/dependencymanager/core/src/main/java/org/apache/felix/dm/DependencyManager.java
index afcf517..6522a9c 100644
--- a/dependencymanager/core/src/main/java/org/apache/felix/dm/DependencyManager.java
+++ b/dependencymanager/core/src/main/java/org/apache/felix/dm/DependencyManager.java
@@ -25,10 +25,10 @@
import org.apache.felix.dm.impl.AdapterServiceImpl;
import org.apache.felix.dm.impl.AspectServiceImpl;
import org.apache.felix.dm.impl.BundleAdapterServiceImpl;
+import org.apache.felix.dm.impl.ComponentImpl;
import org.apache.felix.dm.impl.FactoryConfigurationAdapterServiceImpl;
import org.apache.felix.dm.impl.Logger;
import org.apache.felix.dm.impl.ResourceAdapterServiceImpl;
-import org.apache.felix.dm.impl.ServiceImpl;
import org.apache.felix.dm.impl.dependencies.BundleDependencyImpl;
import org.apache.felix.dm.impl.dependencies.ConfigurationDependencyImpl;
import org.apache.felix.dm.impl.dependencies.ResourceDependencyImpl;
@@ -38,8 +38,8 @@
import org.osgi.framework.BundleContext;
/**
- * The dependency manager manages all services and their dependencies. Using
- * this API you can declare all services and their dependencies. Under normal
+ * The dependency manager manages all components and their dependencies. Using
+ * this API you can declare all components and their dependencies. Under normal
* circumstances, you get passed an instance of this class through the
* <code>DependencyActivatorBase</code> subclass you use as your
* <code>BundleActivator</code>, but it is also possible to create your
@@ -76,7 +76,7 @@
*
* @param service the service to add
*/
- public void add(Service service) {
+ public void add(Component service) {
m_services.add(service);
service.start();
}
@@ -87,7 +87,7 @@
*
* @param service the service to remove
*/
- public void remove(Service service) {
+ public void remove(Component service) {
service.stop();
m_services.remove(service);
}
@@ -97,8 +97,8 @@
*
* @return the new service
*/
- public Service createService() {
- return new ServiceImpl(m_context, this, m_logger);
+ public Component createComponent() {
+ return new ComponentImpl(m_context, this, m_logger);
}
/**
@@ -129,8 +129,9 @@
}
/**
- * Creates a new configuration property MetaData.
- * @return a new Configuration property MetaData.
+ * Creates a new configuration property metadata.
+ *
+ * @return the configuration property metadata.
*/
public PropertyMetaData createPropertyMetaData() {
return new PropertyMetaDataImpl();
@@ -175,10 +176,10 @@
* @param serviceFilter the filter condition to use with the service interface
* @param ranking the level used to organize the aspect chain ordering
* @param attributeName the aspect implementation field name where to inject original service.
- * If null, any field matching the original service will be injected.
+ * If null, any field matching the original service will be injected.
* @return a service that acts as a factory for generating aspects
*/
- public Service createAspectService(Class serviceInterface, String serviceFilter, int ranking, String attributeName) {
+ public Component createAspectService(Class serviceInterface, String serviceFilter, int ranking, String attributeName) {
return new AspectServiceImpl(this, serviceInterface, serviceFilter, ranking, attributeName);
}
@@ -204,7 +205,7 @@
* @param serviceFilter the filter condition to use with the service interface
* @return a service that acts as a factory for generating adapters
*/
- public Service createAdapterService(Class serviceInterface, String serviceFilter) {
+ public Component createAdapterService(Class serviceInterface, String serviceFilter) {
return new AdapterServiceImpl(this, serviceInterface, serviceFilter);
}
@@ -234,11 +235,11 @@
* @return a service that acts as a factory for generating resource adapters
* @see Resource
*/
- public Service createResourceAdapterService(String resourceFilter, boolean propagate, Object callbackInstance, String callbackChanged) {
+ public Component createResourceAdapterService(String resourceFilter, boolean propagate, Object callbackInstance, String callbackChanged) {
return new ResourceAdapterServiceImpl(this, resourceFilter, propagate, callbackInstance, callbackChanged);
}
- public Service createResourceAdapterService(String resourceFilter, Object propagateCallbackInstance, String propagateCallbackMethod, Object callbackInstance, String callbackChanged) {
+ public Component createResourceAdapterService(String resourceFilter, Object propagateCallbackInstance, String propagateCallbackMethod, Object callbackInstance, String callbackChanged) {
return new ResourceAdapterServiceImpl(this, resourceFilter, propagateCallbackInstance, propagateCallbackMethod, callbackInstance, callbackChanged);
}
@@ -269,7 +270,7 @@
* @param propagate <code>true</code> if properties from the bundle should be propagated to the service
* @return a service that acts as a factory for generating bundle adapters
*/
- public Service createBundleAdapterService(int bundleStateMask, String bundleFilter, boolean propagate) {
+ public Component createBundleAdapterService(int bundleStateMask, String bundleFilter, boolean propagate) {
return new BundleAdapterServiceImpl(this, bundleStateMask, bundleFilter, propagate);
}
@@ -296,7 +297,7 @@
* @param propagate true if public factory configuration should be propagated to the adapter service properties
* @return a service that acts as a factory for generating the managed service factory configuration adapter
*/
- public Service createFactoryConfigurationAdapterService(String factoryPid, String update, boolean propagate) {
+ public Component createFactoryConfigurationAdapterService(String factoryPid, String update, boolean propagate) {
return new FactoryConfigurationAdapterServiceImpl(this, factoryPid, update, propagate);
}
@@ -346,7 +347,7 @@
* @param propertiesMetaData Array of MetaData regarding configuration properties
* @return a service that acts as a factory for generating the managed service factory configuration adapter
*/
- public Service createFactoryConfigurationAdapterService(String factoryPid, String update, boolean propagate,
+ public Component createFactoryConfigurationAdapterService(String factoryPid, String update, boolean propagate,
String heading, String desc, String localization,
PropertyMetaData[] propertiesMetaData)
{
diff --git a/dependencymanager/core/src/main/java/org/apache/felix/dm/DependencyService.java b/dependencymanager/core/src/main/java/org/apache/felix/dm/DependencyService.java
index 74a7fa4..4fb0c8e 100644
--- a/dependencymanager/core/src/main/java/org/apache/felix/dm/DependencyService.java
+++ b/dependencymanager/core/src/main/java/org/apache/felix/dm/DependencyService.java
@@ -51,5 +51,5 @@
*/
public void invokeCallbackMethod(Object[] instances, String methodName, Class[][] signatures, Object[][] parameters);
- public Service getServiceInterface();
+ public Component getServiceInterface();
}
diff --git a/dependencymanager/core/src/main/java/org/apache/felix/dm/PropertyMetaData.java b/dependencymanager/core/src/main/java/org/apache/felix/dm/PropertyMetaData.java
index 37732a5..e7c1296 100644
--- a/dependencymanager/core/src/main/java/org/apache/felix/dm/PropertyMetaData.java
+++ b/dependencymanager/core/src/main/java/org/apache/felix/dm/PropertyMetaData.java
@@ -14,19 +14,18 @@
/**
* This interface defines meta data regarding a given configuration property.
*/
-public interface PropertyMetaData
-{
+public interface PropertyMetaData {
/**
* The label used to display the property. Example: "Log Level".
* @return The label used to display the property (may be localized)
*/
- PropertyMetaData setHeading(String heading);
+ public PropertyMetaData setHeading(String heading);
/**
* The key of a ConfigurationAdmin property. Example: "printer.logLevel"
* @return The Configuration Admin property name
*/
- PropertyMetaData setId(String id);
+ public PropertyMetaData setId(String id);
/**
* Returns the property primitive type. If must be either one of the following types:<p>
@@ -41,7 +40,7 @@
* <li>Boolean.class</li>
* </ul>
*/
- PropertyMetaData setType(Class type);
+ public PropertyMetaData setType(Class type);
/**
* Returns a default for this property. The object must be of the appropriate type as defined by the cardinality and getType().
@@ -50,14 +49,14 @@
* If the cardinality is 1, it must contain 0 or 1 elements. If it is -5, it must contain from 0 to max 5 elements. Note that
* the special case of a 0 cardinality, meaning a single value, does not allow arrays or vectors of 0 elements.
*/
- PropertyMetaData setDefaults(String[] defaults);
+ public PropertyMetaData setDefaults(String[] defaults);
/**
* Returns the property description. The description may be localized and must describe the semantics of this type and any
* constraints. Example: "Select the log level for the Printer Service".
* @return a localizable description of the property.
*/
- PropertyMetaData setDescription(String description);
+ public PropertyMetaData setDescription(String description);
/**
* Return the cardinality of this property. The OSGi environment handles multi valued properties in arrays ([]) or in Vector objects.
@@ -71,16 +70,16 @@
* <li> x = 0 1 occurrence required</li>
* </ul>
*/
- PropertyMetaData setCardinality(int cardinality);
+ public PropertyMetaData setCardinality(int cardinality);
/**
* Tells if this property is required or not.
*/
- PropertyMetaData setRequired(boolean required);
+ public PropertyMetaData setRequired(boolean required);
/**
* Return a list of valid options for this property (the labels may be localized).
* @return the list of valid options for this property.
*/
- PropertyMetaData addOption(String optionLabel, String optionValue);
+ public PropertyMetaData addOption(String optionLabel, String optionValue);
}
\ No newline at end of file
diff --git a/dependencymanager/core/src/main/java/org/apache/felix/dm/ResourceDependency.java b/dependencymanager/core/src/main/java/org/apache/felix/dm/ResourceDependency.java
index 431003c..fb073a7 100644
--- a/dependencymanager/core/src/main/java/org/apache/felix/dm/ResourceDependency.java
+++ b/dependencymanager/core/src/main/java/org/apache/felix/dm/ResourceDependency.java
@@ -21,7 +21,7 @@
import java.net.URL;
-public interface ResourceDependency extends Dependency, ServiceComponentDependency, ResourceHandler {
+public interface ResourceDependency extends Dependency, ComponentDependencyDeclaration, ResourceHandler {
/**
* Sets the callbacks for this service. These callbacks can be used as hooks whenever a
* dependency is added or removed. When you specify callbacks, the auto configuration
diff --git a/dependencymanager/core/src/main/java/org/apache/felix/dm/Service.java b/dependencymanager/core/src/main/java/org/apache/felix/dm/Service.java
deleted file mode 100644
index b7bfd24..0000000
--- a/dependencymanager/core/src/main/java/org/apache/felix/dm/Service.java
+++ /dev/null
@@ -1,276 +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;
-
-import java.util.Dictionary;
-import java.util.List;
-
-import org.osgi.framework.ServiceRegistration;
-
-/**
- * Service interface.
- *
- * @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
- */
-public interface Service {
- /**
- * Adds a new dependency to this service.
- *
- * @param dependency the dependency to add
- * @return this service
- */
- public Service add(Dependency dependency);
- public Service add(List dependencies);
-
- /**
- * Removes a dependency from this service.
- *
- * @param dependency the dependency to remove
- * @return this service
- */
- public Service remove(Dependency dependency);
-
- /**
- * Sets the public interface under which this service should be registered
- * in the OSGi service registry.
- *
- * @param serviceName the name of the service interface
- * @param properties the properties for this service
- * @return this service
- */
- public Service setInterface(String serviceName, Dictionary properties);
-
- /**
- * Sets the public interfaces under which this service should be registered
- * in the OSGi service registry.
- *
- * @param serviceNames the names of the service interface
- * @param properties the properties for this service
- * @return this service
- */
- public Service setInterface(String[] serviceNames, Dictionary properties);
-
- /**
- * Sets the implementation for this service. You can actually specify
- * an instance you have instantiated manually, or a <code>Class</code>
- * that will be instantiated using its default constructor when the
- * required dependencies are resolved (effectively giving you a lazy
- * instantiation mechanism).
- *
- * There are four special methods that are called when found through
- * reflection to give you some life-cycle management options:
- * <ol>
- * <li><code>init()</code> is invoked right after the instance has been
- * created, and before any dependencies are resolved, and can be used to
- * initialize the internal state of the instance</li>
- * <li><code>start()</code> is invoked after the required dependencies
- * are resolved and injected, and before the service is registered</li>
- * <li><code>stop()</code> is invoked right after the service is
- * unregistered</li>
- * <li><code>destroy()</code> is invoked after all dependencies are
- * removed</li>
- * </ol>
- * In short, this allows you to initialize your instance before it is
- * registered, perform some post-initialization and pre-destruction code
- * as well as final cleanup. If a method is not defined, it simply is not
- * called, so you can decide which one(s) you need. If you need even more
- * fine-grained control, you can register as a service state listener too.
- *
- * @param implementation the implementation
- * @return this service
- * @see ServiceStateListener
- */
- public Service setImplementation(Object implementation);
-
- /**
- * Returns a list of dependencies.
- *
- * @return a list of dependencies
- */
- public List getDependencies();
-
- /**
- * Returns the service registration for this service. The method
- * will return <code>null</code> if no service registration is
- * available.
- *
- * @return the service registration
- */
- public ServiceRegistration getServiceRegistration();
-
- /**
- * Returns the service instance for this service. The method will
- * return <code>null</code> if no service instance is available.
- *
- * @return the service instance
- */
- public Object getService();
-
- /**
- * Returns the service properties associated with the service.
- *
- * @return the properties or <code>null</code> if there are none
- */
- public Dictionary getServiceProperties();
-
- /**
- * Sets the service properties associated with the service. If the service
- * was already registered, it will be updated.
- *
- * @param serviceProperties the properties
- */
- public Service setServiceProperties(Dictionary serviceProperties);
-
- /**
- * Sets the names of the methods used as callbacks. These methods, when found, are
- * invoked as part of the life-cycle management of the service implementation. The
- * methods should not have any parameters.
- *
- * @param init the name of the init method
- * @param start the name of the start method
- * @param stop the name of the stop method
- * @param destroy the name of the destroy method
- * @return the service instance
- */
- public Service setCallbacks(String init, String start, String stop, String destroy);
- public Service setCallbacks(Object instance, String init, String start, String stop, String destroy);
-
- // listener
- /**
- * Adds a service state listener to this service.
- *
- * @param listener the state listener
- */
- public void addStateListener(ServiceStateListener listener);
-
- /**
- * Removes a service state listener from this service.
- *
- * @param listener the state listener
- */
- public void removeStateListener(ServiceStateListener listener);
-
- /**
- * Starts the service. This activates the dependency tracking mechanism
- * for this service.
- */
- public void start();
-
- /**
- * Stops the service. This deactivates the dependency tracking mechanism
- * for this service.
- */
- public void stop();
-
- /**
- * Sets the factory to use to create the implementation. You can specify
- * both the factory class and method to invoke. The method should return
- * the implementation, and can use any method to create it. Actually, this
- * can be used together with <code>setComposition</code> to create a
- * composition of instances that work together to implement a service. The
- * factory itself can also be instantiated lazily by not specifying an
- * instance, but a <code>Class</code>.
- *
- * @param factory the factory instance or class
- * @param createMethod the name of the create method
- */
- public Service setFactory(Object factory, String createMethod);
-
- /**
- * Sets the factory to use to create the implementation. You specify the
- * method to invoke. The method should return the implementation, and can
- * use any method to create it. Actually, this can be used together with
- * <code>setComposition</code> to create a composition of instances that
- * work together to implement a service.
- * <p>
- * Note that currently, there is no default for the factory, so please use
- * <code>setFactory(factory, createMethod)</code> instead.
- *
- * @param createMethod the name of the create method
- */
- public Service setFactory(String createMethod);
-
- /**
- * Sets the instance and method to invoke to get back all instances that
- * are part of a composition and need dependencies injected. All of them
- * will be searched for any of the dependencies. The method that is
- * invoked must return an <code>Object[]</code>.
- *
- * @param instance the instance that has the method
- * @param getMethod the method to invoke
- */
- public Service setComposition(Object instance, String getMethod);
-
- /**
- * Sets the method to invoke on the service implementation to get back all
- * instances that are part of a composition and need dependencies injected.
- * All of them will be searched for any of the dependencies. The method that
- * is invoked must return an <code>Object[]</code>.
- *
- * @param getMethod the method to invoke
- */
- public Service setComposition(String getMethod);
-
- /**
- * Returns the composition instances that make up this service, or just the
- * service instance if it does not have a composition, or an empty array if
- * the service has not even been instantiated.
- */
- public Object[] getCompositionInstances();
-
- /**
- * Returns the dependency manager associated with this service.
- */
- public DependencyManager getDependencyManager();
-
- /**
- * Configures auto configuration of injected classes in the service instance.
- * The following injections are currently performed, unless you explicitly
- * turn them off:
- * <dl>
- * <dt>BundleContext</dt><dd>the bundle context of the bundle</dd>
- * <dt>ServiceRegistration</dt><dd>the service registration used to register your service</dd>
- * <dt>DependencyManager</dt><dd>the dependency manager instance</dd>
- * <dt>Service</dt><dd>the service instance of the dependency manager</dd>
- * </dl>
- *
- * @param clazz the class (from the list above)
- * @param autoConfig <code>false</code> to turn off auto configuration
- */
- public Service setAutoConfig(Class clazz, boolean autoConfig);
-
- /**
- * Configures auto configuration of injected classes in the service instance.
- *
- * @param clazz the class (from the list above)
- * @param instanceName the name of the instance to inject the class into
- * @see setAutoConfig(Class, boolean)
- */
- public Service setAutoConfig(Class clazz, String instanceName);
-
- /**
- * Returns the status of auto configuration of the specified class.
- */
- public boolean getAutoConfig(Class clazz);
-
- /**
- * Returns the instance variable name of auto configuration of the specified class.
- */
- public String getAutoConfigInstance(Class clazz);
-}
diff --git a/dependencymanager/core/src/main/java/org/apache/felix/dm/ServiceDependency.java b/dependencymanager/core/src/main/java/org/apache/felix/dm/ServiceDependency.java
index 5b5baeb..2f6fea6 100644
--- a/dependencymanager/core/src/main/java/org/apache/felix/dm/ServiceDependency.java
+++ b/dependencymanager/core/src/main/java/org/apache/felix/dm/ServiceDependency.java
@@ -25,7 +25,7 @@
*
* @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
*/
-public interface ServiceDependency extends Dependency, ServiceComponentDependency {
+public interface ServiceDependency extends Dependency, ComponentDependencyDeclaration {
/**
* Sets the name of the service that should be tracked.
*
diff --git a/dependencymanager/core/src/main/java/org/apache/felix/dm/ServiceStateListener.java b/dependencymanager/core/src/main/java/org/apache/felix/dm/ServiceStateListener.java
deleted file mode 100644
index dbb70bc..0000000
--- a/dependencymanager/core/src/main/java/org/apache/felix/dm/ServiceStateListener.java
+++ /dev/null
@@ -1,63 +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;
-
-
-/**
- * This interface can be used to register a service state listener. Service
- * state listeners are called whenever a service state changes. You get notified
- * when the service is starting, started, stopping and stopped. Each callback
- * includes a reference to the service in question.
- *
- * @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
- */
-public interface ServiceStateListener {
- /**
- * Called when the service is starting. At this point, the required
- * dependencies have been injected, but the service has not been registered
- * yet.
- *
- * @param service the service
- */
- public void starting(Service service);
-
- /**
- * Called when the service is started. At this point, the service has been
- * registered.
- *
- * @param service the service
- */
- public void started(Service service);
-
- /**
- * Called when the service is stopping. At this point, the service is still
- * registered.
- *
- * @param service the service
- */
- public void stopping(Service service);
-
- /**
- * Called when the service is stopped. At this point, the service has been
- * unregistered.
- *
- * @param service the service
- */
- public void stopped(Service service);
-}
diff --git a/dependencymanager/core/src/main/java/org/apache/felix/dm/impl/AbstractDecorator.java b/dependencymanager/core/src/main/java/org/apache/felix/dm/impl/AbstractDecorator.java
index c889744..c9ee905 100644
--- a/dependencymanager/core/src/main/java/org/apache/felix/dm/impl/AbstractDecorator.java
+++ b/dependencymanager/core/src/main/java/org/apache/felix/dm/impl/AbstractDecorator.java
@@ -27,8 +27,8 @@
import org.apache.felix.dm.Dependency;
import org.apache.felix.dm.DependencyManager;
-import org.apache.felix.dm.Service;
-import org.apache.felix.dm.ServiceStateListener;
+import org.apache.felix.dm.Component;
+import org.apache.felix.dm.ComponentStateListener;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceReference;
@@ -39,7 +39,7 @@
protected volatile DependencyManager m_manager;
private final Map m_services = new HashMap();
- public abstract Service createService(Object[] properties);
+ public abstract Component createService(Object[] properties);
/**
* Extra method, which may be used by sub-classes, when adaptee has changed.
@@ -60,35 +60,35 @@
}
Iterator i = services.values().iterator();
while (i.hasNext()) {
- ((Service) i.next()).setServiceProperties(serviceProperties);
+ ((Component) i.next()).setServiceProperties(serviceProperties);
}
}
/**
* Remove a StateListener from all already instantiated services.
*/
- public void addStateListener(ServiceStateListener listener) {
+ public void addStateListener(ComponentStateListener listener) {
Map services = new HashMap();
synchronized (this) {
services.putAll(m_services);
}
Iterator i = services.values().iterator();
while (i.hasNext()) {
- ((Service) i.next()).addStateListener(listener);
+ ((Component) i.next()).addStateListener(listener);
}
}
/**
* Remove a StateListener from all already instantiated services.
*/
- public void removeStateListener(ServiceStateListener listener) {
+ public void removeStateListener(ComponentStateListener listener) {
Map services = new HashMap();
synchronized (this) {
services.putAll(m_services);
}
Iterator i = services.values().iterator();
while (i.hasNext()) {
- ((Service) i.next()).removeStateListener(listener);
+ ((Component) i.next()).removeStateListener(listener);
}
}
@@ -102,7 +102,7 @@
}
Iterator i = services.values().iterator();
while (i.hasNext()) {
- ((Service) i.next()).add(d);
+ ((Component) i.next()).add(d);
}
}
@@ -116,7 +116,7 @@
}
Iterator i = services.values().iterator();
while (i.hasNext()) {
- ((Service) i.next()).add(dependencies);
+ ((Component) i.next()).add(dependencies);
}
}
@@ -130,16 +130,16 @@
}
Iterator i = services.values().iterator();
while (i.hasNext()) {
- ((Service) i.next()).remove(d);
+ ((Component) i.next()).remove(d);
}
}
// callbacks for FactoryConfigurationAdapterImpl
public void updated(String pid, Dictionary properties) throws ConfigurationException {
try {
- Service service;
+ Component service;
synchronized (this) {
- service = (Service) m_services.get(pid);
+ service = (Component) m_services.get(pid);
}
if (service == null) {
service = createService(new Object[] { properties });
@@ -164,9 +164,9 @@
}
public void deleted(String pid) {
- Service service = null;
+ Component service = null;
synchronized (this) {
- service = (Service) m_services.remove(pid);
+ service = (Component) m_services.remove(pid);
}
if (service != null)
{
@@ -176,13 +176,13 @@
// callbacks for resources
public void added(URL resource) {
- Service newService = createService(new Object[] { resource });
+ Component newService = createService(new Object[] { resource });
m_services.put(resource, newService);
m_manager.add(newService);
}
public void removed(URL resource) {
- Service newService = (Service) m_services.remove(resource);
+ Component newService = (Component) m_services.remove(resource);
if (newService == null) {
System.out.println("Service should not be null here, dumping stack.");
Thread.dumpStack();
@@ -194,13 +194,13 @@
// callbacks for services
public void added(ServiceReference ref, Object service) {
- Service newService = createService(new Object[] { ref, service });
+ Component newService = createService(new Object[] { ref, service });
m_services.put(ref, newService);
m_manager.add(newService);
}
public void removed(ServiceReference ref, Object service) {
- Service newService = (Service) m_services.remove(ref);
+ Component newService = (Component) m_services.remove(ref);
if (newService == null) {
System.out.println("Service should not be null here, dumping stack.");
Thread.dumpStack();
@@ -212,13 +212,13 @@
// callbacks for bundles
public void added(Bundle bundle) {
- Service newService = createService(new Object[] { bundle });
+ Component newService = createService(new Object[] { bundle });
m_services.put(bundle, newService);
m_manager.add(newService);
}
public void removed(Bundle bundle) {
- Service newService = (Service) m_services.remove(bundle);
+ Component newService = (Component) m_services.remove(bundle);
if (newService == null) {
System.out.println("Service should not be null here, dumping stack.");
Thread.dumpStack();
@@ -231,19 +231,19 @@
public void stop() {
Iterator i = m_services.values().iterator();
while (i.hasNext()) {
- m_manager.remove((Service) i.next());
+ m_manager.remove((Component) i.next());
}
m_services.clear();
}
- public void configureAutoConfigState(Service target, Service source) {
+ public void configureAutoConfigState(Component target, Component source) {
configureAutoConfigState(target, source, BundleContext.class);
configureAutoConfigState(target, source, ServiceRegistration.class);
configureAutoConfigState(target, source, DependencyManager.class);
- configureAutoConfigState(target, source, Service.class);
+ configureAutoConfigState(target, source, Component.class);
}
- private void configureAutoConfigState(Service target, Service source, Class clazz) {
+ private void configureAutoConfigState(Component target, Component source, Class clazz) {
String name = source.getAutoConfigInstance(clazz);
if (name != null) {
target.setAutoConfig(clazz, name);
diff --git a/dependencymanager/core/src/main/java/org/apache/felix/dm/impl/AdapterServiceImpl.java b/dependencymanager/core/src/main/java/org/apache/felix/dm/impl/AdapterServiceImpl.java
index 761c877..76b2297 100644
--- a/dependencymanager/core/src/main/java/org/apache/felix/dm/impl/AdapterServiceImpl.java
+++ b/dependencymanager/core/src/main/java/org/apache/felix/dm/impl/AdapterServiceImpl.java
@@ -23,8 +23,8 @@
import org.apache.felix.dm.Dependency;
import org.apache.felix.dm.DependencyManager;
-import org.apache.felix.dm.Service;
-import org.apache.felix.dm.ServiceStateListener;
+import org.apache.felix.dm.Component;
+import org.apache.felix.dm.ComponentStateListener;
import org.osgi.framework.Constants;
import org.osgi.framework.ServiceReference;
@@ -42,7 +42,7 @@
*/
public AdapterServiceImpl(DependencyManager dm, Class adapteeInterface, String adapteeFilter)
{
- super(dm.createService()); // This service will be filtered by our super class, allowing us to take control.
+ super(dm.createComponent()); // This service will be filtered by our super class, allowing us to take control.
m_service.setImplementation(new AdapterImpl(adapteeInterface, adapteeFilter))
.add(dm.createServiceDependency()
.setService(adapteeInterface, adapteeFilter)
@@ -59,7 +59,7 @@
m_adapteeFilter = adapteeFilter;
}
- public Service createService(Object[] properties) {
+ public Component createService(Object[] properties) {
ServiceReference ref = (ServiceReference) properties[0];
Properties props = new Properties();
String[] keys = ref.getPropertyKeys();
@@ -81,7 +81,7 @@
}
List dependencies = m_service.getDependencies();
dependencies.remove(0);
- Service service = m_manager.createService()
+ Component service = m_manager.createComponent()
.setInterface(m_serviceInterfaces, props)
.setImplementation(m_serviceImpl)
.setFactory(m_factory, m_factoryCreateMethod) // if not set, no effect
@@ -99,7 +99,7 @@
}
for (int i = 0; i < m_stateListeners.size(); i ++) {
- service.addStateListener((ServiceStateListener) m_stateListeners.get(i));
+ service.addStateListener((ComponentStateListener) m_stateListeners.get(i));
}
return service;
}
diff --git a/dependencymanager/core/src/main/java/org/apache/felix/dm/impl/AspectServiceImpl.java b/dependencymanager/core/src/main/java/org/apache/felix/dm/impl/AspectServiceImpl.java
index a3d93e9..8ba2c61 100644
--- a/dependencymanager/core/src/main/java/org/apache/felix/dm/impl/AspectServiceImpl.java
+++ b/dependencymanager/core/src/main/java/org/apache/felix/dm/impl/AspectServiceImpl.java
@@ -25,9 +25,9 @@
import org.apache.felix.dm.Dependency;
import org.apache.felix.dm.DependencyManager;
-import org.apache.felix.dm.Service;
+import org.apache.felix.dm.Component;
import org.apache.felix.dm.ServiceDependency;
-import org.apache.felix.dm.ServiceStateListener;
+import org.apache.felix.dm.ComponentStateListener;
import org.osgi.framework.Constants;
import org.osgi.framework.ServiceReference;
@@ -38,7 +38,7 @@
public class AspectServiceImpl extends FilterService {
public AspectServiceImpl(DependencyManager dm, Class aspectInterface, String aspectFilter, int ranking, String autoConfig)
{
- super(dm.createService()); // This service will be filtered by our super class, allowing us to take control.
+ super(dm.createComponent()); // This service will be filtered by our super class, allowing us to take control.
m_service.setImplementation(new AspectImpl(aspectInterface, aspectFilter, ranking, autoConfig))
.add(dm.createServiceDependency()
.setService(aspectInterface, createDependencyFilterForAspect(aspectFilter))
@@ -73,14 +73,14 @@
m_field = field;
}
- public Service createService(Object[] params) {
+ public Component createService(Object[] params) {
List dependencies = m_service.getDependencies();
// remove our internal dependency
dependencies.remove(0);
// replace it with one that points to the specific service that just was passed in
Properties serviceProperties = getServiceProperties(params);
String[] serviceInterfaces = getServiceInterfaces();
- Service service = m_manager.createService()
+ Component service = m_manager.createComponent()
.setInterface(serviceInterfaces, serviceProperties)
.setImplementation(m_serviceImpl)
.setFactory(m_factory, m_factoryCreateMethod) // if not set, no effect
@@ -95,7 +95,7 @@
}
for (int i = 0; i < m_stateListeners.size(); i++) {
- service.addStateListener((ServiceStateListener) m_stateListeners.get(i));
+ service.addStateListener((ComponentStateListener) m_stateListeners.get(i));
}
return service;
}
diff --git a/dependencymanager/core/src/main/java/org/apache/felix/dm/impl/BundleAdapterServiceImpl.java b/dependencymanager/core/src/main/java/org/apache/felix/dm/impl/BundleAdapterServiceImpl.java
index 6dedaa1..043afc1 100644
--- a/dependencymanager/core/src/main/java/org/apache/felix/dm/impl/BundleAdapterServiceImpl.java
+++ b/dependencymanager/core/src/main/java/org/apache/felix/dm/impl/BundleAdapterServiceImpl.java
@@ -24,8 +24,8 @@
import org.apache.felix.dm.Dependency;
import org.apache.felix.dm.DependencyManager;
-import org.apache.felix.dm.Service;
-import org.apache.felix.dm.ServiceStateListener;
+import org.apache.felix.dm.Component;
+import org.apache.felix.dm.ComponentStateListener;
import org.osgi.framework.Bundle;
/**
@@ -39,7 +39,7 @@
*/
public BundleAdapterServiceImpl(DependencyManager dm, int bundleStateMask, String bundleFilter, boolean propagate)
{
- super(dm.createService()); // This service will be filtered by our super class, allowing us to take control.
+ super(dm.createComponent()); // This service will be filtered by our super class, allowing us to take control.
m_service.setImplementation(new BundleAdapterImpl(bundleStateMask, bundleFilter, propagate))
.add(dm.createBundleDependency()
.setFilter(bundleFilter)
@@ -58,7 +58,7 @@
m_propagate = propagate;
}
- public Service createService(Object[] properties) {
+ public Component createService(Object[] properties) {
Bundle bundle = (Bundle) properties[0];
Properties props = new Properties();
if (m_serviceProperties != null) {
@@ -72,7 +72,7 @@
// the first dependency is always the dependency on the bundle, which
// will be replaced with a more specific dependency below
dependencies.remove(0);
- Service service = m_manager.createService()
+ Component service = m_manager.createComponent()
.setInterface(m_serviceInterfaces, props)
.setImplementation(m_serviceImpl)
.setFactory(m_factory, m_factoryCreateMethod) // if not set, no effect
@@ -91,7 +91,7 @@
}
for (int i = 0; i < m_stateListeners.size(); i ++) {
- service.addStateListener((ServiceStateListener) m_stateListeners.get(i));
+ service.addStateListener((ComponentStateListener) m_stateListeners.get(i));
}
return service;
}
diff --git a/dependencymanager/core/src/main/java/org/apache/felix/dm/impl/ServiceImpl.java b/dependencymanager/core/src/main/java/org/apache/felix/dm/impl/ComponentImpl.java
similarity index 92%
rename from dependencymanager/core/src/main/java/org/apache/felix/dm/impl/ServiceImpl.java
rename to dependencymanager/core/src/main/java/org/apache/felix/dm/impl/ComponentImpl.java
index a8da931..8ec505e 100644
--- a/dependencymanager/core/src/main/java/org/apache/felix/dm/impl/ServiceImpl.java
+++ b/dependencymanager/core/src/main/java/org/apache/felix/dm/impl/ComponentImpl.java
@@ -32,26 +32,26 @@
import java.util.Map;
import java.util.Properties;
+import org.apache.felix.dm.Component;
+import org.apache.felix.dm.ComponentDeclaration;
+import org.apache.felix.dm.ComponentDependencyDeclaration;
+import org.apache.felix.dm.ComponentStateListener;
import org.apache.felix.dm.Dependency;
import org.apache.felix.dm.DependencyActivation;
import org.apache.felix.dm.DependencyManager;
import org.apache.felix.dm.DependencyService;
-import org.apache.felix.dm.Service;
-import org.apache.felix.dm.ServiceComponent;
-import org.apache.felix.dm.ServiceComponentDependency;
-import org.apache.felix.dm.ServiceStateListener;
import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceRegistration;
/**
- * Service implementation.
+ * Component implementation.
*
* @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
*/
-public class ServiceImpl implements Service, DependencyService, ServiceComponent {
+public class ComponentImpl implements Component, DependencyService, ComponentDeclaration {
private static final Class[] VOID = new Class[] {};
private static final ServiceRegistration NULL_REGISTRATION;
- private static final ServiceStateListener[] SERVICE_STATE_LISTENER_TYPE = new ServiceStateListener[] {};
+ private static final ComponentStateListener[] SERVICE_STATE_LISTENER_TYPE = new ComponentStateListener[] {};
private final Object SYNC = new Object();
private final BundleContext m_context;
@@ -102,7 +102,7 @@
private Map m_autoConfig = new HashMap();
private Map m_autoConfigInstance = new HashMap();
- public ServiceImpl(BundleContext context, DependencyManager manager, Logger logger) {
+ public ComponentImpl(BundleContext context, DependencyManager manager, Logger logger) {
m_logger = logger;
m_state = new State((List) m_dependencies.clone(), false, false, false);
m_context = context;
@@ -115,7 +115,7 @@
m_autoConfig.put(BundleContext.class, Boolean.TRUE);
m_autoConfig.put(ServiceRegistration.class, Boolean.TRUE);
m_autoConfig.put(DependencyManager.class, Boolean.TRUE);
- m_autoConfig.put(Service.class, Boolean.TRUE);
+ m_autoConfig.put(Component.class, Boolean.TRUE);
}
private void calculateStateChanges() {
@@ -222,7 +222,7 @@
m_executor.execute();
}
- public Service add(final Dependency dependency) {
+ public Component add(final Dependency dependency) {
State oldState, newState;
synchronized (m_dependencies) {
oldState = m_state;
@@ -254,7 +254,7 @@
return this;
}
- public Service add(List dependencies) {
+ public Component add(List dependencies) {
// TODO review if this can be done more smartly
for (int i = 0; i < dependencies.size(); i++) {
add((Dependency) dependencies.get(i));
@@ -262,7 +262,7 @@
return this;
}
- public Service remove(Dependency dependency) {
+ public Component remove(Dependency dependency) {
State oldState, newState;
synchronized (m_dependencies) {
oldState = m_state;
@@ -296,7 +296,7 @@
return m_serviceInstance;
}
- public Service getServiceInterface() {
+ public Component getServiceInterface() {
return this;
}
@@ -338,7 +338,7 @@
public synchronized void start() {
if (m_serviceRegistration == null) {
- m_serviceRegistration = m_context.registerService(ServiceComponent.class.getName(), this, null);
+ m_serviceRegistration = m_context.registerService(ComponentDeclaration.class.getName(), this, null);
State oldState, newState;
synchronized (m_dependencies) {
oldState = m_state;
@@ -363,21 +363,21 @@
}
}
- public synchronized Service setInterface(String serviceName, Dictionary properties) {
+ public synchronized Component setInterface(String serviceName, Dictionary properties) {
ensureNotActive();
m_serviceName = serviceName;
m_serviceProperties = properties;
return this;
}
- public synchronized Service setInterface(String[] serviceName, Dictionary properties) {
+ public synchronized Component setInterface(String[] serviceName, Dictionary properties) {
ensureNotActive();
m_serviceName = serviceName;
m_serviceProperties = properties;
return this;
}
- public synchronized Service setCallbacks(String init, String start, String stop, String destroy) {
+ public synchronized Component setCallbacks(String init, String start, String stop, String destroy) {
ensureNotActive();
m_callbackInit = init;
m_callbackStart = start;
@@ -386,7 +386,7 @@
return this;
}
- public synchronized Service setCallbacks(Object instance, String init, String start, String stop, String destroy) {
+ public synchronized Component setCallbacks(Object instance, String init, String start, String stop, String destroy) {
ensureNotActive();
m_callbackInstance = instance;
m_callbackInit = init;
@@ -398,31 +398,31 @@
- public synchronized Service setImplementation(Object implementation) {
+ public synchronized Component setImplementation(Object implementation) {
ensureNotActive();
m_implementation = implementation;
return this;
}
- public synchronized Service setFactory(Object factory, String createMethod) {
+ public synchronized Component setFactory(Object factory, String createMethod) {
ensureNotActive();
m_instanceFactory = factory;
m_instanceFactoryCreateMethod = createMethod;
return this;
}
- public synchronized Service setFactory(String createMethod) {
+ public synchronized Component setFactory(String createMethod) {
return setFactory(null, createMethod);
}
- public synchronized Service setComposition(Object instance, String getMethod) {
+ public synchronized Component setComposition(Object instance, String getMethod) {
ensureNotActive();
m_compositionManager = instance;
m_compositionManagerGetMethod = getMethod;
return this;
}
- public synchronized Service setComposition(String getMethod) {
+ public synchronized Component setComposition(String getMethod) {
return setComposition(null, getMethod);
}
@@ -437,7 +437,7 @@
return null;
}
- public synchronized Service setServiceProperties(Dictionary serviceProperties) {
+ public synchronized Component setServiceProperties(Dictionary serviceProperties) {
m_serviceProperties = serviceProperties;
if ((m_registration != null) && (m_serviceName != null)) {
m_registration.setProperties(calculateServiceProperties());
@@ -446,7 +446,7 @@
}
// service state listener methods
- public void addStateListener(ServiceStateListener listener) {
+ public void addStateListener(ComponentStateListener listener) {
synchronized (m_stateListeners) {
m_stateListeners.add(listener);
}
@@ -462,7 +462,7 @@
}
}
- public void removeStateListener(ServiceStateListener listener) {
+ public void removeStateListener(ComponentStateListener listener) {
synchronized (m_stateListeners) {
m_stateListeners.remove(listener);
}
@@ -475,7 +475,7 @@
}
private void stateListenersStarting() {
- ServiceStateListener[] list = getListeners();
+ ComponentStateListener[] list = getListeners();
for (int i = 0; i < list.length; i++) {
try {
list[i].starting(this);
@@ -487,7 +487,7 @@
}
private void stateListenersStarted() {
- ServiceStateListener[] list = getListeners();
+ ComponentStateListener[] list = getListeners();
for (int i = 0; i < list.length; i++) {
try {
list[i].started(this);
@@ -499,7 +499,7 @@
}
private void stateListenersStopping() {
- ServiceStateListener[] list = getListeners();
+ ComponentStateListener[] list = getListeners();
for (int i = 0; i < list.length; i++) {
try {
list[i].stopping(this);
@@ -511,7 +511,7 @@
}
private void stateListenersStopped() {
- ServiceStateListener[] list = getListeners();
+ ComponentStateListener[] list = getListeners();
for (int i = 0; i < list.length; i++) {
try {
list[i].stopped(this);
@@ -522,9 +522,9 @@
}
}
- private ServiceStateListener[] getListeners() {
+ private ComponentStateListener[] getListeners() {
synchronized (m_stateListeners) {
- return (ServiceStateListener[]) m_stateListeners.toArray(SERVICE_STATE_LISTENER_TYPE);
+ return (ComponentStateListener[]) m_stateListeners.toArray(SERVICE_STATE_LISTENER_TYPE);
}
}
@@ -632,7 +632,7 @@
// ask the service for its composition instances
Object[] instances = m_callbackInstance != null ? new Object[] { m_callbackInstance } : getCompositionInstances();
invokeCallbackMethod(instances, name,
- new Class[][] {{ Service.class }, {}},
+ new Class[][] {{ Component.class }, {}},
new Object[][] {{ this }, {}});
}
}
@@ -762,18 +762,18 @@
if (((Boolean) m_autoConfig.get(DependencyManager.class)).booleanValue()) {
configureImplementation(DependencyManager.class, m_manager, (String) m_autoConfigInstance.get(DependencyManager.class));
}
- if (((Boolean) m_autoConfig.get(Service.class)).booleanValue()) {
- configureImplementation(Service.class, this, (String) m_autoConfigInstance.get(Service.class));
+ if (((Boolean) m_autoConfig.get(Component.class)).booleanValue()) {
+ configureImplementation(Component.class, this, (String) m_autoConfigInstance.get(Component.class));
}
}
}
- public synchronized Service setAutoConfig(Class clazz, boolean autoConfig) {
+ public synchronized Component setAutoConfig(Class clazz, boolean autoConfig) {
m_autoConfig.put(clazz, Boolean.valueOf(autoConfig));
return this;
}
- public synchronized Service setAutoConfig(Class clazz, String instanceName) {
+ public synchronized Component setAutoConfig(Class clazz, String instanceName) {
m_autoConfig.put(clazz, Boolean.valueOf(instanceName != null));
m_autoConfigInstance.put(clazz, instanceName);
return this;
@@ -1003,7 +1003,7 @@
// ServiceComponent interface
- static class SCDImpl implements ServiceComponentDependency {
+ static class SCDImpl implements ComponentDependencyDeclaration {
private final String m_name;
private final int m_state;
private final String m_type;
@@ -1027,14 +1027,14 @@
}
}
- public ServiceComponentDependency[] getComponentDependencies() {
+ public ComponentDependencyDeclaration[] getComponentDependencies() {
List deps = getDependencies();
if (deps != null) {
- ServiceComponentDependency[] result = new ServiceComponentDependency[deps.size()];
+ ComponentDependencyDeclaration[] result = new ComponentDependencyDeclaration[deps.size()];
for (int i = 0; i < result.length; i++) {
Dependency dep = (Dependency) deps.get(i);
- if (dep instanceof ServiceComponentDependency) {
- result[i] = (ServiceComponentDependency) dep;
+ if (dep instanceof ComponentDependencyDeclaration) {
+ result[i] = (ComponentDependencyDeclaration) dep;
}
else {
result[i] = new SCDImpl(dep.toString(), (dep.isAvailable() ? 1 : 0) + (dep.isRequired() ? 2 : 0), dep.getClass().getName());
@@ -1081,6 +1081,6 @@
}
static {
- NULL_REGISTRATION = (ServiceRegistration) Proxy.newProxyInstance(ServiceImpl.class.getClassLoader(), new Class[] {ServiceRegistration.class}, new DefaultNullObject());
+ NULL_REGISTRATION = (ServiceRegistration) Proxy.newProxyInstance(ComponentImpl.class.getClassLoader(), new Class[] {ServiceRegistration.class}, new DefaultNullObject());
}
}
diff --git a/dependencymanager/core/src/main/java/org/apache/felix/dm/impl/FactoryConfigurationAdapterServiceImpl.java b/dependencymanager/core/src/main/java/org/apache/felix/dm/impl/FactoryConfigurationAdapterServiceImpl.java
index fea85f7..f1f5b3e 100644
--- a/dependencymanager/core/src/main/java/org/apache/felix/dm/impl/FactoryConfigurationAdapterServiceImpl.java
+++ b/dependencymanager/core/src/main/java/org/apache/felix/dm/impl/FactoryConfigurationAdapterServiceImpl.java
@@ -27,8 +27,8 @@
import org.apache.felix.dm.DependencyManager;
import org.apache.felix.dm.PropertyMetaData;
-import org.apache.felix.dm.Service;
-import org.apache.felix.dm.ServiceStateListener;
+import org.apache.felix.dm.Component;
+import org.apache.felix.dm.ComponentStateListener;
import org.osgi.framework.Constants;
import org.osgi.service.cm.ManagedServiceFactory;
import org.apache.felix.dm.impl.metatype.MetaTypeProviderImpl;
@@ -44,7 +44,7 @@
{
public FactoryConfigurationAdapterServiceImpl(DependencyManager dm, String factoryPid, String update, boolean propagate)
{
- super(dm.createService()); // This service will be filtered by our super class, allowing us to take control.
+ super(dm.createComponent()); // This service will be filtered by our super class, allowing us to take control.
Hashtable props = new Hashtable();
props.put(Constants.SERVICE_PID, factoryPid);
m_service
@@ -55,7 +55,7 @@
public FactoryConfigurationAdapterServiceImpl(DependencyManager dm, String factoryPid, String update, boolean propagate,
BundleContext bctx, Logger logger, String heading, String description, String localization, PropertyMetaData[] properyMetaData)
{
- super(dm.createService()); // This service will be filtered by our super class, allowing us to take control.
+ super(dm.createComponent()); // This service will be filtered by our super class, allowing us to take control.
Hashtable props = new Hashtable();
props.put(Constants.SERVICE_PID, factoryPid);
m_service
@@ -110,9 +110,9 @@
/**
* Method called from our superclass, when we need to create a service.
*/
- public Service createService(Object[] properties) {
+ public Component createService(Object[] properties) {
Dictionary settings = (Dictionary) properties[0];
- Service newService = m_dm.createService();
+ Component newService = m_dm.createComponent();
Object impl = null;
try {
@@ -141,7 +141,7 @@
newService.setComposition(m_compositionInstance, m_compositionMethod); // if not set, no effect
newService.setCallbacks(m_callbackObject, m_init, m_start, m_stop, m_destroy); // if not set, no effect
for (int i = 0; i < m_stateListeners.size(); i ++) {
- newService.addStateListener((ServiceStateListener) m_stateListeners.get(i));
+ newService.addStateListener((ComponentStateListener) m_stateListeners.get(i));
}
return newService;
@@ -154,7 +154,7 @@
public void updateService(Object[] properties)
{
Dictionary settings = (Dictionary) properties[0];
- Service service = (Service) properties[1];
+ Component service = (Component) properties[1];
Object impl = service.getService();
try
diff --git a/dependencymanager/core/src/main/java/org/apache/felix/dm/impl/FilterService.java b/dependencymanager/core/src/main/java/org/apache/felix/dm/impl/FilterService.java
index 05a1a9f..5b4f900 100644
--- a/dependencymanager/core/src/main/java/org/apache/felix/dm/impl/FilterService.java
+++ b/dependencymanager/core/src/main/java/org/apache/felix/dm/impl/FilterService.java
@@ -25,17 +25,17 @@
import org.apache.felix.dm.Dependency;
import org.apache.felix.dm.DependencyManager;
-import org.apache.felix.dm.Service;
-import org.apache.felix.dm.ServiceStateListener;
+import org.apache.felix.dm.Component;
+import org.apache.felix.dm.ComponentStateListener;
import org.osgi.framework.ServiceRegistration;
/**
* This class allows to filter a Service interface. All Aspect/Adapters extends this class
* in order to add functionality to the default Service implementation.
*/
-public class FilterService implements Service
+public class FilterService implements Component
{
- protected ServiceImpl m_service;
+ protected ComponentImpl m_service;
protected List m_stateListeners = new ArrayList();
protected String m_init = "init";
protected String m_start = "start";
@@ -50,12 +50,12 @@
protected String m_factoryCreateMethod;
protected Dictionary m_serviceProperties;
- public FilterService(Service service)
+ public FilterService(Component service)
{
- m_service = (ServiceImpl) service;
+ m_service = (ComponentImpl) service;
}
- public Service add(Dependency dependency)
+ public Component add(Dependency dependency)
{
m_service.add(dependency);
// Add the dependency (if optional) to all already instantiated services.
@@ -71,7 +71,7 @@
return this;
}
- public Service add(List dependencies)
+ public Component add(List dependencies)
{
m_service.add(dependencies);
// Add the dependencies to all already instantiated services.
@@ -93,7 +93,7 @@
return this;
}
- public void addStateListener(ServiceStateListener listener)
+ public void addStateListener(ComponentStateListener listener)
{
synchronized (this)
{
@@ -127,7 +127,7 @@
return m_service.getServiceRegistration();
}
- public Service remove(Dependency dependency)
+ public Component remove(Dependency dependency)
{
m_service.remove(dependency);
// Remove the dependency (if optional) from all already instantiated services.
@@ -144,7 +144,7 @@
return this;
}
- public void removeStateListener(ServiceStateListener listener)
+ public void removeStateListener(ComponentStateListener listener)
{
synchronized (this)
{
@@ -158,7 +158,7 @@
}
}
- public synchronized Service setCallbacks(Object instance, String init, String start, String stop,
+ public synchronized Component setCallbacks(Object instance, String init, String start, String stop,
String destroy)
{
m_service.ensureNotActive();
@@ -170,13 +170,13 @@
return this;
}
- public Service setCallbacks(String init, String start, String stop, String destroy)
+ public Component setCallbacks(String init, String start, String stop, String destroy)
{
setCallbacks(null, init, start, stop, destroy);
return this;
}
- public synchronized Service setComposition(Object instance, String getMethod)
+ public synchronized Component setComposition(Object instance, String getMethod)
{
m_service.ensureNotActive();
m_compositionInstance = instance;
@@ -184,14 +184,14 @@
return this;
}
- public synchronized Service setComposition(String getMethod)
+ public synchronized Component setComposition(String getMethod)
{
m_service.ensureNotActive();
m_compositionMethod = getMethod;
return this;
}
- public synchronized Service setFactory(Object factory, String createMethod)
+ public synchronized Component setFactory(Object factory, String createMethod)
{
m_service.ensureNotActive();
m_factory = factory;
@@ -199,24 +199,24 @@
return this;
}
- public Service setFactory(String createMethod)
+ public Component setFactory(String createMethod)
{
return setFactory(null, createMethod);
}
- public synchronized Service setImplementation(Object implementation)
+ public synchronized Component setImplementation(Object implementation)
{
m_service.ensureNotActive();
m_serviceImpl = implementation;
return this;
}
- public Service setInterface(String serviceName, Dictionary properties)
+ public Component setInterface(String serviceName, Dictionary properties)
{
return setInterface(new String[] { serviceName }, properties);
}
- public synchronized Service setInterface(String[] serviceInterfaces, Dictionary properties) {
+ public synchronized Component setInterface(String[] serviceInterfaces, Dictionary properties) {
m_service.ensureNotActive();
if (serviceInterfaces != null) {
m_serviceInterfaces = new String[serviceInterfaces.length];
@@ -226,7 +226,7 @@
return this;
}
- public Service setServiceProperties(Dictionary serviceProperties)
+ public Component setServiceProperties(Dictionary serviceProperties)
{
synchronized (this)
{
@@ -261,12 +261,12 @@
return m_service.getDependencyManager();
}
- public Service setAutoConfig(Class clazz, boolean autoConfig) {
+ public Component setAutoConfig(Class clazz, boolean autoConfig) {
m_service.setAutoConfig(clazz, autoConfig);
return this;
}
- public Service setAutoConfig(Class clazz, String instanceName) {
+ public Component setAutoConfig(Class clazz, String instanceName) {
m_service.setAutoConfig(clazz, instanceName);
return this;
}
diff --git a/dependencymanager/core/src/main/java/org/apache/felix/dm/impl/ResourceAdapterServiceImpl.java b/dependencymanager/core/src/main/java/org/apache/felix/dm/impl/ResourceAdapterServiceImpl.java
index 9820444..0828b3f 100644
--- a/dependencymanager/core/src/main/java/org/apache/felix/dm/impl/ResourceAdapterServiceImpl.java
+++ b/dependencymanager/core/src/main/java/org/apache/felix/dm/impl/ResourceAdapterServiceImpl.java
@@ -26,8 +26,8 @@
import org.apache.felix.dm.Dependency;
import org.apache.felix.dm.DependencyManager;
import org.apache.felix.dm.ResourceDependency;
-import org.apache.felix.dm.Service;
-import org.apache.felix.dm.ServiceStateListener;
+import org.apache.felix.dm.Component;
+import org.apache.felix.dm.ComponentStateListener;
/**
* Resource adapter service implementation. This class extends the FilterService in order to catch
@@ -42,7 +42,7 @@
* @param dm the dependency manager used to create our internal adapter service
*/
public ResourceAdapterServiceImpl(DependencyManager dm, String resourceFilter, boolean propagate, Object callbackInstance, String callbackChanged) {
- super(dm.createService()); // This service will be filtered by our super class, allowing us to take control.
+ super(dm.createComponent()); // This service will be filtered by our super class, allowing us to take control.
m_callbackInstance = callbackInstance;
m_callbackChanged = callbackChanged;
m_service.setImplementation(new ResourceAdapterImpl(resourceFilter, propagate))
@@ -53,7 +53,7 @@
}
public ResourceAdapterServiceImpl(DependencyManager dm, String resourceFilter, Object propagateCallbackInstance, String propagateCallbackMethod, Object callbackInstance, String callbackChanged) {
- super(dm.createService()); // This service will be filtered by our super class, allowing us to take control.
+ super(dm.createComponent()); // This service will be filtered by our super class, allowing us to take control.
m_callbackInstance = callbackInstance;
m_callbackChanged = callbackChanged;
m_service.setImplementation(new ResourceAdapterImpl(resourceFilter, propagateCallbackInstance, propagateCallbackMethod))
@@ -84,7 +84,7 @@
m_propagateCallbackMethod = propagateCallbackMethod;
}
- public Service createService(Object[] properties) {
+ public Component createService(Object[] properties) {
URL resource = (URL) properties[0];
Properties props = new Properties();
if (m_serviceProperties != null) {
@@ -108,7 +108,7 @@
} else {
resourceDependency.setPropagate(m_propagate);
}
- Service service = m_manager.createService()
+ Component service = m_manager.createComponent()
.setInterface(m_serviceInterfaces, props)
.setImplementation(m_serviceImpl)
.setFactory(m_factory, m_factoryCreateMethod) // if not set, no effect
@@ -121,7 +121,7 @@
}
for (int i = 0; i < m_stateListeners.size(); i ++) {
- service.addStateListener((ServiceStateListener) m_stateListeners.get(i));
+ service.addStateListener((ComponentStateListener) m_stateListeners.get(i));
}
return service;
}
diff --git a/dependencymanager/core/src/main/java/org/apache/felix/dm/impl/dependencies/BundleDependencyImpl.java b/dependencymanager/core/src/main/java/org/apache/felix/dm/impl/dependencies/BundleDependencyImpl.java
index 07b90bb..ff09fc8 100644
--- a/dependencymanager/core/src/main/java/org/apache/felix/dm/impl/dependencies/BundleDependencyImpl.java
+++ b/dependencymanager/core/src/main/java/org/apache/felix/dm/impl/dependencies/BundleDependencyImpl.java
@@ -27,12 +27,12 @@
import org.apache.felix.dm.BundleDependency;
import org.apache.felix.dm.Dependency;
import org.apache.felix.dm.DependencyService;
-import org.apache.felix.dm.ServiceComponentDependency;
+import org.apache.felix.dm.ComponentDependencyDeclaration;
import org.apache.felix.dm.impl.DefaultNullObject;
import org.apache.felix.dm.impl.InvocationUtil;
import org.apache.felix.dm.impl.Logger;
-import org.apache.felix.dm.impl.tracker.BundleTracker;
-import org.apache.felix.dm.impl.tracker.BundleTrackerCustomizer;
+import org.apache.felix.dm.tracker.BundleTracker;
+import org.apache.felix.dm.tracker.BundleTrackerCustomizer;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
import org.osgi.framework.BundleEvent;
@@ -40,7 +40,7 @@
import org.osgi.framework.InvalidSyntaxException;
import org.osgi.service.log.LogService;
-public class BundleDependencyImpl extends DependencyBase implements BundleDependency, BundleTrackerCustomizer, ServiceComponentDependency {
+public class BundleDependencyImpl extends DependencyBase implements BundleDependency, BundleTrackerCustomizer, ComponentDependencyDeclaration {
private final BundleContext m_context;
private boolean m_isStarted;
private BundleTracker m_tracker;
diff --git a/dependencymanager/core/src/main/java/org/apache/felix/dm/impl/dependencies/ConfigurationDependencyImpl.java b/dependencymanager/core/src/main/java/org/apache/felix/dm/impl/dependencies/ConfigurationDependencyImpl.java
index 3ffb0d4..1d76cb4 100644
--- a/dependencymanager/core/src/main/java/org/apache/felix/dm/impl/dependencies/ConfigurationDependencyImpl.java
+++ b/dependencymanager/core/src/main/java/org/apache/felix/dm/impl/dependencies/ConfigurationDependencyImpl.java
@@ -31,7 +31,7 @@
import org.apache.felix.dm.DependencyActivation;
import org.apache.felix.dm.DependencyService;
import org.apache.felix.dm.PropertyMetaData;
-import org.apache.felix.dm.ServiceComponentDependency;
+import org.apache.felix.dm.ComponentDependencyDeclaration;
import org.apache.felix.dm.impl.InvocationUtil;
import org.apache.felix.dm.impl.Logger;
import org.apache.felix.dm.impl.metatype.MetaTypeProviderImpl;
@@ -62,7 +62,7 @@
*
* @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
*/
-public class ConfigurationDependencyImpl extends DependencyBase implements ConfigurationDependency, ManagedService, ServiceComponentDependency, DependencyActivation {
+public class ConfigurationDependencyImpl extends DependencyBase implements ConfigurationDependency, ManagedService, ComponentDependencyDeclaration, DependencyActivation {
private BundleContext m_context;
private String m_pid;
private ServiceRegistration m_registration;
diff --git a/dependencymanager/core/src/main/java/org/apache/felix/dm/impl/dependencies/ResourceDependencyImpl.java b/dependencymanager/core/src/main/java/org/apache/felix/dm/impl/dependencies/ResourceDependencyImpl.java
index d074404..487bcc9 100644
--- a/dependencymanager/core/src/main/java/org/apache/felix/dm/impl/dependencies/ResourceDependencyImpl.java
+++ b/dependencymanager/core/src/main/java/org/apache/felix/dm/impl/dependencies/ResourceDependencyImpl.java
@@ -30,15 +30,15 @@
import org.apache.felix.dm.DependencyService;
import org.apache.felix.dm.ResourceDependency;
import org.apache.felix.dm.ResourceHandler;
-import org.apache.felix.dm.Service;
-import org.apache.felix.dm.ServiceComponentDependency;
+import org.apache.felix.dm.Component;
+import org.apache.felix.dm.ComponentDependencyDeclaration;
import org.apache.felix.dm.impl.InvocationUtil;
import org.apache.felix.dm.impl.Logger;
import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceRegistration;
import org.osgi.service.log.LogService;
-public class ResourceDependencyImpl extends DependencyBase implements ResourceDependency, ResourceHandler, DependencyActivation, ServiceComponentDependency {
+public class ResourceDependencyImpl extends DependencyBase implements ResourceDependency, ResourceHandler, DependencyActivation, ComponentDependencyDeclaration {
private volatile BundleContext m_context;
private volatile ServiceRegistration m_registration;
// private long m_resourceCounter;
@@ -203,7 +203,7 @@
private void invoke(DependencyService ds, URL serviceInstance, String name) {
if (name != null) {
ds.invokeCallbackMethod(getCallbackInstances(ds), name,
- new Class[][] {{ Service.class, URL.class }, { Service.class, Object.class }, { Service.class }, { URL.class }, { Object.class }, {}},
+ new Class[][] {{ Component.class, URL.class }, { Component.class, Object.class }, { Component.class }, { URL.class }, { Object.class }, {}},
new Object[][] {{ ds.getServiceInterface(), serviceInstance }, { ds.getServiceInterface(), serviceInstance }, { ds.getServiceInterface() }, { serviceInstance }, { serviceInstance }, {}}
);
}
diff --git a/dependencymanager/core/src/main/java/org/apache/felix/dm/impl/dependencies/ServiceDependencyImpl.java b/dependencymanager/core/src/main/java/org/apache/felix/dm/impl/dependencies/ServiceDependencyImpl.java
index 2e87c95..dbc3dc4 100644
--- a/dependencymanager/core/src/main/java/org/apache/felix/dm/impl/dependencies/ServiceDependencyImpl.java
+++ b/dependencymanager/core/src/main/java/org/apache/felix/dm/impl/dependencies/ServiceDependencyImpl.java
@@ -33,13 +33,13 @@
import org.apache.felix.dm.Dependency;
import org.apache.felix.dm.DependencyService;
-import org.apache.felix.dm.ServiceComponentDependency;
+import org.apache.felix.dm.ComponentDependencyDeclaration;
import org.apache.felix.dm.ServiceDependency;
import org.apache.felix.dm.impl.DefaultNullObject;
import org.apache.felix.dm.impl.InvocationUtil;
import org.apache.felix.dm.impl.Logger;
-import org.apache.felix.dm.impl.tracker.ServiceTracker;
-import org.apache.felix.dm.impl.tracker.ServiceTrackerCustomizer;
+import org.apache.felix.dm.tracker.ServiceTracker;
+import org.apache.felix.dm.tracker.ServiceTrackerCustomizer;
import org.osgi.framework.BundleContext;
import org.osgi.framework.Constants;
import org.osgi.framework.InvalidSyntaxException;
@@ -51,7 +51,7 @@
*
* @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
*/
-public class ServiceDependencyImpl extends DependencyBase implements ServiceDependency, ServiceTrackerCustomizer, ServiceComponentDependency {
+public class ServiceDependencyImpl extends DependencyBase implements ServiceDependency, ServiceTrackerCustomizer, ComponentDependencyDeclaration {
protected List m_services = new ArrayList();
protected volatile ServiceTracker m_tracker;
protected BundleContext m_context;
diff --git a/dependencymanager/core/src/main/java/org/apache/felix/dm/impl/tracker/AbstractTracked.java b/dependencymanager/core/src/main/java/org/apache/felix/dm/tracker/AbstractTracked.java
similarity index 99%
rename from dependencymanager/core/src/main/java/org/apache/felix/dm/impl/tracker/AbstractTracked.java
rename to dependencymanager/core/src/main/java/org/apache/felix/dm/tracker/AbstractTracked.java
index f7b5d4a..a312b51 100644
--- a/dependencymanager/core/src/main/java/org/apache/felix/dm/impl/tracker/AbstractTracked.java
+++ b/dependencymanager/core/src/main/java/org/apache/felix/dm/tracker/AbstractTracked.java
@@ -1,4 +1,4 @@
-package org.apache.felix.dm.impl.tracker;
+package org.apache.felix.dm.tracker;
/*
* Copyright (c) OSGi Alliance (2007, 2008). All Rights Reserved.
*
diff --git a/dependencymanager/core/src/main/java/org/apache/felix/dm/impl/tracker/BundleTracker.java b/dependencymanager/core/src/main/java/org/apache/felix/dm/tracker/BundleTracker.java
similarity index 99%
rename from dependencymanager/core/src/main/java/org/apache/felix/dm/impl/tracker/BundleTracker.java
rename to dependencymanager/core/src/main/java/org/apache/felix/dm/tracker/BundleTracker.java
index ac886b6..73c3a49 100644
--- a/dependencymanager/core/src/main/java/org/apache/felix/dm/impl/tracker/BundleTracker.java
+++ b/dependencymanager/core/src/main/java/org/apache/felix/dm/tracker/BundleTracker.java
@@ -1,4 +1,4 @@
-package org.apache.felix.dm.impl.tracker;
+package org.apache.felix.dm.tracker;
/*
* Copyright (c) OSGi Alliance (2007, 2008). All Rights Reserved.
diff --git a/dependencymanager/core/src/main/java/org/apache/felix/dm/impl/tracker/BundleTrackerCustomizer.java b/dependencymanager/core/src/main/java/org/apache/felix/dm/tracker/BundleTrackerCustomizer.java
similarity index 98%
rename from dependencymanager/core/src/main/java/org/apache/felix/dm/impl/tracker/BundleTrackerCustomizer.java
rename to dependencymanager/core/src/main/java/org/apache/felix/dm/tracker/BundleTrackerCustomizer.java
index ba22f2e..0fd340e 100644
--- a/dependencymanager/core/src/main/java/org/apache/felix/dm/impl/tracker/BundleTrackerCustomizer.java
+++ b/dependencymanager/core/src/main/java/org/apache/felix/dm/tracker/BundleTrackerCustomizer.java
@@ -1,4 +1,4 @@
-package org.apache.felix.dm.impl.tracker;
+package org.apache.felix.dm.tracker;
/*
* Copyright (c) OSGi Alliance (2007, 2008). All Rights Reserved.
*
diff --git a/dependencymanager/core/src/main/java/org/apache/felix/dm/impl/tracker/ServiceTracker.java b/dependencymanager/core/src/main/java/org/apache/felix/dm/tracker/ServiceTracker.java
similarity index 99%
rename from dependencymanager/core/src/main/java/org/apache/felix/dm/impl/tracker/ServiceTracker.java
rename to dependencymanager/core/src/main/java/org/apache/felix/dm/tracker/ServiceTracker.java
index 9bc1c2b..3fc5c01 100644
--- a/dependencymanager/core/src/main/java/org/apache/felix/dm/impl/tracker/ServiceTracker.java
+++ b/dependencymanager/core/src/main/java/org/apache/felix/dm/tracker/ServiceTracker.java
@@ -1,4 +1,4 @@
-package org.apache.felix.dm.impl.tracker;
+package org.apache.felix.dm.tracker;
/*
* Copyright (c) OSGi Alliance (2000, 2009). All Rights Reserved.
*
diff --git a/dependencymanager/core/src/main/java/org/apache/felix/dm/impl/tracker/ServiceTrackerCustomizer.java b/dependencymanager/core/src/main/java/org/apache/felix/dm/tracker/ServiceTrackerCustomizer.java
similarity index 98%
rename from dependencymanager/core/src/main/java/org/apache/felix/dm/impl/tracker/ServiceTrackerCustomizer.java
rename to dependencymanager/core/src/main/java/org/apache/felix/dm/tracker/ServiceTrackerCustomizer.java
index bc3dab9..1422062 100644
--- a/dependencymanager/core/src/main/java/org/apache/felix/dm/impl/tracker/ServiceTrackerCustomizer.java
+++ b/dependencymanager/core/src/main/java/org/apache/felix/dm/tracker/ServiceTrackerCustomizer.java
@@ -1,4 +1,4 @@
-package org.apache.felix.dm.impl.tracker;
+package org.apache.felix.dm.tracker;
/*
* Copyright (c) OSGi Alliance (2000, 2008). All Rights Reserved.