-
1. Re: InvokerCallbackHandler.getSessionId() ?
tom.elrod Feb 23, 2007 11:11 PM (in response to fatbatman)Hi James. Not sure what you are asking for? The InvocationRequest.getSessionId() comes from when a remoting Client is created and set on the InvocationRequest when making an invocation (although user could set their own session id via the Client's setter method).
As for a session id being associated with the InvokerCallbackHandler, there really isn't one, so this is throwing me. Are you saying you want one so know from which client the callback handler originally came from? -
2. Re: InvokerCallbackHandler.getSessionId() ?
fatbatman Feb 24, 2007 1:09 PM (in response to fatbatman)Hi Tom,
Yes I'd like to know which client the InvokerCallbackHandler is from so I can send a callback to a specific client.
I'm investigating using remoting with something akin to a online chat system.
I was planning on having some kind of custom login method, in which I would get the InvocationRequest.getSessionId() and link it to the username. I'd then like to link the InvokerCallbackHandler to that username also, so its possilbe to send a callback to a specific user.
For example if user1 wants to send a chat message to user2 only.
If there is some other best practice for this kind of situation please let me know.
Thanks, James -
3. Re: InvokerCallbackHandler.getSessionId() ?
ron_sigal Feb 27, 2007 6:17 PM (in response to fatbatman)Hi James,
I think the reason your initial question was a bit ambiguous (besides the fact that addListener() isn't a method of InvokerCallbackHandler) might have been that, on the client side, an InvokerCallbackHandler can be reused by many Clients and callback Connectors, so it's not associated with a particular Client.
On the server side, however, when the addListener() method is called on your ServerInvocationHandler, the InvokerCallbackHandler that gets passed *is* associated with a particular call to Client.addListener(). You can get the sessionId of that Client by casting the InvokerCallbackHandler to org.jboss.remoting.callback.ServerInvokerCallbackHandler and calling its method getClientSessionId().
Hope that helps. -
4. Re: InvokerCallbackHandler.getSessionId() ?
fatbatman Mar 1, 2007 6:57 PM (in response to fatbatman)Hi Ron,
ServerInvokerCallbackHandler.getClientSessionId() is exactly what I was looking for.
Many thanks to both of you
James