You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by as...@apache.org on 2007/03/21 08:24:03 UTC

svn commit: r520781 - in /webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/jms: JMSConnectionFactory.java JMSMessageReceiver.java JMSSender.java

Author: asankha
Date: Wed Mar 21 00:24:02 2007
New Revision: 520781

URL: http://svn.apache.org/viewvc?view=rev&rev=520781
Log:
revert fix for 2030 and 2277 for build failures

Modified:
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/jms/JMSConnectionFactory.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/jms/JMSMessageReceiver.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/jms/JMSSender.java

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/jms/JMSConnectionFactory.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/jms/JMSConnectionFactory.java?view=diff&rev=520781&r1=520780&r2=520781
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/jms/JMSConnectionFactory.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/jms/JMSConnectionFactory.java Wed Mar 21 00:24:02 2007
@@ -18,7 +18,12 @@
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
-import javax.jms.*;
+import javax.jms.Connection;
+import javax.jms.ConnectionFactory;
+import javax.jms.Destination;
+import javax.jms.JMSException;
+import javax.jms.MessageConsumer;
+import javax.jms.Session;
 import javax.naming.Context;
 import javax.naming.InitialContext;
 import javax.naming.NameNotFoundException;
@@ -82,13 +87,9 @@
      */
     private String jndiName = null;
     /**
-     * Map of destination JNDI names to service names
+     * A map of destinations to service names they belong to
      */
-    private Map serviceJNDINameMapping = null;
-    /**
-     * Map of destinations to service names
-     */
-    private Map serviceDestinationMapping = null;
+    private Map destinations = null;
     /**
      * The JMS Sessions listening for messages
      */
@@ -123,8 +124,7 @@
     JMSConnectionFactory(String name, String jndiName) {
         this.name = name;
         this.jndiName = jndiName;
-        serviceJNDINameMapping = new HashMap();
-        serviceDestinationMapping = new HashMap();        
+        destinations = new HashMap();
         properties = new Hashtable();
         jmsSessions = new HashMap();
     }
