felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: r1486752 - /felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/manager/AbstractComponentManager.java
Date Tue, 28 May 2013 05:57:35 GMT
Author: djencks
Date: Tue May 28 05:57:35 2013
New Revision: 1486752

URL: http://svn.apache.org/r1486752
Log:
FELIX-4070 remove enable state method

Modified:
    felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/manager/AbstractComponentManager.java

Modified: felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/manager/AbstractComponentManager.java
URL: http://svn.apache.org/viewvc/felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/manager/AbstractComponentManager.java?rev=1486752&r1=1486751&r2=1486752&view=diff
==============================================================================
--- felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/manager/AbstractComponentManager.java
(original)
+++ felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/manager/AbstractComponentManager.java
Tue May 28 05:57:35 2013
@@ -108,7 +108,9 @@ public abstract class AbstractComponentM
     private final Object enabledLatchLock = new Object();
 
     protected volatile boolean m_internalEnabled;
-
+    
+    private volatile boolean disposed;
+    
     //service event tracking
     private int floor;
 
@@ -513,6 +515,7 @@ public abstract class AbstractComponentM
      */
     public void dispose( int reason )
     {
+        disposed = true;
         disposeInternal( reason );
     }
     
@@ -673,7 +676,20 @@ public abstract class AbstractComponentM
 
     final void enableInternal()
     {
-        m_state.enable( this );
+        if ( disposed )
+        {
+            throw new IllegalStateException( "enable: " + this );
+        }
+        if ( !isActivatorActive() )
+        {
+            log( LogService.LOG_DEBUG, "Bundle's component activator is not active; not enabling
component",
+                    null );
+            return;
+        }
+
+        registerComponentId();
+        changeState( Unsatisfied.getInstance() );
+        log( LogService.LOG_DEBUG, "Component enabled", null );
         m_internalEnabled = true;
     }
 
@@ -1307,12 +1323,6 @@ public abstract class AbstractComponentM
             return m_state;
         }
 
-        void enable( AbstractComponentManager acm )
-        {
-            log( acm, "enable" );
-        }
-
-
         void activate( AbstractComponentManager acm )
         {
             log( acm, "activate" );
@@ -1404,20 +1414,6 @@ public abstract class AbstractComponentM
         }
 
 
-        void enable( AbstractComponentManager acm )
-        {
-            if ( !acm.isActivatorActive() )
-            {
-                acm.log( LogService.LOG_DEBUG, "Bundle's component activator is not active;
not enabling component",
-                    null );
-                return;
-            }
-
-            acm.registerComponentId();
-            acm.changeState( Unsatisfied.getInstance() );
-            acm.log( LogService.LOG_DEBUG, "Component enabled", null );
-        }
-
         void deactivate( AbstractComponentManager acm, int reason, boolean disable )
         {
             doDeactivate( acm, reason, disable );
@@ -1738,9 +1734,5 @@ public abstract class AbstractComponentM
             //factory instance can have dispose called with no effect. 112.5.5
         }
 
-        void enable( AbstractComponentManager acm )
-        {
-            throw new IllegalStateException( "enable: " + this );
-        }
     }
 }



Mime
View raw message