Author: chamikara
Date: Sun Jun  3 11:53:30 2007
New Revision: 543960

URL: http://svn.apache.org/viewvc?view=rev&rev=543960
Log:
added cleaning work to the module.shutdown method

Modified:
    
webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/SandeshaModule.java
    
webservices/sandesha/trunk/java/modules/core/src/main/resources/org/apache/sandesha2/i18n/resource.properties

Modified: 
webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/SandeshaModule.java
URL: 
http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/SandeshaModule.java?view=diff&rev=543960&r1=543959&r2=543960
==============================================================================
--- 
webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/SandeshaModule.java
 (original)
+++ 
webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/SandeshaModule.java
 Sun Jun  3 11:53:30 2007
@@ -51,6 +51,7 @@
 import org.apache.sandesha2.storage.StorageManager;
 import org.apache.sandesha2.util.PropertyManager;
 import org.apache.sandesha2.util.SandeshaUtil;
+import org.apache.sandesha2.workers.SandeshaThread;
 
 /**
  * The Module class of Sandesha2.
@@ -267,9 +268,26 @@
 
        public void shutdown(ConfigurationContext configurationContext) throws 
AxisFault {
                if(log.isDebugEnabled()) log.debug("Entry: 
SandeshaModule::shutdown, " + configurationContext);
-               SandeshaUtil.
-                       getSandeshaStorageManager(configurationContext, 
configurationContext.getAxisConfiguration())
-                               .shutdown();
+               StorageManager storageManager = SandeshaUtil.
+                       getSandeshaStorageManager(configurationContext, 
configurationContext.getAxisConfiguration());
+
+               if (storageManager!=null) {
+                       SandeshaThread sender = storageManager.getSender();
+                       SandeshaThread invoker = storageManager.getInvoker();
+                       SandeshaThread pollingManager = 
storageManager.getPollingManager();
+                       
+                       //stopping threads.
+                       if (sender!=null)
+                               sender.stopRunning();
+                       if (invoker!=null)
+                               invoker.stopRunning();
+                       if (pollingManager!=null)
+                               pollingManager.stopRunning();
+                       
+                       //shutting down the storage manager.
+                       storageManager.shutdown();
+               }
+               
                if(log.isDebugEnabled()) log.debug("Exit: 
SandeshaModule::shutdown");
        }
 

Modified: 
webservices/sandesha/trunk/java/modules/core/src/main/resources/org/apache/sandesha2/i18n/resource.properties
URL: 
http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/modules/core/src/main/resources/org/apache/sandesha2/i18n/resource.properties?view=diff&rev=543960&r1=543959&r2=543960
==============================================================================
--- 
webservices/sandesha/trunk/java/modules/core/src/main/resources/org/apache/sandesha2/i18n/resource.properties
 (original)
+++ 
webservices/sandesha/trunk/java/modules/core/src/main/resources/org/apache/sandesha2/i18n/resource.properties
 Sun Jun  3 11:53:30 2007
@@ -193,7 +193,7 @@
 addressNotValid=Cannot set the address - the address value is not valid.
 
 elementMustForSpec=Element ''{0}'' must be present for the spec ''{1}''.
-couldNotSendFaultDueToException="Could not send the fault ''{0}'' due to the 
exception " ''{1}'';
+couldNotSendFaultDueToException=Could not send the fault ''{0}'' due to the 
exception '{1}'';
 
 #-------------------------------------
 #



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to