FELIX-3646 Make sure the the deactivation reason is not lost if an active component is disposed off

git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@1380104 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 8e3f568..aecaddc 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
@@ -606,7 +606,7 @@
      */
     public final void disposeInternal( int reason )
     {
-        m_state.dispose( this );
+        m_state.dispose( this, reason );
     }
 
 
@@ -1172,9 +1172,9 @@
         }
 
 
-        void dispose( AbstractComponentManager acm )
+        void dispose( AbstractComponentManager acm, int reason )
         {
-//            log( acm, "dispose" );
+//            log( acm, "dispose (reason: " + reason + ")" );
             throw new IllegalStateException("dispose" + this);
         }
 
@@ -1265,9 +1265,9 @@
             doDeactivate( acm, reason );
         }
 
-        void dispose( AbstractComponentManager acm )
+        void dispose( AbstractComponentManager acm, int reason )
         {
-            acm.log( LogService.LOG_DEBUG, "Disposing component", null );
+            acm.log( LogService.LOG_DEBUG, "Disposing component (reason: " + reason + ")", null );
             acm.clear();
             acm.changeState( Disposed.getInstance() );
 
@@ -1380,7 +1380,7 @@
             acm.log( LogService.LOG_DEBUG, "Component disabled", null );
         }
 
-        void dispose( AbstractComponentManager acm )
+        void dispose( AbstractComponentManager acm, int reason )
         {
             doDisable( acm );
             acm.clear();   //content of Disabled.dispose
@@ -1422,9 +1422,9 @@
             acm.changeState( Disabled.getInstance() );
         }
 
-        void dispose( AbstractComponentManager acm )
+        void dispose( AbstractComponentManager acm, int reason )
         {
-            doDeactivate( acm, ComponentConstants.DEACTIVATION_REASON_DISPOSED );
+            doDeactivate( acm, reason );
             doDisable(acm);
             acm.clear();   //content of Disabled.dispose
             acm.changeState( Disposed.getInstance() );
@@ -1620,7 +1620,7 @@
             throw new IllegalStateException( "disable: " + this );
         }
 
-        void dispose( AbstractComponentManager acm )
+        void dispose( AbstractComponentManager acm, int reason )
         {
             //factory instance can have dispose called with no effect. 112.5.5
         }
@@ -1636,13 +1636,13 @@
         boolean tryReadLock( long milliseconds ) throws InterruptedException;
         long getReadHoldCount();
         void unlockReadLock();
-        
+
         boolean tryWriteLock( long milliseconds ) throws InterruptedException;
         long getWriteHoldCount();
         void unlockWriteLock();
         void deescalate();
 
-        
+
     }
 
     private static class JLock implements LockWrapper