[jboss-user] [JBoss Remoting] - Re: Can I get CallbackHandleObject on server side

Ron Sigal do-not-reply at jboss.com
Thu Apr 21 14:48:18 EDT 2011


Ron Sigal [http://community.jboss.org/people/ron_sigal] created the discussion

"Re: Can I get CallbackHandleObject on server side"

To view the discussion, visit: http://community.jboss.org/message/601523#601523

--------------------------------------------------------------
Hi Dimitri,

The callbackHandleObject is used only on the client side.  Here's something you can try.  Instead of calling the Client method

   public void addListener(InvokerCallbackHandler callbackHandler,
                           InvokerLocator clientLocator, Object callbackHandlerObject);

use

   public void addListener(InvokerCallbackHandler callbackhandler, Map metadata,
                           Object callbackHandlerObject) throws Throwable;

and put some identifying information in the metadata map:

  HashMap metadata = new HashMap();
  metadata.put("key", "tag");
  client.addListener(..., metadata, ...);

Then on the server side, in your ServerInvocationHandler method

   public void addListener(InvokerCallbackHandler callbackHandler);

do something like

  ServerInvokerCallbackHandler serverInvokerCallbackHandler = (ServerInvokerCallbackHandler) callbackHandler;
  Client callbackClient = serverInvokerCallbackHandler.getCallbackClient();
  Map config = callbackClient.getConfiguration();
  String tag = config.get("key");

I haven't tested it, but it looks plausible.  By the way, thanks for the reference to that article.  I never heard of it before.

Good luck,
Ron
--------------------------------------------------------------

Reply to this message by going to Community
[http://community.jboss.org/message/601523#601523]

Start a new discussion in JBoss Remoting at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2050]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20110421/c6ea95e1/attachment-0001.html 


More information about the jboss-user mailing list