Author: amilas
Date: Wed Apr  1 09:55:47 2009
New Revision: 760834

URL: http://svn.apache.org/viewvc?rev=760834&view=rev
Log:
commiting the patch for WSCOMMONS-456

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

Added: 
webservices/commons/trunk/modules/transport/modules/mail/src/main/java/org/apache/axis2/transport/mail/MailRequestResponseTransport.java
URL: 
http://svn.apache.org/viewvc/webservices/commons/trunk/modules/transport/modules/mail/src/main/java/org/apache/axis2/transport/mail/MailRequestResponseTransport.java?rev=760834&view=auto
==============================================================================
--- 
webservices/commons/trunk/modules/transport/modules/mail/src/main/java/org/apache/axis2/transport/mail/MailRequestResponseTransport.java
 (added)
+++ 
webservices/commons/trunk/modules/transport/modules/mail/src/main/java/org/apache/axis2/transport/mail/MailRequestResponseTransport.java
 Wed Apr  1 09:55:47 2009
@@ -0,0 +1,53 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.axis2.transport.mail;
+
+import org.apache.axis2.transport.RequestResponseTransport;
+import org.apache.axis2.context.MessageContext;
+import org.apache.axis2.AxisFault;
+
+/**
+ * this class is not generally used with the SMTP transport. this is added to 
work
+ * this smtp transport with Sandesah2. 
+ */
+
+public class MailRequestResponseTransport implements RequestResponseTransport {
+
+    RequestResponseTransportStatus status = 
RequestResponseTransportStatus.WAITING;
+
+    public void acknowledgeMessage(MessageContext messageContext) throws 
AxisFault {
+    }
+
+    public void awaitResponse() throws InterruptedException, AxisFault {
+    }
+
+    public void signalResponseReady() {
+    }
+
+    public void signalFaultReady(AxisFault axisFault) {
+    }
+
+    public RequestResponseTransportStatus getStatus() {
+        return status;
+    }
+
+    public boolean isResponseWritten() {
+        return false;
+    }
+
+    public void setResponseWritten(boolean b) {
+    }
+}

Modified: 
webservices/commons/trunk/modules/transport/modules/mail/src/main/java/org/apache/axis2/transport/mail/MailTransportListener.java
URL: 
http://svn.apache.org/viewvc/webservices/commons/trunk/modules/transport/modules/mail/src/main/java/org/apache/axis2/transport/mail/MailTransportListener.java?rev=760834&r1=760833&r2=760834&view=diff
==============================================================================
--- 
webservices/commons/trunk/modules/transport/modules/mail/src/main/java/org/apache/axis2/transport/mail/MailTransportListener.java
 (original)
+++ 
webservices/commons/trunk/modules/transport/modules/mail/src/main/java/org/apache/axis2/transport/mail/MailTransportListener.java
 Wed Apr  1 09:55:47 2009
@@ -31,6 +31,7 @@
 import org.apache.axis2.description.TransportInDescription;
 import org.apache.axis2.engine.AxisConfiguration;
 import org.apache.axis2.transport.TransportUtils;
+import org.apache.axis2.transport.RequestResponseTransport;
 import org.apache.axis2.transport.base.AbstractPollingTransportListener;
 import org.apache.axis2.transport.base.BaseConstants;
 import org.apache.axis2.transport.base.BaseUtils;
@@ -454,6 +455,8 @@
 
         // save out transport information
         msgContext.setProperty(Constants.OUT_TRANSPORT_INFO, outInfo);
+        // this property only useful for supporting smtp with Sandesha2.
+        msgContext.setProperty(RequestResponseTransport.TRANSPORT_CONTROL, new 
MailRequestResponseTransport());
 
         // set message context From
         if (outInfo.getFromAddress() != null) {

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=760834&r1=760833&r2=760834&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 Apr  1 09:55:47 2009
@@ -367,11 +367,13 @@
             message.setSubject(BaseConstants.SOAPACTION + ": " + 
msgContext.getSoapAction());
         }
 
+        //TODO: use a combined message id for smtp so that it generates a 
unique id while
+        // being able to support asynchronous communication.
         // if a custom message id is set, use it
-        if (msgContext.getMessageID() != null) {
-            message.setHeader(MailConstants.MAIL_HEADER_MESSAGE_ID, 
msgContext.getMessageID());
-            message.setHeader(MailConstants.MAIL_HEADER_X_MESSAGE_ID, 
msgContext.getMessageID());
-        }
+//        if (msgContext.getMessageID() != null) {
+//            message.setHeader(MailConstants.MAIL_HEADER_MESSAGE_ID, 
msgContext.getMessageID());
+//            message.setHeader(MailConstants.MAIL_HEADER_X_MESSAGE_ID, 
msgContext.getMessageID());
+//        }
 
         // if this is a reply, set reference to original message
         if (outInfo.getRequestMessageID() != null) {


Reply via email to