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 ve...@apache.org on 2009/06/14 19:04:28 UTC

svn commit: r784586 - in /webservices/commons/trunk/modules/transport/modules/jms/src/main/java/org/apache/axis2/transport/jms: JMSEndpoint.java JMSMessageReceiver.java

Author: veithen
Date: Sun Jun 14 17:04:28 2009
New Revision: 784586

URL: http://svn.apache.org/viewvc?rev=784586&view=rev
Log:
Consistently parse all service parameters when starting to listen to a service.

Modified:
    webservices/commons/trunk/modules/transport/modules/jms/src/main/java/org/apache/axis2/transport/jms/JMSEndpoint.java
    webservices/commons/trunk/modules/transport/modules/jms/src/main/java/org/apache/axis2/transport/jms/JMSMessageReceiver.java

Modified: webservices/commons/trunk/modules/transport/modules/jms/src/main/java/org/apache/axis2/transport/jms/JMSEndpoint.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/transport/modules/jms/src/main/java/org/apache/axis2/transport/jms/JMSEndpoint.java?rev=784586&r1=784585&r2=784586&view=diff
==============================================================================
--- webservices/commons/trunk/modules/transport/modules/jms/src/main/java/org/apache/axis2/transport/jms/JMSEndpoint.java (original)
+++ webservices/commons/trunk/modules/transport/modules/jms/src/main/java/org/apache/axis2/transport/jms/JMSEndpoint.java Sun Jun 14 17:04:28 2009
@@ -20,6 +20,7 @@
 import org.apache.axis2.description.Parameter;
 import org.apache.axis2.description.ParameterInclude;
 import org.apache.axis2.transport.base.BaseConstants;
+import org.apache.axis2.transport.base.ParamUtils;
 import org.apache.axis2.transport.base.ProtocolEndpoint;
 import org.apache.axis2.transport.base.threads.WorkerPool;
 import org.apache.axis2.transport.jms.ctype.ContentTypeRuleFactory;
@@ -54,6 +55,7 @@
     private JMSConnectionFactory cf;
     private String jndiDestinationName;
     private int destinationType = JMSConstants.GENERIC;
+    private String jndiReplyDestinationName;
     private Set<EndpointReference> endpointReferences = new HashSet<EndpointReference>();
     private ContentTypeRuleSet contentTypeRuleSet;
     private ServiceTaskManager serviceTaskManager;
@@ -77,6 +79,10 @@
         }
     }
 
+    public String getJndiReplyDestinationName() {
+        return jndiReplyDestinationName;
+    }
+
     @Override
     public EndpointReference[] getEndpointReferences(String ip) {
         return endpointReferences.toArray(new EndpointReference[endpointReferences.size()]);
@@ -196,6 +202,9 @@
             destinationType = JMSConstants.QUEUE;
         }
         
+        jndiReplyDestinationName = ParamUtils.getOptionalParam(service,
+                JMSConstants.PARAM_REPLY_DESTINATION);
+        
         Parameter contentTypeParam = service.getParameter(JMSConstants.CONTENT_TYPE_PARAM);
         if (contentTypeParam == null) {
             contentTypeRuleSet = new ContentTypeRuleSet();

Modified: webservices/commons/trunk/modules/transport/modules/jms/src/main/java/org/apache/axis2/transport/jms/JMSMessageReceiver.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/transport/modules/jms/src/main/java/org/apache/axis2/transport/jms/JMSMessageReceiver.java?rev=784586&r1=784585&r2=784586&view=diff
==============================================================================
--- webservices/commons/trunk/modules/transport/modules/jms/src/main/java/org/apache/axis2/transport/jms/JMSMessageReceiver.java (original)
+++ webservices/commons/trunk/modules/transport/modules/jms/src/main/java/org/apache/axis2/transport/jms/JMSMessageReceiver.java Sun Jun 14 17:04:28 2009
@@ -20,8 +20,6 @@
 import org.apache.axis2.transport.base.BaseConstants;
 import org.apache.axis2.transport.base.MetricsCollector;
 import org.apache.axis2.transport.jms.ctype.ContentTypeInfo;
-import org.apache.axis2.description.Parameter;
-import org.apache.axis2.description.AxisService;
 import org.apache.axis2.context.MessageContext;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
@@ -162,8 +160,6 @@
 
         String soapAction = JMSUtils.getProperty(message, BaseConstants.SOAPACTION);
 
-        AxisService service = endpoint.getService();
-
         ContentTypeInfo contentTypeInfo =
             endpoint.getContentTypeRuleSet().getContentTypeInfo(message);
         if (contentTypeInfo == null) {
@@ -177,9 +173,9 @@
         Destination replyTo = message.getJMSReplyTo();
         if (replyTo == null) {
             // does the service specify a default reply destination ?
-            Parameter param = service.getParameter(JMSConstants.PARAM_REPLY_DESTINATION);
-            if (param != null && param.getValue() != null) {
-                replyTo = jmsConnectionFactory.getDestination((String) param.getValue());
+            String jndiReplyDestinationName = endpoint.getJndiReplyDestinationName();
+            if (jndiReplyDestinationName != null) {
+                replyTo = jmsConnectionFactory.getDestination(jndiReplyDestinationName);
             }
 
         }