felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fmesc...@apache.org
Subject svn commit: r781316 - in /felix/trunk/scr/src/main/java/org/apache/felix/scr/impl: AbstractComponentManager.java ComponentFactoryImpl.java DelayedComponentManager.java ImmediateComponentManager.java ServiceFactoryComponentManager.java
Date Wed, 03 Jun 2009 09:36:31 GMT
Author: fmeschbe
Date: Wed Jun  3 09:36:30 2009
New Revision: 781316

URL: http://svn.apache.org/viewvc?rev=781316&view=rev
Log:
FELIX-1185 Make getSatisfiedState() final in the AbstractComponentManager
and remove all getSatisfiedState() methods from extensions and replace
m_state my m_name field in log messages of the State class.

Modified:
    felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/AbstractComponentManager.java
    felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/ComponentFactoryImpl.java
    felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/DelayedComponentManager.java
    felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/ImmediateComponentManager.java
    felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/ServiceFactoryComponentManager.java

Modified: felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/AbstractComponentManager.java
URL: http://svn.apache.org/viewvc/felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/AbstractComponentManager.java?rev=781316&r1=781315&r2=781316&view=diff
==============================================================================
--- felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/AbstractComponentManager.java
(original)
+++ felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/AbstractComponentManager.java
Wed Jun  3 09:36:30 2009
@@ -115,42 +115,42 @@
         void enableInternal( AbstractComponentManager acm )
         {
             acm.log( LogService.LOG_DEBUG,
-                    "Current state: " + m_state + ", Event: enable",
+                    "Current state: " + m_name + ", Event: enable",
                     acm.getComponentMetadata(), null );
         }
 
         void disableInternal( AbstractComponentManager acm )
         {
             acm.log( LogService.LOG_DEBUG,
-                    "Current state: " + m_state + ", Event: disable",
+                    "Current state: " + m_name + ", Event: disable",
                     acm.getComponentMetadata(), null );
         }
 
         void activateInternal( AbstractComponentManager acm )
         {
             acm.log(LogService.LOG_DEBUG,
-                    "Current state: " + m_state + ", Event: activate",
+                    "Current state: " + m_name + ", Event: activate",
                     acm.getComponentMetadata(), null);
         }
 
         void deactivateInternal( AbstractComponentManager acm )
         {
             acm.log( LogService.LOG_DEBUG,
-                    "Current state: " + m_state + ", Event: deactivate",
+                    "Current state: " + m_name + ", Event: deactivate",
                     acm.getComponentMetadata(), null );
         }
 
         void disposeInternal( AbstractComponentManager acm )
         {
             acm.log( LogService.LOG_DEBUG,
-                    "Current state: " + m_state + ", Event: dispose",
+                    "Current state: " + m_name + ", Event: dispose",
                     acm.getComponentMetadata(), null );
         }
 
         Object getService( DelayedComponentManager dcm )
         {
             dcm.log( LogService.LOG_DEBUG,
-                    "Current state: " + m_state + ", Event: getService",
+                    "Current state: " + m_name + ", Event: getService",
                     dcm.getComponentMetadata(), null );
             return null;
         }
@@ -649,7 +649,23 @@
      */
     protected abstract Object getService();
 
-    protected abstract State getSatisfiedState();
+
+    final State getSatisfiedState()
+    {
+        if ( m_componentMetadata.isFactory() )
+        {
+            return Factory.getInstance();
+        }
+        else if ( m_componentMetadata.isImmediate() )
+        {
+            return Active.getInstance();
+        }
+        else
+        {
+            return Registered.getInstance();
+        }
+    }
+
 
     protected ServiceRegistration registerService()
     {

Modified: felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/ComponentFactoryImpl.java
URL: http://svn.apache.org/viewvc/felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/ComponentFactoryImpl.java?rev=781316&r1=781315&r2=781316&view=diff
==============================================================================
--- felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/ComponentFactoryImpl.java (original)
+++ felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/ComponentFactoryImpl.java Wed
Jun  3 09:36:30 2009
@@ -81,9 +81,6 @@
         // nothing to delete
     }
 
-    protected State getSatisfiedState() {
-        return Factory.getInstance();
-    }
 
     protected ServiceRegistration registerService()
     {

Modified: felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/DelayedComponentManager.java
URL: http://svn.apache.org/viewvc/felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/DelayedComponentManager.java?rev=781316&r1=781315&r2=781316&view=diff
==============================================================================
--- felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/DelayedComponentManager.java (original)
+++ felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/DelayedComponentManager.java Wed
Jun  3 09:36:30 2009
@@ -41,12 +41,6 @@
     }
 
 
-	protected State getSatisfiedState()
-	{
-		return Registered.getInstance();
-	}
-
-
     protected boolean createComponent()
     {
         // nothing to do here for a delayed component, will be done in the

Modified: felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/ImmediateComponentManager.java
URL: http://svn.apache.org/viewvc/felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/ImmediateComponentManager.java?rev=781316&r1=781315&r2=781316&view=diff
==============================================================================
--- felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/ImmediateComponentManager.java
(original)
+++ felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/ImmediateComponentManager.java
Wed Jun  3 09:36:30 2009
@@ -152,11 +152,6 @@
         m_properties = null;
     }
 
-	protected State getSatisfiedState()
-	{
-		return Active.getInstance();
-	}
-
 
     //**********************************************************************************************************
 

Modified: felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/ServiceFactoryComponentManager.java
URL: http://svn.apache.org/viewvc/felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/ServiceFactoryComponentManager.java?rev=781316&r1=781315&r2=781316&view=diff
==============================================================================
--- felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/ServiceFactoryComponentManager.java
(original)
+++ felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/ServiceFactoryComponentManager.java
Wed Jun  3 09:36:30 2009
@@ -52,12 +52,6 @@
     }
 
 
-	protected State getSatisfiedState()
-	{
-		return Factory.getInstance();
-	}
-
-
     /* (non-Javadoc)
      * @see org.apache.felix.scr.AbstractComponentManager#createComponent()
      */



Mime
View raw message