@@ -176,24 +176,17 @@
      * @param serviceName     the service to which it belongs
      */
     public void addDestination(String destinationJndi, String serviceName) {
-        serviceJNDINameMapping.put(destinationJndi, serviceName);
-        serviceDestinationMapping.put(getDestinationName(destinationJndi), serviceName);
+        destinations.put(destinationJndi, serviceName);
     }
 
     /**
      * Remove listen destination on this connection factory
      *
      * @param destinationJndi the JMS destination to be removed
-     * @throws if an error occurs trying to stop listening for messages before removal
      */
     public void removeDestination(String destinationJndi) throws JMSException {
-        // find and save provider specific Destination name before we delete
-        String providerSpecificDestination = getDestinationName(destinationJndi);
         stoplistenOnDestination(destinationJndi);
-        serviceJNDINameMapping.remove(destinationJndi);
-        if (providerSpecificDestination != null) {
-            serviceDestinationMapping.remove(providerSpecificDestination);
-        }
+        destinations.remove(destinationJndi);
     }
 
     /**
@@ -234,12 +227,12 @@
     }
 
     /**
-     * Get the list of destinations (JNDI) associated with this connection factory
+     * Get the list of destinations associated with this connection factory
      *
      * @return destinations to service maping
      */
     public Map getDestinations() {
-        return serviceJNDINameMapping;
+        return destinations;
     }
 
     /**
@@ -278,7 +271,7 @@
             }
         }
 
-        Iterator iter = serviceJNDINameMapping.keySet().iterator();
+        Iterator iter = destinations.keySet().iterator();
         while (iter.hasNext()) {
             String destinationJndi = (String) iter.next();
             listenOnDestination(destinationJndi);
@@ -313,7 +306,7 @@
             log.warn("Error looking up destination : " + destinationJndi, e);
             // mark service as faulty
             JMSUtils.markServiceAsFaulty(
-                    (String) serviceJNDINameMapping.get(destinationJndi),
+                    (String) destinations.get(destinationJndi),
                     "Error looking up JMS destination : " + destinationJndi,
                     this.msgRcvr.getAxisConf().getAxisConfiguration());
         }
@@ -341,7 +334,7 @@
      */
     public String getServiceNameForDestination(String destination) {
 
-        return (String) serviceJNDINameMapping.get(destination);
+        return (String) destinations.get(destination);
     }
 
     /**
@@ -353,34 +346,6 @@
         } catch (JMSException e) {
             log.warn("Error shutting down connection factory : " + name, e);
         }
-    }
-
-    /**
-     * Return the provider specific Destination name if any for the destination with the given
-     * JNDI name
-     * @param destinationJndi the JNDI name of the destination
-     * @return the provider specific Destination name or null if cannot be found
-     */
-    public String getDestinationName(String destinationJndi) {
-        try {
-            Destination destination = (Destination) context.lookup(destinationJndi);
-            if (destination != null && destination instanceof Queue) {
-                return ((Queue) destination).getQueueName();
-            } else if (destination != null && destination instanceof Topic) {
-                return ((Topic) destination).getTopicName();
-            }
-        } catch (JMSException e) {
-            log.warn("Error reading provider specific JMS destination name for destination " +
-                "with JNDI name : " + destinationJndi, e);
-        } catch (NamingException e) {
-            log.warn("Error looking up destination with JNDI name : " + destinationJndi +
-                " to map its corresponding provider specific Destination name");
-        }
-        return null;
-    }
-
-    public String getServiceByDestination(String destinationName) {
-        return (String) serviceDestinationMapping.get(destinationName);
     }
 
     private void handleException(String msg) throws AxisJMSException {

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/jms/JMSMessageReceiver.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/jms/JMSMessageReceiver.java?view=diff&rev=520781&r1=520780&r2=520781
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/jms/JMSMessageReceiver.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/jms/JMSMessageReceiver.java Wed Mar 21 00:24:02 2007
@@ -19,7 +19,6 @@
 import org.apache.axiom.om.util.UUIDGenerator;
 import org.apache.axis2.AxisFault;
 import org.apache.axis2.Constants;
-import org.apache.axis2.addressing.RelatesTo;
 import org.apache.axis2.context.ConfigurationContext;
 import org.apache.axis2.context.ContextFactory;
 import org.apache.axis2.context.MessageContext;
@@ -131,7 +130,7 @@
                 destinationName = ((Topic) dest).getTopicName();
             }
 
-            String serviceName = jmsConFac.getServiceByDestination(destinationName);
+            String serviceName = jmsConFac.getServiceNameForDestination(destinationName);
 
             // hack to get around the crazy Active MQ dynamic queue and topic issues
             if (serviceName == null) {
@@ -166,7 +165,6 @@
 
             msgContext.setServerSide(true);
             msgContext.setServiceGroupContextId(UUIDGenerator.getUUID());
-            msgContext.setMessageID(message.getJMSMessageID());
 
             String soapAction = JMSUtils.getProperty(message, JMSConstants.SOAPACTION);
             if (soapAction != null) {
@@ -175,14 +173,6 @@
 
             msgContext.setEnvelope(
                     JMSUtils.getSOAPEnvelope(message, msgContext, in));
-
-            // set correlation id
-            String correlationId = message.getJMSCorrelationID();
-            if (correlationId != null && correlationId.length() > 0) {
-                msgContext.setProperty(JMSConstants.JMS_COORELATION_ID, correlationId);
-                msgContext.setRelationships(
-                    new RelatesTo[] { new RelatesTo(correlationId) });
-            }
 
             return msgContext;
 

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/jms/JMSSender.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/jms/JMSSender.java?view=diff&rev=520781&r1=520780&r2=520781
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/jms/JMSSender.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/jms/JMSSender.java Wed Mar 21 00:24:02 2007
@@ -243,10 +243,6 @@
 
         // set the JMS correlation ID if specified
         String correlationId = getProperty(msgContext, JMSConstants.JMS_COORELATION_ID);
-        if (correlationId == null && msgContext.getRelatesTo() != null) {
-            correlationId = msgContext.getRelatesTo().getValue();
-        }
-
         if (correlationId != null) {
             message.setJMSCorrelationID(correlationId);
         }



---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org