summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Gemmell <robbie@apache.org>2011-02-04 16:14:46 +0000
committerRobert Gemmell <robbie@apache.org>2011-02-04 16:14:46 +0000
commit6741e34eb4f223a5f6c4cc33c7c603a2ba0b015b (patch)
tree4350df4c2f84701581453781425faf689fa7e008
parente46939c93ba0682d74f025eeec7bdb88229b4277 (diff)
downloadqpid-python-6741e34eb4f223a5f6c4cc33c7c603a2ba0b015b.tar.gz
QPID-3021: ensure the connection actor is used for connection control events regardless of a particular sessions existence
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1067208 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--java/broker/src/main/java/org/apache/qpid/server/transport/ServerConnection.java20
-rw-r--r--java/common/Composite.tpl8
-rw-r--r--java/common/src/main/java/org/apache/qpid/transport/ProtocolError.java5
-rw-r--r--java/common/src/main/java/org/apache/qpid/transport/ProtocolEvent.java1
-rw-r--r--java/common/src/main/java/org/apache/qpid/transport/ProtocolHeader.java5
5 files changed, 33 insertions, 6 deletions
diff --git a/java/broker/src/main/java/org/apache/qpid/server/transport/ServerConnection.java b/java/broker/src/main/java/org/apache/qpid/server/transport/ServerConnection.java
index d8b7c2e80e..d2addfde0c 100644
--- a/java/broker/src/main/java/org/apache/qpid/server/transport/ServerConnection.java
+++ b/java/broker/src/main/java/org/apache/qpid/server/transport/ServerConnection.java
@@ -149,15 +149,23 @@ public class ServerConnection extends Connection implements AMQConnectionModel,
@Override
public void received(ProtocolEvent event)
{
- ServerSession channel = (ServerSession) getSession(event.getChannel());
- LogActor channelActor = null;
-
- if (channel != null)
+ if (event.isConnectionControl())
+ {
+ CurrentActor.set(_actor);
+ }
+ else
{
- channelActor = channel.getLogActor();
+ ServerSession channel = (ServerSession) getSession(event.getChannel());
+ LogActor channelActor = null;
+
+ if (channel != null)
+ {
+ channelActor = channel.getLogActor();
+ }
+
+ CurrentActor.set(channelActor == null ? _actor : channelActor);
}
- CurrentActor.set(channelActor == null ? _actor : channelActor);
try
{
super.received(event);
diff --git a/java/common/Composite.tpl b/java/common/Composite.tpl
index 97b7d01f3c..350dd893c8 100644
--- a/java/common/Composite.tpl
+++ b/java/common/Composite.tpl
@@ -44,6 +44,8 @@ cls = klass(type)["@name"]
segments = type["segments"]
+connectioncontrol="false"
+
if type.name in ("control", "command"):
base = "Method"
size = 0
@@ -54,6 +56,7 @@ if type.name in ("control", "command"):
payload = "false"
if type.name == "control" and cls == "connection":
track = "Frame.L1"
+ connectioncontrol="true"
elif cls == "session" and type["@name"] in ("attach", "attached", "detach", "detached"):
track = "Frame.L2"
elif type.name == "command":
@@ -100,6 +103,11 @@ public final class $name extends $base {
return $track;
}
+ public final boolean isConnectionControl()
+ {
+ return $connectioncontrol;
+ }
+
${
if pack > 0:
diff --git a/java/common/src/main/java/org/apache/qpid/transport/ProtocolError.java b/java/common/src/main/java/org/apache/qpid/transport/ProtocolError.java
index bd6ab81997..8a5edc302e 100644
--- a/java/common/src/main/java/org/apache/qpid/transport/ProtocolError.java
+++ b/java/common/src/main/java/org/apache/qpid/transport/ProtocolError.java
@@ -60,6 +60,11 @@ public final class ProtocolError implements NetworkEvent, ProtocolEvent
return track;
}
+ public boolean isConnectionControl()
+ {
+ return false;
+ }
+
public String getMessage()
{
return String.format(format, args);
diff --git a/java/common/src/main/java/org/apache/qpid/transport/ProtocolEvent.java b/java/common/src/main/java/org/apache/qpid/transport/ProtocolEvent.java
index 60234c1537..b51a540701 100644
--- a/java/common/src/main/java/org/apache/qpid/transport/ProtocolEvent.java
+++ b/java/common/src/main/java/org/apache/qpid/transport/ProtocolEvent.java
@@ -37,4 +37,5 @@ public interface ProtocolEvent
<C> void delegate(C context, ProtocolDelegate<C> delegate);
+ boolean isConnectionControl();
}
diff --git a/java/common/src/main/java/org/apache/qpid/transport/ProtocolHeader.java b/java/common/src/main/java/org/apache/qpid/transport/ProtocolHeader.java
index 00ea55ff96..e5b93e40a9 100644
--- a/java/common/src/main/java/org/apache/qpid/transport/ProtocolHeader.java
+++ b/java/common/src/main/java/org/apache/qpid/transport/ProtocolHeader.java
@@ -88,6 +88,11 @@ public final class ProtocolHeader implements NetworkEvent, ProtocolEvent
return Frame.L1;
}
+ public boolean isConnectionControl()
+ {
+ return false;
+ }
+
public ByteBuffer toByteBuffer()
{
ByteBuffer buf = ByteBuffer.allocate(8);