Author: amilas
Date: Thu Sep 25 22:32:22 2008
New Revision: 699183

URL: http://svn.apache.org/viewvc?rev=699183&view=rev
Log:
Handle exceptions using existing routine. and remove the callback after time out

Modified:
    
webservices/commons/trunk/modules/transport/modules/mail/src/main/java/org/apache/axis2/transport/mail/MailTransportSender.java

Modified: 
webservices/commons/trunk/modules/transport/modules/mail/src/main/java/org/apache/axis2/transport/mail/MailTransportSender.java
URL: 
http://svn.apache.org/viewvc/webservices/commons/trunk/modules/transport/modules/mail/src/main/java/org/apache/axis2/transport/mail/MailTransportSender.java?rev=699183&r1=699182&r2=699183&view=diff
==============================================================================
--- 
webservices/commons/trunk/modules/transport/modules/mail/src/main/java/org/apache/axis2/transport/mail/MailTransportSender.java
 (original)
+++ 
webservices/commons/trunk/modules/transport/modules/mail/src/main/java/org/apache/axis2/transport/mail/MailTransportSender.java
 Thu Sep 25 22:32:22 2008
@@ -217,7 +217,7 @@
             TransportInDescription mailTo =
                     
configContext.getAxisConfiguration().getTransportIn(MailConstants.TRANSPORT_NAME);
             if (mailTo == null) {
-                throw new AxisFault("Could not found the transport receiver 
for " + MailConstants.TRANSPORT_NAME);
+                handleException("Could not found the transport receiver for " 
+ MailConstants.TRANSPORT_NAME);
             }
             configContext.getListenerManager().addListener(mailTo, false);
         }
@@ -229,12 +229,14 @@
             try {
                 
synchronousCallback.wait(msgContext.getOptions().getTimeOutInMilliSeconds());
             } catch (InterruptedException e) {
-                throw new AxisFault("Error occured while waiting ..", e);
+                handleException("Error occured while waiting ..", e);
             }
         }
 
         if (!synchronousCallback.isComplete()){
-            throw new AxisFault("Timeout while waiting from a response");
+            // when timeout occurs remove this entry.
+            callBackMap.remove(mailMessageID);
+            handleException("Timeout while waiting for a response");
         }
     }
 


Reply via email to