Relatively large refactoring of callback methods, cleaned up some code and made them more consistent.
git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@957541 13f79535-47bb-0310-9956-ffa450edef68
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 26719b5..3c78f45 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
@@ -23,6 +23,7 @@
import java.util.Iterator;
import java.util.List;
+import org.apache.felix.dm.DependencyManager;
import org.apache.felix.dm.dependencies.Dependency;
import org.apache.felix.dm.service.Service;
import org.apache.felix.dm.service.ServiceStateListener;
@@ -251,4 +252,12 @@
{
m_service.stop();
}
+
+ public Object[] getCompositionInstances() {
+ return m_service.getCompositionInstances();
+ }
+
+ public DependencyManager getDependencyManager() {
+ return m_service.getDependencyManager();
+ }
}
\ No newline at end of file
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/ServiceImpl.java
index 50d2a91..b7ddf50 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/ServiceImpl.java
@@ -20,6 +20,7 @@
import java.lang.reflect.Constructor;
import java.lang.reflect.Field;
+import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Proxy;
import java.util.ArrayList;
import java.util.Dictionary;
@@ -294,6 +295,10 @@
public Object getService() {
return m_serviceInstance;
}
+
+ public Service getServiceInterface() {
+ return this;
+ }
public void dependencyAvailable(final Dependency dependency) {
State oldState, newState;
@@ -623,21 +628,29 @@
private void invoke(String name) {
if (name != null) {
- // invoke method if it exists
+ // if a callback instance was specified, look for the method there, if not,
+ // 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 Object[][] {{ this }, {}});
+ }
+ }
+
+ public void invokeCallbackMethod(Object[] instances, String methodName, Class[][] signatures, Object[][] parameters) {
+ for (int i = 0; i < instances.length; i++) {
try {
- // if a callback instance was specified, look for the method there, if not, look for the method in the
- // instance itself
- Object instance = m_callbackInstance != null ? m_callbackInstance : m_serviceInstance;
- InvocationUtil.invokeCallbackMethod(instance, name,
- new Class[][] {{ Object.class, DependencyManager.class, Service.class }, { DependencyManager.class, Service.class }, { Object.class }, {}},
- new Object[][] {{ m_serviceInstance, m_manager, this }, { m_manager, this }, { m_serviceInstance }, {}});
+ InvocationUtil.invokeCallbackMethod(instances[i], methodName, signatures, parameters);
}
catch (NoSuchMethodException e) {
- // we ignore the fact that the method was not found
+ // if the method does not exist, ignore it
+ }
+ catch (InvocationTargetException e) {
+ // the method itself threw an exception, log that
+ m_logger.log(Logger.LOG_WARNING, "Invocation of '" + methodName + "' failed.", e.getCause());
}
catch (Exception e) {
- // but any other exception means that the method was invoked but somehow failed
- m_logger.log(Logger.LOG_WARNING, "Error trying to invoke method named " + name + ".", e);
+ m_logger.log(Logger.LOG_WARNING, "Could not invoke '" + methodName + "'.", e);
}
}
}
@@ -725,9 +738,6 @@
}
else {
try {
-// Method m = factory.getClass().getDeclaredMethod(m_instanceFactoryCreateMethod, null);
-// m_serviceInstance = m.invoke(factory, null);
-//
m_serviceInstance = InvocationUtil.invokeMethod(factory, factory.getClass(), m_instanceFactoryCreateMethod, new Class[][] {{}}, new Object[][] {{}}, false);
}
catch (Exception e) {
@@ -1048,6 +1058,10 @@
return (isRegistered() ? 1 : 0);
}
+ public DependencyManager getDependencyManager() {
+ return m_manager;
+ }
+
static {
NULL_REGISTRATION = (ServiceRegistration) Proxy.newProxyInstance(ServiceImpl.class.getClassLoader(), new Class[] {ServiceRegistration.class}, new DefaultNullObject());
}
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 0245174..8104091 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
@@ -207,29 +207,20 @@
}
public void invokeAdded(DependencyService dependencyService, Bundle service) {
- Object[] callbackInstances = getCallbackInstances(dependencyService);
- if ((callbackInstances != null) && (m_callbackAdded != null)) {
- invokeCallbackMethod(callbackInstances, m_callbackAdded,
- new Class[][] {{Bundle.class}, {Object.class}, {}},
- new Object[][] {{service}, {service}, {}}
- );
- }
+ invoke(dependencyService, service, m_callbackAdded);
}
public void invokeChanged(DependencyService dependencyService, Bundle service) {
- Object[] callbackInstances = getCallbackInstances(dependencyService);
- if ((callbackInstances != null) && (m_callbackChanged != null)) {
- invokeCallbackMethod(callbackInstances, m_callbackChanged,
- new Class[][] {{Bundle.class}, {Object.class}, {}},
- new Object[][] {{service}, {service}, {}}
- );
- }
+ invoke(dependencyService, service, m_callbackChanged);
}
public void invokeRemoved(DependencyService dependencyService, Bundle service) {
- Object[] callbackInstances = getCallbackInstances(dependencyService);
- if ((callbackInstances != null) && (m_callbackRemoved != null)) {
- invokeCallbackMethod(callbackInstances, m_callbackRemoved,
+ invoke(dependencyService, service, m_callbackRemoved);
+ }
+
+ public void invoke(DependencyService dependencyService, Bundle service, String name) {
+ if (name != null) {
+ dependencyService.invokeCallbackMethod(getCallbackInstances(dependencyService), name,
new Class[][] {{Bundle.class}, {Object.class}, {}},
new Object[][] {{service}, {service}, {}}
);
diff --git a/dependencymanager/core/src/main/java/org/apache/felix/dm/impl/dependencies/DependencyBase.java b/dependencymanager/core/src/main/java/org/apache/felix/dm/impl/dependencies/DependencyBase.java
index e76c93a..4208145 100644
--- a/dependencymanager/core/src/main/java/org/apache/felix/dm/impl/dependencies/DependencyBase.java
+++ b/dependencymanager/core/src/main/java/org/apache/felix/dm/impl/dependencies/DependencyBase.java
@@ -1,9 +1,6 @@
package org.apache.felix.dm.impl.dependencies;
-import java.lang.reflect.InvocationTargetException;
-
import org.apache.felix.dm.dependencies.Dependency;
-import org.apache.felix.dm.impl.InvocationUtil;
import org.apache.felix.dm.impl.Logger;
public abstract class DependencyBase implements Dependency, DependencyActivation {
@@ -30,22 +27,4 @@
public final void setIsInstanceBound(boolean isInstanceBound) {
m_isInstanceBound = isInstanceBound;
}
-
- protected void invokeCallbackMethod(Object[] instances, String methodName, Class[][] signatures, Object[][] parameters) {
- for (int i = 0; i < instances.length; i++) {
- try {
- InvocationUtil.invokeCallbackMethod(instances[i], methodName, signatures, parameters);
- }
- catch (NoSuchMethodException e) {
- // if the method does not exist, ignore it
- }
- catch (InvocationTargetException e) {
- // the method itself threw an exception, log that
- m_logger.log(Logger.LOG_WARNING, "Invocation of '" + methodName + "' failed.", e.getCause());
- }
- catch (Exception e) {
- m_logger.log(Logger.LOG_WARNING, "Could not invoke '" + methodName + "'.", e);
- }
- }
- }
}
diff --git a/dependencymanager/core/src/main/java/org/apache/felix/dm/impl/dependencies/DependencyService.java b/dependencymanager/core/src/main/java/org/apache/felix/dm/impl/dependencies/DependencyService.java
index ef5178f..beece72 100644
--- a/dependencymanager/core/src/main/java/org/apache/felix/dm/impl/dependencies/DependencyService.java
+++ b/dependencymanager/core/src/main/java/org/apache/felix/dm/impl/dependencies/DependencyService.java
@@ -19,6 +19,7 @@
package org.apache.felix.dm.impl.dependencies;
import org.apache.felix.dm.dependencies.Dependency;
+import org.apache.felix.dm.service.Service;
public interface DependencyService {
/**
@@ -43,7 +44,14 @@
public void dependencyChanged(Dependency dependency);
public Object getService(); // is also defined on the Service interface
- public void initService(); // was an implementation method
+ public void initService(); // was an implementation method TODO we use it in ConfDepImpl but should not (probably)
public boolean isRegistered(); // impl method
public Object[] getCompositionInstances(); // impl method
+
+ /**
+ * Can be called by the dependency whenever it wants to invoke callback methods.
+ */
+ public void invokeCallbackMethod(Object[] instances, String methodName, Class[][] signatures, Object[][] parameters);
+
+ public Service getServiceInterface();
}
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 1e5e14c..95dda61 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
@@ -27,6 +27,7 @@
import org.apache.felix.dm.impl.Logger;
import org.apache.felix.dm.resources.Resource;
import org.apache.felix.dm.resources.ResourceHandler;
+import org.apache.felix.dm.service.Service;
import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceRegistration;
@@ -158,35 +159,26 @@
}
public void invokeAdded(DependencyService ds, Resource serviceInstance) {
- Object[] callbackInstances = getCallbackInstances(ds);
- if ((callbackInstances != null) && (m_callbackAdded != null)) {
- invokeCallbackMethod(callbackInstances, m_callbackAdded,
- new Class[][] {{ Resource.class }, { Object.class }, {}},
- new Object[][] {{ serviceInstance}, { serviceInstance }, {}}
- );
- }
+ invoke(ds, serviceInstance, m_callbackAdded);
}
public void invokeChanged(DependencyService ds, Resource serviceInstance) {
- Object[] callbackInstances = getCallbackInstances(ds);
- if ((callbackInstances != null) && (m_callbackChanged != null)) {
- invokeCallbackMethod(callbackInstances, m_callbackChanged,
- new Class[][] {{ Resource.class }, { Object.class }, {}},
- new Object[][] {{ serviceInstance}, { serviceInstance }, {}}
- );
- }
+ invoke(ds, serviceInstance, m_callbackChanged);
}
public void invokeRemoved(DependencyService ds, Resource serviceInstance) {
- Object[] callbackInstances = getCallbackInstances(ds);
- if ((callbackInstances != null) && (m_callbackRemoved != null)) {
- invokeCallbackMethod(callbackInstances, m_callbackRemoved,
- new Class[][] {{ Resource.class }, { Object.class }, {}},
- new Object[][] {{ serviceInstance}, { serviceInstance }, {}}
+ invoke(ds, serviceInstance, m_callbackRemoved);
+ }
+
+ private void invoke(DependencyService ds, Resource serviceInstance, String name) {
+ if (name != null) {
+ ds.invokeCallbackMethod(getCallbackInstances(ds), name,
+ new Class[][] {{ Service.class, Resource.class }, { Service.class, Object.class }, { Service.class }, { Resource.class }, { Object.class }, {}},
+ new Object[][] {{ ds.getServiceInterface(), serviceInstance }, { ds.getServiceInterface(), serviceInstance }, { ds.getServiceInterface() }, { serviceInstance }, { serviceInstance }, {}}
);
}
}
-
+
/**
* 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/impl/dependencies/ServiceDependencyImpl.java b/dependencymanager/core/src/main/java/org/apache/felix/dm/impl/dependencies/ServiceDependencyImpl.java
index 7943fee..7abcffd 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
@@ -409,16 +409,6 @@
}
}
- public void invokeAdded(DependencyService dependencyService, ServiceReference reference, Object service) {
- Object[] callbackInstances = getCallbackInstances(dependencyService);
- if ((callbackInstances != null) && (m_callbackAdded != null)) {
- invokeCallbackMethod(callbackInstances, m_callbackAdded,
- new Class[][] {{ServiceReference.class, m_trackedServiceName}, {ServiceReference.class, Object.class}, {ServiceReference.class}, {m_trackedServiceName}, {Object.class}, {}, {Map.class, m_trackedServiceName}},
- new Object[][] {{reference, service}, {reference, service}, {reference}, {service}, {service}, {}, {new ServicePropertiesMap(reference), service}}
- );
- }
- }
-
public void modifiedService(ServiceReference ref, Object service) {
Object[] services;
synchronized (this) {
@@ -433,16 +423,6 @@
}
}
- public void invokeChanged(DependencyService dependencyService, ServiceReference reference, Object service) {
- Object[] callbackInstances = getCallbackInstances(dependencyService);
- if ((callbackInstances != null) && (m_callbackChanged != null)) {
- invokeCallbackMethod(callbackInstances, m_callbackChanged,
- new Class[][] {{ServiceReference.class, m_trackedServiceName}, {ServiceReference.class, Object.class}, {ServiceReference.class}, {m_trackedServiceName}, {Object.class}, {}, {Map.class, m_trackedServiceName}},
- new Object[][] {{reference, service}, {reference, service}, {reference}, {service}, {service}, {}, {new ServicePropertiesMap(reference), service}}
- );
- }
- }
-
public void removedService(ServiceReference ref, Object service) {
boolean makeUnavailable = makeUnavailable();
@@ -468,10 +448,21 @@
}
+ public void invokeAdded(DependencyService dependencyService, ServiceReference reference, Object service) {
+ invoke(dependencyService, reference, service, m_callbackAdded);
+ }
+
+ public void invokeChanged(DependencyService dependencyService, ServiceReference reference, Object service) {
+ invoke(dependencyService, reference, service, m_callbackChanged);
+ }
+
public void invokeRemoved(DependencyService dependencyService, ServiceReference reference, Object service) {
- Object[] callbackInstances = getCallbackInstances(dependencyService);
- if ((callbackInstances != null) && (m_callbackRemoved != null)) {
- invokeCallbackMethod(callbackInstances, m_callbackRemoved,
+ invoke(dependencyService, reference, service, m_callbackRemoved);
+ }
+
+ public void invoke(DependencyService dependencyService, ServiceReference reference, Object service, String name) {
+ if (name != null) {
+ dependencyService.invokeCallbackMethod(getCallbackInstances(dependencyService), name,
new Class[][] {{ServiceReference.class, m_trackedServiceName}, {ServiceReference.class, Object.class}, {ServiceReference.class}, {m_trackedServiceName}, {Object.class}, {}, {Map.class, m_trackedServiceName}},
new Object[][] {{reference, service}, {reference, service}, {reference}, {service}, {service}, {}, {new ServicePropertiesMap(reference), service}}
);
diff --git a/dependencymanager/core/src/main/java/org/apache/felix/dm/service/Service.java b/dependencymanager/core/src/main/java/org/apache/felix/dm/service/Service.java
index 8c06db6..8524f32 100644
--- a/dependencymanager/core/src/main/java/org/apache/felix/dm/service/Service.java
+++ b/dependencymanager/core/src/main/java/org/apache/felix/dm/service/Service.java
@@ -21,6 +21,7 @@
import java.util.Dictionary;
import java.util.List;
+import org.apache.felix.dm.DependencyManager;
import org.apache.felix.dm.dependencies.Dependency;
import org.osgi.framework.ServiceRegistration;
@@ -227,4 +228,16 @@
* @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();
}
diff --git a/dependencymanager/runtime/src/main/java/org/apache/felix/dm/runtime/ServiceLifecycleHandler.java b/dependencymanager/runtime/src/main/java/org/apache/felix/dm/runtime/ServiceLifecycleHandler.java
index 9afc47f..880f591 100644
--- a/dependencymanager/runtime/src/main/java/org/apache/felix/dm/runtime/ServiceLifecycleHandler.java
+++ b/dependencymanager/runtime/src/main/java/org/apache/felix/dm/runtime/ServiceLifecycleHandler.java
@@ -19,20 +19,13 @@
package org.apache.felix.dm.runtime;
import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.HashMap;
-import java.util.Iterator;
import java.util.List;
import java.util.Map;
import org.apache.felix.dm.DependencyManager;
-import org.apache.felix.dm.dependencies.BundleDependency;
-import org.apache.felix.dm.dependencies.ConfigurationDependency;
import org.apache.felix.dm.dependencies.Dependency;
-import org.apache.felix.dm.dependencies.ResourceDependency;
-import org.apache.felix.dm.dependencies.ServiceDependency;
-import org.apache.felix.dm.dependencies.TemporalServiceDependency;
import org.apache.felix.dm.service.Service;
import org.osgi.framework.Bundle;
import org.osgi.service.log.LogService;
@@ -112,9 +105,11 @@
}
@SuppressWarnings("unchecked")
- public void init(Object serviceInstance, DependencyManager dm, Service service)
+ public void init(Service service)
throws Exception
{
+ Object serviceInstance = service.getService();
+ DependencyManager dm = service.getDependencyManager();
// Invoke the service instance init method, and check if it returns a dependency
// customization map. This map will be used to configure some dependency filters
// (or required flag).
@@ -161,61 +156,57 @@
}
}
- public void start(Object serviceInstance, DependencyManager dm, Service service)
+ public void start(Service service)
throws IllegalArgumentException, IllegalAccessException, InvocationTargetException
{
+ Object serviceInstance = service.getService();
+ DependencyManager dm = service.getDependencyManager();
invokeMethod(serviceInstance, m_start, dm, service);
}
- public void stop(Object serviceInstance, DependencyManager dm, Service service)
+ public void stop(Service service)
throws IllegalArgumentException, IllegalAccessException, InvocationTargetException
{
+ Object serviceInstance = service.getService();
+ DependencyManager dm = service.getDependencyManager();
invokeMethod(serviceInstance, m_stop, dm, service);
}
- public void destroy(Object serviceInstance, DependencyManager dm, Service service)
+ public void destroy(Service service)
throws IllegalArgumentException, IllegalAccessException, InvocationTargetException
{
+ Object serviceInstance = service.getService();
+ DependencyManager dm = service.getDependencyManager();
invokeMethod(serviceInstance, m_destroy, dm, service);
}
private Object invokeMethod(Object serviceInstance, String method, DependencyManager dm, Service service)
throws IllegalArgumentException, IllegalAccessException, InvocationTargetException
{
- return invokeMethod(serviceInstance,
- method,
- new Class[][] {
- { Object.class, DependencyManager.class, Service.class },
- { DependencyManager.class, Service.class },
- { Object.class },
- {}
- },
- new Object[][] {
- { serviceInstance, dm, service },
- { dm, service },
- { serviceInstance },
- {}
- });
- }
-
- private Object invokeMethod(Object instance, String method, Class<?>[][] signatures, Object[][] params)
- throws IllegalArgumentException, IllegalAccessException, InvocationTargetException
- {
- if (method == null)
- {
- // The annotated class did not provide an annotation for this lifecycle callback.
- return null;
+ if (method != null) {
+ try
+ {
+ return InvocationUtil.invokeCallbackMethod(
+ serviceInstance, method,
+ new Class[][] { { Service.class }, {} },
+ new Object[][] { { service }, {} }
+ );
+ }
+
+ catch (NoSuchMethodException e)
+ {
+ // ignore this
+ }
+ catch (InvocationTargetException e) {
+ // TODO should we log this?
+ // the method itself threw an exception, log that
+// m_logger.log(Logger.LOG_WARNING, "Invocation of '" + methodName + "' failed.", e.getCause());
+ }
+ catch (Exception e) {
+ // TODO should we log this?
+// m_logger.log(Logger.LOG_WARNING, "Could not invoke '" + methodName + "'.", e);
+ }
}
-
- try
- {
- return InvocationUtil.invokeCallbackMethod(instance, method, signatures, params);
- }
-
- catch (NoSuchMethodException e)
- {
- // ignore this
- return null;
- }
+ return null;
}
}
diff --git a/dependencymanager/test/src/test/java/org/apache/felix/dm/test/FELIX2344_ExtraDependencyWithAutoConfigTest.java b/dependencymanager/test/src/test/java/org/apache/felix/dm/test/FELIX2344_ExtraDependencyWithAutoConfigTest.java
index 878253d..314d616 100644
--- a/dependencymanager/test/src/test/java/org/apache/felix/dm/test/FELIX2344_ExtraDependencyWithAutoConfigTest.java
+++ b/dependencymanager/test/src/test/java/org/apache/felix/dm/test/FELIX2344_ExtraDependencyWithAutoConfigTest.java
@@ -99,7 +99,8 @@
m_startStep = startStep;
}
- public void init(DependencyManager dm, Service s) {
+ public void init(Service s) {
+ DependencyManager dm = s.getDependencyManager();
s.add(dm.createServiceDependency()
.setInstanceBound(true)
.setService(ProviderInterface.class)
diff --git a/dependencymanager/test/src/test/java/org/apache/felix/dm/test/FELIX2344_ExtraDependencyWithCallbackTest.java b/dependencymanager/test/src/test/java/org/apache/felix/dm/test/FELIX2344_ExtraDependencyWithCallbackTest.java
index 53f4fbf..2354ded 100644
--- a/dependencymanager/test/src/test/java/org/apache/felix/dm/test/FELIX2344_ExtraDependencyWithCallbackTest.java
+++ b/dependencymanager/test/src/test/java/org/apache/felix/dm/test/FELIX2344_ExtraDependencyWithCallbackTest.java
@@ -102,7 +102,8 @@
m_startStep = startStep;
}
- public void init(DependencyManager dm, Service s) {
+ public void init(Service s) {
+ DependencyManager dm = s.getDependencyManager();
m_ensure.step(m_startStep);
s.add(dm.createServiceDependency()
.setInstanceBound(true)
diff --git a/dependencymanager/test/src/test/java/org/apache/felix/dm/test/FELIX2369_ExtraDependencyTest.java b/dependencymanager/test/src/test/java/org/apache/felix/dm/test/FELIX2369_ExtraDependencyTest.java
index eee7019..1b9c55b 100644
--- a/dependencymanager/test/src/test/java/org/apache/felix/dm/test/FELIX2369_ExtraDependencyTest.java
+++ b/dependencymanager/test/src/test/java/org/apache/felix/dm/test/FELIX2369_ExtraDependencyTest.java
@@ -90,7 +90,8 @@
m_startStep = startStep;
}
- public void init(DependencyManager dm, Service s) {
+ public void init(Service s) {
+ DependencyManager dm = s.getDependencyManager();
m_ensure.step(m_startStep);
s.add(dm.createServiceDependency() // this dependency is available at this point
.setInstanceBound(true)