activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jstrac...@apache.org
Subject svn commit: r508489 - in /activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/stomp: LegacyFrameTranslator.java ProtocolConverter.java
Date Fri, 16 Feb 2007 16:54:01 GMT
Author: jstrachan
Date: Fri Feb 16 08:54:00 2007
New Revision: 508489

URL: http://svn.apache.org/viewvc?view=rev&rev=508489
Log:
added support for temporary destinations and support more polymorphic request/reply logic
in clients

Modified:
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/stomp/LegacyFrameTranslator.java
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/stomp/ProtocolConverter.java

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/stomp/LegacyFrameTranslator.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/stomp/LegacyFrameTranslator.java?view=diff&rev=508489&r1=508488&r2=508489
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/stomp/LegacyFrameTranslator.java
(original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/stomp/LegacyFrameTranslator.java
Fri Feb 16 08:54:00 2007
@@ -73,10 +73,20 @@
 
         StringBuffer buffer = new StringBuffer();
         if (amq_d.isQueue()) {
-            buffer.append("/queue/");
+            if (amq_d.isTemporary()) {
+                buffer.append("/temp-queue/");
+            }
+            else {
+                buffer.append("/queue/");
+            }
         }
-        if (amq_d.isTopic()) {
-            buffer.append("/topic/");
+        else {
+            if (amq_d.isTemporary()) {
+                buffer.append("/temp-topic/");
+            }
+            else {
+                buffer.append("/topic/");
+            }
         }
         buffer.append(p_name);
         return buffer.toString();
@@ -94,9 +104,17 @@
             String t_name = name.substring("/topic/".length(), name.length());
             return ActiveMQDestination.createDestination(t_name, ActiveMQDestination.TOPIC_TYPE);
         }
+        else if (name.startsWith("/temp-queue/")) {
+            String t_name = name.substring("/temp-queue/".length(), name.length());
+            return ActiveMQDestination.createDestination(t_name, ActiveMQDestination.TEMP_QUEUE_TYPE);
+        }
+        else if (name.startsWith("/temp-topic/")) {
+            String t_name = name.substring("/temp-topic/".length(), name.length());
+            return ActiveMQDestination.createDestination(t_name, ActiveMQDestination.TEMP_TOPIC_TYPE);
+        }
         else {
             throw new ProtocolException("Illegal destination name: [" + name + "] -- ActiveMQ
STOMP destinations " +
-                                        "must begine with /queue/ or /topic/");
+                                        "must begine with one of: /queue/ /topic/ /temp-queue/
/temp-topic/");
         }
     }
 }

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/stomp/ProtocolConverter.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/stomp/ProtocolConverter.java?view=diff&rev=508489&r1=508488&r2=508489
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/stomp/ProtocolConverter.java
(original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/stomp/ProtocolConverter.java
Fri Feb 16 08:54:00 2007
@@ -428,8 +428,14 @@
 
 	                    responseHeaders.put(Stomp.Headers.Connected.SESSION, connectionInfo.getClientId());
 	                    String requestId = (String) headers.get(Stomp.Headers.Connect.REQUEST_ID);
+                        if (requestId == null) {
+                            // TODO legacy
+                            requestId = (String) headers.get(Stomp.Headers.RECEIPT_REQUESTED);
+                        }
 	                    if( requestId !=null ){
+                            // TODO legacy
 		                    responseHeaders.put(Stomp.Headers.Connected.RESPONSE_ID, requestId);
+                            responseHeaders.put(Stomp.Headers.Response.RECEIPT_ID, requestId);
 	            		}
 
 	                    StompFrame sc = new StompFrame();
@@ -441,7 +447,6 @@
 
 			}
 		});
-
 	}
 
 	protected void onStompDisconnect(StompFrame command) throws ProtocolException {
@@ -483,9 +488,7 @@
 	}
 
     public  ActiveMQMessage convertMessage(StompFrame command) throws IOException, JMSException
{
-
         ActiveMQMessage msg = frameTranslator.convertFrame(command);
-
         return msg;
     }
 



Mime
View raw message