axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dee...@apache.org
Subject svn commit: r398132 - in /webservices/axis2/trunk/java/modules/core/src/org/apache/axis2: engine/ transport/ transport/http/ transport/jms/ transport/local/ transport/mail/ transport/tcp/
Date Sat, 29 Apr 2006 12:17:12 GMT
Author: deepal
Date: Sat Apr 29 05:17:11 2006
New Revision: 398132

URL: http://svn.apache.org/viewcvs?rev=398132&view=rev
Log:
fixing http://issues.apache.org/jira/browse/AXIS2-641

Modified:
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/AxisEngine.java
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/ListenerManager.java
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/TransportSender.java
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/CommonsHTTPTransportSender.java
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/jms/JMSSender.java
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/local/LocalResponder.java
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/local/LocalTransportSender.java
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/mail/MailTransportSender.java
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/tcp/TCPTransportSender.java

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/AxisEngine.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/AxisEngine.java?rev=398132&r1=398131&r2=398132&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/AxisEngine.java
(original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/AxisEngine.java
Sat Apr 29 05:17:11 2006
@@ -20,18 +20,7 @@
 import org.apache.axiom.om.OMAbstractFactory;
 import org.apache.axiom.om.OMElement;
 import org.apache.axiom.om.OMNamespace;
-import org.apache.axiom.soap.SOAP11Constants;
-import org.apache.axiom.soap.SOAP12Constants;
-import org.apache.axiom.soap.SOAPConstants;
-import org.apache.axiom.soap.SOAPEnvelope;
-import org.apache.axiom.soap.SOAPFault;
-import org.apache.axiom.soap.SOAPFaultCode;
-import org.apache.axiom.soap.SOAPFaultDetail;
-import org.apache.axiom.soap.SOAPFaultNode;
-import org.apache.axiom.soap.SOAPFaultReason;
-import org.apache.axiom.soap.SOAPFaultRole;
-import org.apache.axiom.soap.SOAPHeaderBlock;
-import org.apache.axiom.soap.SOAPProcessingException;
+import org.apache.axiom.soap.*;
 import org.apache.axis2.AxisFault;
 import org.apache.axis2.Constants;
 import org.apache.axis2.addressing.AddressingConstants;
@@ -161,8 +150,7 @@
                 processingContext.getProperty(MessageContext.CHARACTER_SET_ENCODING));
 
         // register the fault message context
