Author: fmeschbe
Date: Mon Jun 2 03:40:58 2008
New Revision: 662387
URL: http://svn.apache.org/viewvc?rev=662387&view=rev
Log:
FELIX-591 Guard disableInternal and disposeInternal against disabling after
the component has already been disposed.
Modified:
felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/AbstractComponentManager.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=662387&r1=662386&r2=662387&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
Mon Jun 2 03:40:58 2008
@@ -504,6 +504,14 @@
{
// CONCURRENCY NOTE: This method is only called from the
BundleComponentActivator or by application logic
// but not by the dependency managers
+
+ // if the component is already disabled or destroyed, we have
+ // nothing to do
+ if ( ( getState() & ( STATE_DISABLED | STATE_DESTROYED ) ) != 0 )
+ {
+ log( LogService.LOG_DEBUG, "Component already disabled",
m_componentMetadata, null );
+ return;
+ }
// deactivate first, this does nothing if not active/registered/factory
deactivateInternal();
@@ -535,6 +543,13 @@
// CONCURRENCY NOTE: This method is only called from the
BundleComponentActivator or by application logic
// but not by the dependency managers
+ // if the component is already destroyed, we have nothing to do
+ if ( getState() == STATE_DESTROYED )
+ {
+ log( LogService.LOG_DEBUG, "Component already destroyed",
m_componentMetadata, null );
+ return;
+ }
+
// disable first to clean up correctly
disableInternal();