You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commons-dev@ws.apache.org by am...@apache.org on 2008/09/26 07:32:23 UTC

svn commit: r699183 - /webservices/commons/trunk/modules/transport/modules/mail/src/main/java/org/apache/axis2/transport/mail/MailTransportSender.java

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");
         }
     }