felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pde...@apache.org
Subject svn commit: r1769198 - in /felix/trunk/dependencymanager: org.apache.felix.dependencymanager.itest/src/org/apache/felix/dm/itest/api/ org.apache.felix.dependencymanager/src/org/apache/felix/dm/ org.apache.felix.dependencymanager/src/org/apache/felix/dm...
Date Thu, 10 Nov 2016 21:18:12 GMT
Author: pderop
Date: Thu Nov 10 21:18:12 2016
New Revision: 1769198

URL: http://svn.apache.org/viewvc?rev=1769198&view=rev
Log:
FELIX-5403: Removed the STARTED event in ComponentState because it is the same as the TRACKING_OPTIONAL
event.

Modified:
    felix/trunk/dependencymanager/org.apache.felix.dependencymanager.itest/src/org/apache/felix/dm/itest/api/ComponentStateListenerTest.java
    felix/trunk/dependencymanager/org.apache.felix.dependencymanager/src/org/apache/felix/dm/ComponentState.java
    felix/trunk/dependencymanager/org.apache.felix.dependencymanager/src/org/apache/felix/dm/impl/ComponentImpl.java

Modified: felix/trunk/dependencymanager/org.apache.felix.dependencymanager.itest/src/org/apache/felix/dm/itest/api/ComponentStateListenerTest.java
URL: http://svn.apache.org/viewvc/felix/trunk/dependencymanager/org.apache.felix.dependencymanager.itest/src/org/apache/felix/dm/itest/api/ComponentStateListenerTest.java?rev=1769198&r1=1769197&r2=1769198&view=diff
==============================================================================
--- felix/trunk/dependencymanager/org.apache.felix.dependencymanager.itest/src/org/apache/felix/dm/itest/api/ComponentStateListenerTest.java
(original)
+++ felix/trunk/dependencymanager/org.apache.felix.dependencymanager.itest/src/org/apache/felix/dm/itest/api/ComponentStateListenerTest.java
Thu Nov 10 21:18:12 2016
@@ -162,7 +162,7 @@ public class ComponentStateListenerTest
 			case STARTING:
 	            m_ensure.step(3);
 	            break;
-			case STARTED:
+			case TRACKING_OPTIONAL:
 	            m_ensure.step(5);
 	            ServiceReference reference = m_registration.getReference();
 	            Assert.assertNotNull("Service not yet registered.", reference);
@@ -235,7 +235,7 @@ public class ComponentStateListenerTest
 			case STARTING:
 	            m_ensure.step(3);
 	            break;
-			case STARTED:
+			case TRACKING_OPTIONAL:
 	            m_ensure.step(5);
 	            ServiceReference reference = m_registration.getReference();
 	            Assert.assertNotNull("Service not yet registered.", reference);

