summaryrefslogtreecommitdiff
path: root/java/common
diff options
context:
space:
mode:
authorKim van der Riet <kpvdr@apache.org>2007-01-15 19:59:11 +0000
committerKim van der Riet <kpvdr@apache.org>2007-01-15 19:59:11 +0000
commit4c70be2495bd94eba1720c9603b3f0bddb99ffd9 (patch)
treee5a9779e24aa70d9322db5695845b8f316259456 /java/common
parent4221f261d756db2d68376e84d6be374f1ddcb9e6 (diff)
downloadqpid-python-4c70be2495bd94eba1720c9603b3f0bddb99ffd9.tar.gz
Added a request/response id to the MethodEvent class that is used to dispatch incoming messages to the handlers. Corrected some compile errors.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/branches/qpid.0-9@496456 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/common')
-rw-r--r--java/common/src/main/java/org/apache/qpid/framing/ResponseManager.java2
-rw-r--r--java/common/src/main/java/org/apache/qpid/protocol/AMQMethodEvent.java17
2 files changed, 13 insertions, 6 deletions
diff --git a/java/common/src/main/java/org/apache/qpid/framing/ResponseManager.java b/java/common/src/main/java/org/apache/qpid/framing/ResponseManager.java
index bfc0eb84de..5b34c11d11 100644
--- a/java/common/src/main/java/org/apache/qpid/framing/ResponseManager.java
+++ b/java/common/src/main/java/org/apache/qpid/framing/ResponseManager.java
@@ -111,7 +111,7 @@ public class ResponseManager
lastReceivedRequestId = requestId;
responseMap.put(requestId, new ResponseStatus(requestId));
// TODO: Update MethodEvent to use the RequestBody instead of MethodBody
- AMQMethodEvent methodEvent = new AMQMethodEvent(channel, requestBody.getMethodPayload());
+ AMQMethodEvent methodEvent = new AMQMethodEvent(channel, requestBody.getMethodPayload(), requestId);
methodListener.methodReceived(methodEvent);
}
diff --git a/java/common/src/main/java/org/apache/qpid/protocol/AMQMethodEvent.java b/java/common/src/main/java/org/apache/qpid/protocol/AMQMethodEvent.java
index ab36041cb8..c42e49d7c8 100644
--- a/java/common/src/main/java/org/apache/qpid/protocol/AMQMethodEvent.java
+++ b/java/common/src/main/java/org/apache/qpid/protocol/AMQMethodEvent.java
@@ -36,13 +36,14 @@ import org.apache.qpid.framing.AMQMethodBody;
public class AMQMethodEvent<M extends AMQMethodBody>
{
private final M _method;
-
private final int _channelId;
+ private final long _requestResponseId;
- public AMQMethodEvent(int channelId, M method)
+ public AMQMethodEvent(int channelId, M method, long requestResponseId)
{
_channelId = channelId;
_method = method;
+ _requestResponseId = requestResponseId;
}
public M getMethod()
@@ -55,11 +56,17 @@ public class AMQMethodEvent<M extends AMQMethodBody>
return _channelId;
}
+ public long getRequestResponseId()
+ {
+ return _requestResponseId;
+ }
+
public String toString()
{
- StringBuilder buf = new StringBuilder("Method event: ");
- buf.append("\nChannel id: ").append(_channelId);
- buf.append("\nMethod: ").append(_method);
+ StringBuilder buf = new StringBuilder("Method event: \n");
+ buf.append("Channel id: \n").append(_channelId);
+ buf.append("Method: \n").append(_method);
+ buf.append("Request/Response Id: ").append(_requestResponseId);
return buf.toString();
}
}