FELIX-4070 remove enable state method
git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@1486752 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/scr/src/main/java/org/apache/felix/scr/impl/manager/AbstractComponentManager.java b/scr/src/main/java/org/apache/felix/scr/impl/manager/AbstractComponentManager.java
index 9bb7341..f8ea35b 100644
--- a/scr/src/main/java/org/apache/felix/scr/impl/manager/AbstractComponentManager.java
+++ b/scr/src/main/java/org/apache/felix/scr/impl/manager/AbstractComponentManager.java
@@ -108,7 +108,9 @@
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 void dispose( int reason )
{
+ disposed = true;
disposeInternal( reason );
}
@@ -673,7 +676,20 @@
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 @@
return m_state;
}
- void enable( AbstractComponentManager acm )
- {
- log( acm, "enable" );
- }
-
-
void activate( AbstractComponentManager acm )
{
log( acm, "activate" );
@@ -1404,20 +1414,6 @@
}
- 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 @@
//factory instance can have dispose called with no effect. 112.5.5
}
- void enable( AbstractComponentManager acm )
- {
- throw new IllegalStateException( "enable: " + this );
- }
}
}