Modified: felix/trunk/dependencymanager/org.apache.felix.dependencymanager/src/org/apache/felix/dm/ComponentState.java
URL: http://svn.apache.org/viewvc/felix/trunk/dependencymanager/org.apache.felix.dependencymanager/src/org/apache/felix/dm/ComponentState.java?rev=1769198&r1=1769197&r2=1769198&view=diff
==============================================================================
--- felix/trunk/dependencymanager/org.apache.felix.dependencymanager/src/org/apache/felix/dm/ComponentState.java
(original)
+++ felix/trunk/dependencymanager/org.apache.felix.dependencymanager/src/org/apache/felix/dm/ComponentState.java
Thu Nov 10 21:18:12 2016
@@ -31,43 +31,40 @@ public enum ComponentState {
 	INACTIVE, 
 	
 	/**
-	 * The component is waiting for some required dependencies.
+	 * The component is waiting for some required dependencies defined in the Activator. 
+	 * At this point the component has not yet been called in its init callback.
 	 */
 	WAITING_FOR_REQUIRED, 
 	
 	/**
-	 * The component has all its initial required dependencies available, but is now waiting
for some extra required
-	 * dependencies which have been added after the component have been started (like from the
component init method for example).
+	 * The component is instantiated and waiting for dynamic required dependencies defined in
init callback.
 	 */
 	INSTANTIATED_AND_WAITING_FOR_REQUIRED, 
 	
+    /**
+     * The component is starting. At this point, all required dependencies have been injected
(including 
+     * dynamic dependencies added from the init method), but the start callback has not yet
been called and 
+     * the service has not been registered yet.
+     */
+    STARTING,
+        
 	/**
-	 * The component is active, and is now tracking available optional dependencies.
+	 * The component is started. At this point, the component:<p>
+	 * <ul>
+	 * <li> has been called in its start callback 
+	 * <li> the optional dependency callbacks have been invoked (if some optional dependencies
are available)
+	 * <li> and the service has been registered
+	 * </ul>
 	 */
 	TRACKING_OPTIONAL,
 	
     /**
-     * The component is starting. At this point, the required
-     * dependencies have been injected, but the service has not been registered
-     * yet.
-     */
-    STARTING,
-    
-    /**
-     * The component is started. At this point, the component has been
-     * registered.
-     */
-    STARTED,
-    
-    /**
-     * the component is stopping. At this point, the component is still
-     * registered.
+     * the component is stopping. At this point, the service is still registered.
      */
     STOPPING,
     
     /**
-     * the component is stopped. At this point, the component has been
-     * unregistered.
+     * the component is stopped. At this point, the service has been unregistered.
      */
     STOPPED
 }

Modified: felix/trunk/dependencymanager/org.apache.felix.dependencymanager/src/org/apache/felix/dm/impl/ComponentImpl.java
URL: http://svn.apache.org/viewvc/felix/trunk/dependencymanager/org.apache.felix.dependencymanager/src/org/apache/felix/dm/impl/ComponentImpl.java?rev=1769198&r1=1769197&r2=1769198&view=diff
==============================================================================
--- felix/trunk/dependencymanager/org.apache.felix.dependencymanager/src/org/apache/felix/dm/impl/ComponentImpl.java
(original)
+++ felix/trunk/dependencymanager/org.apache.felix.dependencymanager/src/org/apache/felix/dm/impl/ComponentImpl.java
Thu Nov 10 21:18:12 2016
@@ -20,7 +20,6 @@ package org.apache.felix.dm.impl;
 
 import static org.apache.felix.dm.ComponentState.INACTIVE;
 import static org.apache.felix.dm.ComponentState.INSTANTIATED_AND_WAITING_FOR_REQUIRED;
-import static org.apache.felix.dm.ComponentState.STARTED;
 import static org.apache.felix.dm.ComponentState.STARTING;
 import static org.apache.felix.dm.ComponentState.STOPPED;
 import static org.apache.felix.dm.ComponentState.STOPPING;
@@ -592,15 +591,15 @@ public class ComponentImpl implements Co
                 // this new listener missed the starting cb
                 listener.changed(ComponentImpl.this, STARTING);
                 break;
-            case STARTED:
+            case TRACKING_OPTIONAL:
                 // this new listener missed the starting/started cb
                 listener.changed(ComponentImpl.this, STARTING);
-                listener.changed(ComponentImpl.this, STARTED);
+                listener.changed(ComponentImpl.this, TRACKING_OPTIONAL);
                 break;
             case STOPPING:
                 // this new listener missed the starting/started/stopping cb
                 listener.changed(ComponentImpl.this, STARTING);
-                listener.changed(ComponentImpl.this, STARTED);
+                listener.changed(ComponentImpl.this, TRACKING_OPTIONAL);
                 listener.changed(ComponentImpl.this, STOPPING);
                 break;
             case STOPPED:
@@ -1029,7 +1028,6 @@ public class ComponentImpl implements Co
             invokeAddOptionalDependencies();
             registerService();
             notifyListeners(newState);
-            notifyListeners(STARTED);
             return true;
         }
         if (oldState == ComponentState.TRACKING_OPTIONAL && newState == ComponentState.INSTANTIATED_AND_WAITING_FOR_REQUIRED)
{



Mime
View raw message