Prefixed some methods in interfaces with 'public', implemented instance bound feature in resource dependencies.

git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@925673 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/dependencymanager/core/src/main/java/org/apache/felix/dm/dependencies/ResourceDependency.java b/dependencymanager/core/src/main/java/org/apache/felix/dm/dependencies/ResourceDependency.java
index 5e69da4..366e3ae 100644
--- a/dependencymanager/core/src/main/java/org/apache/felix/dm/dependencies/ResourceDependency.java
+++ b/dependencymanager/core/src/main/java/org/apache/felix/dm/dependencies/ResourceDependency.java
@@ -32,7 +32,7 @@
      * @param removed the method to call when a service was removed
      * @return this service dependency
      */
-     ResourceDependency setCallbacks(String added, String removed) ;
+	public ResourceDependency setCallbacks(String added, String removed) ;
 
     /**
      * Sets the callbacks for this service. These callbacks can be used as hooks whenever a
@@ -45,7 +45,7 @@
      * @param removed the method to call when a service was removed
      * @return this service dependency
      */
-     ResourceDependency setCallbacks(String added, String changed, String removed);
+     public ResourceDependency setCallbacks(String added, String changed, String removed);
 
     /**
      * Sets the callbacks for this service. These callbacks can be used as hooks whenever a
@@ -58,7 +58,7 @@
      * @param removed the method to call when a service was removed
      * @return this service dependency
      */
-     ResourceDependency setCallbacks(Object instance, String added, String removed);
+     public ResourceDependency setCallbacks(Object instance, String added, String removed);
     
     /**
      * Sets the callbacks for this service. These callbacks can be used as hooks whenever a
@@ -72,7 +72,7 @@
      * @param removed the method to call when a service was removed
      * @return this service dependency
      */
-     ResourceDependency setCallbacks(Object instance, String added, String changed, String removed);
+     public ResourceDependency setCallbacks(Object instance, String added, String changed, String removed);
         
     /**
      * Sets auto configuration for this service. Auto configuration allows the
@@ -82,7 +82,7 @@
      * @param autoConfig the value of auto config
      * @return this service dependency
      */
-     ResourceDependency setAutoConfig(boolean autoConfig);
+     public ResourceDependency setAutoConfig(boolean autoConfig);
     
     /**
      * Sets auto configuration for this service. Auto configuration allows the
@@ -92,13 +92,15 @@
      * @param instanceName the name of attribute to auto config
      * @return this service dependency
      */
-     ResourceDependency setAutoConfig(String instanceName);
+     public ResourceDependency setAutoConfig(String instanceName);
     
-     ResourceDependency setResource(Resource resource);
+     public ResourceDependency setResource(Resource resource);
 	
-     ResourceDependency setRequired(boolean required);
+     public ResourceDependency setRequired(boolean required);
 
-     ResourceDependency setFilter(String resourceFilter);
+     public ResourceDependency setFilter(String resourceFilter);
      
-     ResourceDependency setPropagate(boolean propagate);
+     public ResourceDependency setPropagate(boolean propagate);
+     
+     public ResourceDependency setInstanceBound(boolean isInstanceBound);
 }
diff --git a/dependencymanager/core/src/main/java/org/apache/felix/dm/dependencies/ServiceDependency.java b/dependencymanager/core/src/main/java/org/apache/felix/dm/dependencies/ServiceDependency.java
index 2e877e4..867543b 100644
--- a/dependencymanager/core/src/main/java/org/apache/felix/dm/dependencies/ServiceDependency.java
+++ b/dependencymanager/core/src/main/java/org/apache/felix/dm/dependencies/ServiceDependency.java
@@ -33,7 +33,7 @@
      * @param serviceName the name of the service
      * @return this service dependency
      */
-    ServiceDependency setService(Class serviceName);
+	public ServiceDependency setService(Class serviceName);
     
     /**
      * Sets the name of the service that should be tracked. You can either specify
@@ -46,7 +46,7 @@
      * @param serviceFilter the filter condition
      * @return this service dependency
      */
