Author: chirino
Date: Tue Sep 6 13:59:37 2011
New Revision: 1165674
URL: http://svn.apache.org/viewvc?rev=1165674&view=rev
Log:
https://issues.apache.org/jira/browse/APLO-86 : If a temp:true header is set on
a subscribe frame, then the destination that the subscription creates will only
be consumable by the connection which creates the destination.
Modified:
activemq/activemq-apollo/trunk/apollo-stomp/src/main/scala/org/apache/activemq/apollo/stomp/StompFrame.scala
activemq/activemq-apollo/trunk/apollo-stomp/src/main/scala/org/apache/activemq/apollo/stomp/StompProtocolHandler.scala
Modified:
activemq/activemq-apollo/trunk/apollo-stomp/src/main/scala/org/apache/activemq/apollo/stomp/StompFrame.scala
URL:
http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-stomp/src/main/scala/org/apache/activemq/apollo/stomp/StompFrame.scala?rev=1165674&r1=1165673&r2=1165674&view=diff
==============================================================================
---
activemq/activemq-apollo/trunk/apollo-stomp/src/main/scala/org/apache/activemq/apollo/stomp/StompFrame.scala
(original)
+++
activemq/activemq-apollo/trunk/apollo-stomp/src/main/scala/org/apache/activemq/apollo/stomp/StompFrame.scala
Tue Sep 6 13:59:37 2011
@@ -406,6 +406,7 @@ object Stomp {
val EXCLUSIVE = ascii("exclusive")
val USER_ID = ascii("user-id")
val AUTO_DELETE = ascii("auto-delete")
+ val TEMP = ascii("temp")
///////////////////////////////////////////////////////////////////
// Common Values
Modified:
activemq/activemq-apollo/trunk/apollo-stomp/src/main/scala/org/apache/activemq/apollo/stomp/StompProtocolHandler.scala
URL:
http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-stomp/src/main/scala/org/apache/activemq/apollo/stomp/StompProtocolHandler.scala?rev=1165674&r1=1165673&r2=1165674&view=diff
==============================================================================
---
activemq/activemq-apollo/trunk/apollo-stomp/src/main/scala/org/apache/activemq/apollo/stomp/StompProtocolHandler.scala
(original)
+++
activemq/activemq-apollo/trunk/apollo-stomp/src/main/scala/org/apache/activemq/apollo/stomp/StompProtocolHandler.scala
Tue Sep 6 13:59:37 2011
@@ -138,7 +138,8 @@ class StompProtocolHandler extends Proto
override val browser:Boolean,
override val exclusive:Boolean,
val auto_delete:Boolean,
- val initial_credit_window:(Int,Int, Boolean)
+ val initial_credit_window:(Int,Int, Boolean),
+ val temp:Boolean
) extends BaseRetained with DeliveryConsumer {
//// The following comes in handy if we need to debug the
@@ -164,6 +165,10 @@ class StompProtocolHandler extends Proto
// r.release
// }
+ if( temp ) {
+ destination.foreach(_.temp_owner = connection.get.id)
+ }
+
val ack_source = createSource(new EventAggregator[(Int, Int), (Int, Int)] {
def mergeEvent(previous:(Int, Int), event:(Int, Int)) = {
if( previous == null ) {
@@ -422,7 +427,7 @@ class StompProtocolHandler extends Proto
def dispose = {
session_manager.close(downstream)
- if( auto_delete ) {
+ if( auto_delete || temp) {
reset {
val rc = host.router.delete(destination, security_context)
rc match {
@@ -1031,6 +1036,8 @@ class StompProtocolHandler extends Proto
var browser = get(headers, BROWSER).map( _ == TRUE ).getOrElse(false)
var exclusive = get(headers, EXCLUSIVE).map( _ == TRUE ).getOrElse(false)
var auto_delete = get(headers, AUTO_DELETE).map( _ == TRUE
).getOrElse(false)
+ var temp = get(headers, TEMP).map( _ == TRUE ).getOrElse(false)
+
val ack_mode = get(headers, ACK_MODE).getOrElse(ACK_MODE_AUTO)
val credit_window = get(headers, CREDIT) match {
case Some(value) =>
@@ -1088,7 +1095,7 @@ class StompProtocolHandler extends Proto
}
}
- val consumer = new StompConsumer(subscription_id, destination, ack_mode,
selector, browser, exclusive, auto_delete, credit_window);
+ val consumer = new StompConsumer(subscription_id, destination, ack_mode,
selector, browser, exclusive, auto_delete, credit_window, temp);
consumers += (id -> consumer)
reset {