felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pde...@apache.org
Subject svn commit: r1594618 - /felix/sandbox/pderop/dependencymanager-prototype/dm.runtime/src/dm/runtime/AbstractBuilder.java
Date Wed, 14 May 2014 15:46:50 GMT
Author: pderop
Date: Wed May 14 15:46:50 2014
New Revision: 1594618

URL: http://svn.apache.org/r1594618
Log:
Provide the Component in the ComponentStateListener.changed() method.

Modified:
    felix/sandbox/pderop/dependencymanager-prototype/dm.runtime/src/dm/runtime/AbstractBuilder.java

Modified: felix/sandbox/pderop/dependencymanager-prototype/dm.runtime/src/dm/runtime/AbstractBuilder.java
URL: http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager-prototype/dm.runtime/src/dm/runtime/AbstractBuilder.java?rev=1594618&r1=1594617&r2=1594618&view=diff
==============================================================================
--- felix/sandbox/pderop/dependencymanager-prototype/dm.runtime/src/dm/runtime/AbstractBuilder.java
(original)
+++ felix/sandbox/pderop/dependencymanager-prototype/dm.runtime/src/dm/runtime/AbstractBuilder.java
Wed May 14 15:46:50 2014
@@ -96,7 +96,7 @@ public abstract class AbstractBuilder
 
         if (registered != null || unregistered != null)
         {
-            c.add(new RegistrationListener(registered, unregistered, c));
+            c.add(new RegistrationListener(registered, unregistered));
         }
     }
 
@@ -125,17 +125,15 @@ public abstract class AbstractBuilder
     {
         private final String m_registered;
         private final String m_unregistered;
-        private final Component m_component;
         private volatile boolean m_isRegistered;
 
-        RegistrationListener(String registered, String unregistered, Component c)
+        RegistrationListener(String registered, String unregistered)
         {
             m_registered = registered;
             m_unregistered = unregistered;
-            m_component = c;
         }
 
-        public void changed(ComponentState state)
+        public void changed(Component c, ComponentState state)
         {
             boolean wasRegistered = m_isRegistered;
             switch (state)
@@ -146,13 +144,13 @@ public abstract class AbstractBuilder
                     if (!wasRegistered && m_registered != null)
                     {
                         // The component has registered a service: notify all component instances
-                        Object[] componentInstances = m_component.getInstances();
+                        Object[] componentInstances = c.getInstances();
                         for (Object instance : componentInstances)
                         {
                             try
                             {
                                 Class[][] signatures = new Class[][] { { ServiceRegistration.class
}, {} };
-                                Object[][] params = new Object[][] { { m_component.getServiceRegistration()
}, {} };
+                                Object[][] params = new Object[][] { { c.getServiceRegistration()
}, {} };
                                 InvocationUtil.invokeCallbackMethod(instance, m_registered,
signatures, params);
                             }
                             catch (Throwable t)
@@ -169,7 +167,7 @@ public abstract class AbstractBuilder
                     m_isRegistered = false;
                     if (wasRegistered && m_unregistered != null)
                     {
-                        Object[] componentInstances = m_component.getInstances();
+                        Object[] componentInstances = c.getInstances();
                         for (Object instance : componentInstances)
                         {
                             try



Mime
View raw message