[jboss-cvs] JBossRemoting/src/main/org/jboss/remoting/callback ...
Ron Sigal
ron_sigal at yahoo.com
Tue Nov 21 01:56:47 EST 2006
User: rsigal
Date: 06/11/21 01:56:47
Modified: src/main/org/jboss/remoting/callback Tag: remoting_2_x
ServerInvokerCallbackHandler.java
Log:
JBREM-636: init() stores the sessionId and listenerId for future reference, so that getId() does not have to refer to the initial InvocationRequest.
Revision Changes Path
No revision
No revision
1.15.2.3 +17 -17 JBossRemoting/src/main/org/jboss/remoting/callback/ServerInvokerCallbackHandler.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: ServerInvokerCallbackHandler.java
===================================================================
RCS file: /cvsroot/jboss/JBossRemoting/src/main/org/jboss/remoting/callback/ServerInvokerCallbackHandler.java,v
retrieving revision 1.15.2.2
retrieving revision 1.15.2.3
diff -u -b -r1.15.2.2 -r1.15.2.3
--- ServerInvokerCallbackHandler.java 16 Nov 2006 16:54:18 -0000 1.15.2.2
+++ ServerInvokerCallbackHandler.java 21 Nov 2006 06:56:47 -0000 1.15.2.3
@@ -65,6 +65,7 @@
private Client callBackClient;
private ArrayList callbacks = new ArrayList();
private String sessionId;
+ private String listenerId;
private String clientSessionId;
private InvokerLocator serverLocator;
@@ -137,7 +138,16 @@
private void init(InvocationRequest invocation, ServerInvoker owner) throws Exception
{
clientSessionId = invocation.getSessionId();
- sessionId = getId(invocation);
+ sessionId = invocation.getSessionId();
+ Map metadata = invocation.getRequestPayload();
+ if(metadata != null)
+ {
+ listenerId = (String) metadata.get(Client.LISTENER_ID_KEY);
+ if(listenerId != null)
+ {
+ sessionId = sessionId + "+" + listenerId;
+ }
+ }
if(invocation.getLocator() != null)
{
Map clientConfig = new HashMap();
@@ -482,7 +492,7 @@
*/
public String getId()
{
- return getId(invocation);
+ return sessionId;
}
public List getCallbacks()
@@ -609,7 +619,7 @@
}
else
{
- Object o = returnPayload.get(REMOTING_ACKNOWLEDGES_PUSH_CALLBACKS);
+ Object o = returnPayload.remove(REMOTING_ACKNOWLEDGES_PUSH_CALLBACKS);
if (o instanceof String && Boolean.valueOf((String)o).booleanValue() ||
o instanceof Boolean && ((Boolean)o).booleanValue())
handleAcknowledgement = true;
@@ -705,10 +715,6 @@
if (listenerObject instanceof CallbackListener)
{
- Map metadata = invocation.getRequestPayload();
- if(metadata != null)
- {
- String listenerId = (String) metadata.get(Client.LISTENER_ID_KEY);
if(listenerId != null)
{
returnPayload.put(Client.LISTENER_ID_KEY, listenerId);
@@ -723,12 +729,6 @@
}
else
{
- log.error("LISTENER_ID_KEY is null: unable to acknowledge callback");
- return null;
- }
- }
- else
- {
log.error("callback preprocess listener has wrong type: " + listenerObject);
return null;
}
More information about the jboss-cvs-commits
mailing list