-        if (processingContext.getAxisOperation() != null && processingContext.getOperationContext()
!= null)
-        {
+        if (processingContext.getAxisOperation() != null && processingContext.getOperationContext()
!= null) {
             processingContext.getAxisOperation().addFaultMessageContext(faultContext, processingContext.getOperationContext());
         }
 
@@ -190,9 +178,7 @@
         EndpointReference faultTo = processingContext.getFaultTo();
         if (faultTo != null && !doNotSendFaultUsingFaultTo) {
             faultContext.setTo(processingContext.getFaultTo());
-        } else
-        if (!doNotSendFaultUsingFaultTo && processingContext.getEnvelope().getHeader()
!= null && processingContext.getEnvelope().getHeader().getFirstChildWithName(new QName("FaultTo"))
!= null)
-        {
+        } else if (!doNotSendFaultUsingFaultTo && processingContext.getEnvelope().getHeader()
!= null && processingContext.getEnvelope().getHeader().getFirstChildWithName(new QName("FaultTo"))
!= null) {
             OMElement faultToElement = processingContext.getEnvelope().getHeader().getFirstChildWithName(new
QName("FaultTo"));
             faultTo = new EndpointReference("");
             faultTo.fromOM(faultToElement);
@@ -307,8 +293,7 @@
         } else if (axisFault != null) {
 
             Map faultElementsMap = axisFault.getFaultElements();
-            if (faultElementsMap != null && faultElementsMap.get(SOAP12Constants.SOAP_FAULT_CODE_LOCAL_NAME)
!= null)
-            {
+            if (faultElementsMap != null && faultElementsMap.get(SOAP12Constants.SOAP_FAULT_CODE_LOCAL_NAME)
!= null) {
                 fault.setCode((SOAPFaultCode) faultElementsMap.get(SOAP12Constants.SOAP_FAULT_CODE_LOCAL_NAME));
             } else {
                 QName faultCodeQName = axisFault.getFaultCode();
@@ -345,8 +330,7 @@
             message = soapException.getMessage();
         } else if (axisFault != null) {
             Map faultElementsMap = axisFault.getFaultElements();
-            if (faultElementsMap != null && faultElementsMap.get(SOAP12Constants.SOAP_FAULT_REASON_LOCAL_NAME)
!= null)
-            {
+            if (faultElementsMap != null && faultElementsMap.get(SOAP12Constants.SOAP_FAULT_REASON_LOCAL_NAME)
!= null) {
                 fault.setReason((SOAPFaultReason) faultElementsMap.get(SOAP12Constants.SOAP_FAULT_REASON_LOCAL_NAME));
             } else {
                 message = axisFault.getReason();
@@ -374,8 +358,7 @@
             fault.getRole().setText((String) faultRole);
         } else if (axisFault != null) {
             Map faultElementsMap = axisFault.getFaultElements();
-            if (faultElementsMap != null && faultElementsMap.get(SOAP12Constants.SOAP_FAULT_ROLE_LOCAL_NAME)
!= null)
-            {
+            if (faultElementsMap != null && faultElementsMap.get(SOAP12Constants.SOAP_FAULT_ROLE_LOCAL_NAME)
!= null) {
                 fault.setRole((SOAPFaultRole) faultElementsMap.get(SOAP12Constants.SOAP_FAULT_ROLE_LOCAL_NAME));
             }
         }
@@ -385,8 +368,7 @@
             fault.getNode().setText((String) faultNode);
         } else if (axisFault != null) {
             Map faultElementsMap = axisFault.getFaultElements();
-            if (faultElementsMap != null && faultElementsMap.get(SOAP12Constants.SOAP_FAULT_NODE_LOCAL_NAME)
!= null)
-            {
+            if (faultElementsMap != null && faultElementsMap.get(SOAP12Constants.SOAP_FAULT_NODE_LOCAL_NAME)
!= null) {
                 fault.setNode((SOAPFaultNode) faultElementsMap.get(SOAP12Constants.SOAP_FAULT_NODE_LOCAL_NAME));
             }
         }
@@ -399,8 +381,7 @@
             fault.setDetail((SOAPFaultDetail) faultDetail);
         } else if (axisFault != null) {
             Map faultElementsMap = axisFault.getFaultElements();
-            if (faultElementsMap != null && faultElementsMap.get(SOAP12Constants.SOAP_FAULT_DETAIL_LOCAL_NAME)
!= null)
-            {
+            if (faultElementsMap != null && faultElementsMap.get(SOAP12Constants.SOAP_FAULT_DETAIL_LOCAL_NAME)
!= null) {
                 fault.setDetail((SOAPFaultDetail) faultElementsMap.get(SOAP12Constants.SOAP_FAULT_DETAIL_LOCAL_NAME));
             } else {
                 OMElement detail = axisFault.getDetail();
@@ -616,6 +597,7 @@
                         new TransportNonBlockingInvocationWorker(msgContext, sender));
             } else {
                 sender.invoke(msgContext);
+//                sender.cleanUp(msgContext);
             }
         }
     }
@@ -681,6 +663,7 @@
         public void run() {
             try {
                 sender.invoke(msgctx);
+//                sender.cleanUp(msgctx);
             } catch (Exception e) {
                 log.info(e.getMessage());
             }

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/ListenerManager.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/ListenerManager.java?rev=398132&r1=398131&r2=398132&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/ListenerManager.java
(original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/ListenerManager.java
Sat Apr 29 05:17:11 2006
@@ -6,9 +6,11 @@
 import org.apache.axis2.description.AxisModule;
 import org.apache.axis2.description.AxisService;
 import org.apache.axis2.description.TransportInDescription;
+import org.apache.axis2.description.TransportOutDescription;
 import org.apache.axis2.i18n.Messages;
 import org.apache.axis2.modules.Module;
 import org.apache.axis2.transport.TransportListener;
+import org.apache.axis2.transport.TransportSender;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
@@ -131,6 +133,19 @@
         while (itr_st.hasNext()) {
             TransportListener transportListener = (TransportListener) itr_st.next();
             transportListener.stop();
+        }
+
+        // Stoping Transport senders
+        HashMap transportOut = configctx.getAxisConfiguration().getTransportsOut();
+        if (transportOut.size() > 0) {
+            Iterator trsItr = transportOut.values().iterator();
+            while (trsItr.hasNext()) {
+                TransportOutDescription outDescription = (TransportOutDescription) trsItr.next();
+                TransportSender trsSededer = outDescription.getSender();
+                if (trsSededer != null) {
+                    trsSededer.stop();
+                }
+            }
         }
         //calling module shoutdown method
         HashMap modules = configctx.getAxisConfiguration().getModules();

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/TransportSender.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/TransportSender.java?rev=398132&r1=398131&r2=398132&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/TransportSender.java
(original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/TransportSender.java
Sat Apr 29 05:17:11 2006
@@ -46,4 +46,6 @@
      */
     public void init(ConfigurationContext confContext, TransportOutDescription transportOut)
             throws AxisFault;
+
+    public void stop();
 }

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/CommonsHTTPTransportSender.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/CommonsHTTPTransportSender.java?rev=398132&r1=398131&r2=398132&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/CommonsHTTPTransportSender.java
(original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/CommonsHTTPTransportSender.java
Sat Apr 29 05:17:11 2006
@@ -130,6 +130,10 @@
         }
     }
 
+    public void stop() {
+        // Any code that , need to invoke when sender stop
+    }
+
 
     public void invoke(MessageContext msgContext) throws AxisFault {
         try {

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/jms/JMSSender.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/jms/JMSSender.java?rev=398132&r1=398131&r2=398132&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/jms/JMSSender.java
(original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/jms/JMSSender.java
Sat Apr 29 05:17:11 2006
@@ -47,10 +47,20 @@
  * This is meant to be used on a SOAP Client to call a SOAP server.
  */
 public class JMSSender extends AbstractHandler implements TransportSender {
-	
+
     private static final long serialVersionUID = -3883554138407525394L;
-    
-	protected static Log log = LogFactory.getLog(JMSSender.class.getName());
+
+    protected static Log log = LogFactory.getLog(JMSSender.class.getName());
+
+    static {
+
+        // add a shutdown hook to close JMS connections
+        Runtime.getRuntime().addShutdownHook(new Thread() {
+            public void run() {
+                JMSSender.closeAllConnectors();
+            }
+        });
+    }
 
     HashMap params = new HashMap();
 
@@ -173,6 +183,10 @@
         }
     }
 
+    public void stop() {
+        closeAllConnectors();
+    }
+
     /**
      * invoke() creates an endpoint, sends the request SOAP message, and then
      * either reads the response SOAP message or simply returns.
@@ -207,7 +221,7 @@
                 waitForResponse = !((Boolean) msgContext.getProperty(
                         Constants.Configuration.IS_USING_SEPARATE_LISTENER)).booleanValue();
             } else {
-                if(!msgContext.isServerSide()) {
+                if (!msgContext.isServerSide()) {
                     waitForResponse = !msgContext.getOptions().isUseSeparateListener();
                 }
             }

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/local/LocalResponder.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/local/LocalResponder.java?rev=398132&r1=398131&r2=398132&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/local/LocalResponder.java
(original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/local/LocalResponder.java
Sat Apr 29 05:17:11 2006
@@ -69,4 +69,8 @@
             throws AxisFault {
         return out;
     }
+
+    public void stop() {
+        //To change body of implemented methods use File | Settings | File Templates.
+    }
 }

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/local/LocalTransportSender.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/local/LocalTransportSender.java?rev=398132&r1=398131&r2=398132&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/local/LocalTransportSender.java
(original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/local/LocalTransportSender.java
Sat Apr 29 05:17:11 2006
@@ -95,4 +95,8 @@
     OutputStream getResponse() {
         return response;
     }
+
+    public void stop() {
+       
+    }
 }

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/mail/MailTransportSender.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/mail/MailTransportSender.java?rev=398132&r1=398131&r2=398132&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/mail/MailTransportSender.java
(original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/mail/MailTransportSender.java
Sat Apr 29 05:17:11 2006
@@ -125,4 +125,7 @@
             throws AxisFault {
         return out;
     }
+
+    public void stop() {
+    }
 }

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/tcp/TCPTransportSender.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/tcp/TCPTransportSender.java?rev=398132&r1=398131&r2=398132&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/tcp/TCPTransportSender.java
(original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/tcp/TCPTransportSender.java
Sat Apr 29 05:17:11 2006
@@ -36,7 +36,7 @@
 
     private static final long serialVersionUID = -6780125098288186598L;
 
-	/**
+    /**
      * Field out
      */
     protected Writer out;
@@ -114,5 +114,8 @@
     protected void writeTransportHeaders(Writer out, URL url, MessageContext msgContext,
                                          int contentLength)
             throws IOException {
+    }
+
+    public void stop() {
     }
 }



Mime
View raw message