-    ServiceDependency setService(Class serviceName, String serviceFilter);
+	public ServiceDependency setService(Class serviceName, String serviceFilter);
     
     /**
      * Sets the filter for the services that should be tracked. Any service object
@@ -56,7 +56,7 @@
      * @param serviceFilter the filter condition
      * @return this service dependency
      */
-    ServiceDependency setService(String serviceFilter);
+	public ServiceDependency setService(String serviceFilter);
 
     /**
      * Sets the name of the service that should be tracked. You can either specify
@@ -68,7 +68,7 @@
      * @param serviceReference the service reference to track
      * @return this service dependency
      */
-    ServiceDependency setService(Class serviceName, ServiceReference serviceReference);
+	public ServiceDependency setService(Class serviceName, ServiceReference serviceReference);
     
     /**
      * Sets the default implementation for this service dependency. You can use this to supply
@@ -80,7 +80,7 @@
      *     instantiate this implementation
      * @return this service dependency
      */
-    ServiceDependency setDefaultImplementation(Object implementation);
+	public ServiceDependency setDefaultImplementation(Object implementation);
 
     /**
      * Sets the required flag which determines if this service is required or not.
@@ -88,7 +88,7 @@
      * @param required the required flag
      * @return this service dependency
      */
-    ServiceDependency setRequired(boolean required);
+	public ServiceDependency setRequired(boolean required);
     
     /**
      * Sets auto configuration for this service. Auto configuration allows the
@@ -98,7 +98,7 @@
      * @param autoConfig the value of auto config
      * @return this service dependency
      */
-    ServiceDependency setAutoConfig(boolean autoConfig);
+	public ServiceDependency setAutoConfig(boolean autoConfig);
     
     /**
      * Sets auto configuration for this service. Auto configuration allows the
@@ -108,7 +108,7 @@
      * @param instanceName the name of attribute to auto config
      * @return this service dependency
      */
-    ServiceDependency setAutoConfig(String instanceName);
+	public ServiceDependency setAutoConfig(String instanceName);
     
     /**
      * Sets the callbacks for this service. These callbacks can be used as hooks whenever a
@@ -120,7 +120,7 @@
      * @param removed the method to call when a service was removed
      * @return this service dependency
      */
-    ServiceDependency setCallbacks(String added, String removed);
+	public ServiceDependency setCallbacks(String added, String removed);
     
     /**
      * Sets the callbacks for this service. These callbacks can be used as hooks whenever a
@@ -133,7 +133,7 @@
      * @param removed the method to call when a service was removed
      * @return this service dependency
      */
-    ServiceDependency setCallbacks(String added, String changed, String removed);
+	public ServiceDependency setCallbacks(String added, String changed, String removed);
 
     /**
      * Sets the callbacks for this service. These callbacks can be used as hooks whenever a
@@ -146,7 +146,7 @@
      * @param removed the method to call when a service was removed
      * @return this service dependency
      */
-    ServiceDependency setCallbacks(Object instance, String added, String removed);
+	public ServiceDependency setCallbacks(Object instance, String added, String removed);
     
     /**
      * Sets the callbacks for this service. These callbacks can be used as hooks whenever a
@@ -160,7 +160,7 @@
      * @param removed the method to call when a service was removed
      * @return this service dependency
      */
-    ServiceDependency setCallbacks(Object instance, String added, String changed, String removed);
+	public ServiceDependency setCallbacks(Object instance, String added, String changed, String removed);
     
     public ServiceDependency setInstanceBound(boolean isInstanceBound);
 }
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 e2b4474..9e0ea4c 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
@@ -53,6 +53,7 @@
     private List m_resources = new ArrayList();
     private Resource m_resourceInstance;
     private boolean m_propagate;
+	private boolean m_isInstanceBound;
 	
     public ResourceDependencyImpl(BundleContext context, Logger logger) {
     	m_context = context;
@@ -69,7 +70,12 @@
 	}
 	
 	public boolean isInstanceBound() {
-		return false; // TODO for now we are never bound to the service implementation instance
+		return m_isInstanceBound;
+	}
+	
+	public ResourceDependency setInstanceBound(boolean isInstanceBound) {
+		m_isInstanceBound = isInstanceBound;
+		return this;
 	}
 
 	public void start(DependencyService service) {