Author: asankha
Date: Wed Mar 25 05:34:15 2009
New Revision: 758146

URL: http://svn.apache.org/viewvc?rev=758146&view=rev
Log:
minor clean up of code

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

Modified: 
webservices/commons/trunk/modules/transport/modules/base/src/main/java/org/apache/axis2/transport/base/AbstractTransportListener.java
URL: 
http://svn.apache.org/viewvc/webservices/commons/trunk/modules/transport/modules/base/src/main/java/org/apache/axis2/transport/base/AbstractTransportListener.java?rev=758146&r1=758145&r2=758146&view=diff
==============================================================================
--- 
webservices/commons/trunk/modules/transport/modules/base/src/main/java/org/apache/axis2/transport/base/AbstractTransportListener.java
 (original)
+++ 
webservices/commons/trunk/modules/transport/modules/base/src/main/java/org/apache/axis2/transport/base/AbstractTransportListener.java
 Wed Mar 25 05:34:15 2009
@@ -306,33 +306,32 @@
 
         // send the message context through the axis engine
         try {
-                try {
-                    // check if an callback has register for this message
-                    Map callBackMap = (Map) 
msgCtx.getConfigurationContext().getProperty(BaseConstants.CALLBACK_TABLE);
-                    // FIXME: transport headers are protocol specific; the 
correlation ID should be passed as argument to this method
-                    Object replyToMessageID = 
trpHeaders.get(BaseConstants.HEADER_IN_REPLY_TO);
-                    // if there is a call back register with this replyto ID 
then this has
-                    // to handle as a synchronized message
-                    if ((replyToMessageID != null) && 
(callBackMap.get(replyToMessageID) != null)) {
-                        SynchronousCallback synchronousCallback = 
(SynchronousCallback) callBackMap.get(replyToMessageID);
-                        synchronousCallback.setInMessageContext(msgCtx);
-                        callBackMap.remove(replyToMessageID);
-                    } else {
-                        AxisEngine.receive(msgCtx);
-                    }
-
-                } catch (AxisFault e) {
-                    e.printStackTrace();
-                    if (log.isDebugEnabled()) {
-                        log.debug("Error receiving message", e);
-                    }
-                    if (msgCtx.isServerSide()) {
-                        
AxisEngine.sendFault(MessageContextBuilder.createFaultMessageContext(msgCtx, 
e));
-                    }
-                }
-        } catch (AxisFault axisFault) {
-            logException("Error processing received message", axisFault);
-            throw axisFault;
+            // check if an Axis2 callback has been registered for this message
+            Map callBackMap = (Map) msgCtx.getConfigurationContext().
+                getProperty(BaseConstants.CALLBACK_TABLE);
+            // FIXME: transport headers are protocol specific; the correlation 
ID should be
+            // passed as argument to this method
+            Object replyToMessageID = 
trpHeaders.get(BaseConstants.HEADER_IN_REPLY_TO);
+            // if there is a callback registerd with this replyto ID then this 
has to
+            // be handled as a synchronous incoming message, via the
+            if (replyToMessageID != null && callBackMap != null &&
+                callBackMap.get(replyToMessageID) != null) {
+
+                SynchronousCallback synchronousCallback =
+                    (SynchronousCallback) callBackMap.get(replyToMessageID);
+                synchronousCallback.setInMessageContext(msgCtx);
+                callBackMap.remove(replyToMessageID);
+            } else {
+                AxisEngine.receive(msgCtx);
+            }
+
+        } catch (AxisFault e) {
+            if (log.isDebugEnabled()) {
+                log.debug("Error receiving message", e);
+            }
+            if (msgCtx.isServerSide()) {
+                
AxisEngine.sendFault(MessageContextBuilder.createFaultMessageContext(msgCtx, 
e));
+            }
         }
     }
 

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=758146&r1=758145&r2=758146&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
 Wed Mar 25 05:34:15 2009
@@ -205,13 +205,15 @@
             TransportInDescription mailTo =
                     
configContext.getAxisConfiguration().getTransportIn(MailConstants.TRANSPORT_NAME);
             if (mailTo == null) {
-                handleException("Could not found the transport receiver for " 
+ MailConstants.TRANSPORT_NAME);
+                handleException("Could not find the transport receiver for " +
+                    MailConstants.TRANSPORT_NAME);
             }
             configContext.getListenerManager().addListener(mailTo, false);
         }
 
         SynchronousCallback synchronousCallback = new 
SynchronousCallback(msgContext);
-        Map callBackMap = (Map) 
msgContext.getConfigurationContext().getProperty(BaseConstants.CALLBACK_TABLE);
+        Map callBackMap = (Map) msgContext.getConfigurationContext().
+            getProperty(BaseConstants.CALLBACK_TABLE);
         callBackMap.put(mailMessageID, synchronousCallback);
         synchronized (synchronousCallback) {
             try {


Reply via email to