felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From clem...@apache.org
Subject svn commit: r1496547 - in /felix/trunk/ipojo/runtime/core/src/main/java/org/apache/felix/ipojo: handlers/dependency/ handlers/providedservice/ util/
Date Tue, 25 Jun 2013 17:20:07 GMT
Author: clement
Date: Tue Jun 25 17:20:06 2013
New Revision: 1496547

URL: http://svn.apache.org/r1496547
Log:
Fix  FELIX-4147 Add getProvidedService in ProvidedServiceDescription and allow external service
management

Modified:
    felix/trunk/ipojo/runtime/core/src/main/java/org/apache/felix/ipojo/handlers/dependency/DependencyDescription.java
    felix/trunk/ipojo/runtime/core/src/main/java/org/apache/felix/ipojo/handlers/providedservice/ProvidedService.java
    felix/trunk/ipojo/runtime/core/src/main/java/org/apache/felix/ipojo/handlers/providedservice/ProvidedServiceDescription.java
    felix/trunk/ipojo/runtime/core/src/main/java/org/apache/felix/ipojo/util/DependencyModel.java

Modified: felix/trunk/ipojo/runtime/core/src/main/java/org/apache/felix/ipojo/handlers/dependency/DependencyDescription.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/runtime/core/src/main/java/org/apache/felix/ipojo/handlers/dependency/DependencyDescription.java?rev=1496547&r1=1496546&r2=1496547&view=diff
==============================================================================
--- felix/trunk/ipojo/runtime/core/src/main/java/org/apache/felix/ipojo/handlers/dependency/DependencyDescription.java
(original)
+++ felix/trunk/ipojo/runtime/core/src/main/java/org/apache/felix/ipojo/handlers/dependency/DependencyDescription.java
Tue Jun 25 17:20:06 2013
@@ -143,6 +143,10 @@ public class DependencyDescription {
         return m_dependency.getSpecification().getName();
     }
 
+    /**
+     * Gets the described dependency.
+     * @return the dependency.
+     */
     public Dependency getDependency() {
         return m_dependency;
     }

Modified: felix/trunk/ipojo/runtime/core/src/main/java/org/apache/felix/ipojo/handlers/providedservice/ProvidedService.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/runtime/core/src/main/java/org/apache/felix/ipojo/handlers/providedservice/ProvidedService.java?rev=1496547&r1=1496546&r2=1496547&view=diff
==============================================================================
--- felix/trunk/ipojo/runtime/core/src/main/java/org/apache/felix/ipojo/handlers/providedservice/ProvidedService.java
(original)
+++ felix/trunk/ipojo/runtime/core/src/main/java/org/apache/felix/ipojo/handlers/providedservice/ProvidedService.java
Tue Jun 25 17:20:06 2013
@@ -352,7 +352,7 @@ public class ProvidedService implements 
      * service.
      * This method also notifies the creation strategy of the publication.
      */
-    protected void registerService() {
+    public void registerService() {
         ServiceRegistration reg = null;
         Properties serviceProperties = null;
         synchronized (this) {
@@ -420,9 +420,9 @@ public class ProvidedService implements 
     }
 
     /**
-     * Unregisters the service.
+     * Withdraws the service from the service registry.
      */
-    protected void unregisterService() {
+    public void unregisterService() {
         ServiceReference ref = null;
         synchronized (this) {
             // Create a copy of the service reference in the case we need

Modified: felix/trunk/ipojo/runtime/core/src/main/java/org/apache/felix/ipojo/handlers/providedservice/ProvidedServiceDescription.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/runtime/core/src/main/java/org/apache/felix/ipojo/handlers/providedservice/ProvidedServiceDescription.java?rev=1496547&r1=1496546&r2=1496547&view=diff
==============================================================================
--- felix/trunk/ipojo/runtime/core/src/main/java/org/apache/felix/ipojo/handlers/providedservice/ProvidedServiceDescription.java
(original)
+++ felix/trunk/ipojo/runtime/core/src/main/java/org/apache/felix/ipojo/handlers/providedservice/ProvidedServiceDescription.java
Tue Jun 25 17:20:06 2013
@@ -44,7 +44,7 @@ public class ProvidedServiceDescription 
     /**
      * The describe provided service.
      */
-    private ProvidedService m_ps;
+    private final ProvidedService m_ps;
 
     /**
      * Constructor.
@@ -55,6 +55,14 @@ public class ProvidedServiceDescription 
     }
 
     /**
+     * Gets the represented provided service.
+     * @return the provided service
+     */
+    public ProvidedService getProvidedService() {
+        return m_ps;
+    }
+
+    /**
      * Gets the list of provided service specifications.
      * @return the provided contract name.
      */
@@ -98,7 +106,7 @@ public class ProvidedServiceDescription 
 
     /**
      * Gets provided service state.
-     * @return the state of the provided service (UNREGISTERED | REGISTRED).
+     * @return the state of the provided service (UNREGISTERED | REGISTERED).
      */
     public int getState() {
         return m_ps.getState();

Modified: felix/trunk/ipojo/runtime/core/src/main/java/org/apache/felix/ipojo/util/DependencyModel.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/runtime/core/src/main/java/org/apache/felix/ipojo/util/DependencyModel.java?rev=1496547&r1=1496546&r2=1496547&view=diff
==============================================================================
--- felix/trunk/ipojo/runtime/core/src/main/java/org/apache/felix/ipojo/util/DependencyModel.java
(original)
+++ felix/trunk/ipojo/runtime/core/src/main/java/org/apache/felix/ipojo/util/DependencyModel.java
Tue Jun 25 17:20:06 2013
@@ -1072,23 +1072,23 @@ public abstract class DependencyModel {
             // Leaving the locked region to invoke callbacks
             releaseWriteLockIfHeld();
 
-                for (ServiceReference ref : departures) {
-                    onServiceDeparture(ref);
-                    // Notify service unbinding to listeners
-                    Object svc = services.get(ref);
-                    notifyListeners(DependencyEventType.UNBINDING, ref, svc);
-                }
-                for (ServiceReference ref : arrivals) {
-                    onServiceArrival(ref);
-                    // Notify service binding to listeners
-                    Object svc = services.get(ref);
-                    notifyListeners(DependencyEventType.BINDING, ref, svc);
-                }
-                // Do we have a modified service ?
-                if (set.modified != null && m_boundServices.contains(set.modified))
{
-                    onServiceModification(set.modified);
-                    // TODO call boundServiceModified on listeners???
-                }
+            for (ServiceReference ref : departures) {
+                onServiceDeparture(ref);
+                // Notify service unbinding to listeners
+                Object svc = services.get(ref);
+                notifyListeners(DependencyEventType.UNBINDING, ref, svc);
+            }
+            for (ServiceReference ref : arrivals) {
+                onServiceArrival(ref);
+                // Notify service binding to listeners
+                Object svc = services.get(ref);
+                notifyListeners(DependencyEventType.BINDING, ref, svc);
+            }
+            // Do we have a modified service ?
+            if (set.modified != null && m_boundServices.contains(set.modified)) {
+                onServiceModification(set.modified);
+                // TODO call boundServiceModified on listeners???
+            }
 
             // Did our state changed ?
             // this method will manage its own synchronization.



Mime
View raw message