2 Replies Latest reply on Nov 14, 2008 3:01 AM by Ron Sigal

    How to classify instances of InvokerCallbackHandler ?

    Daniel Travin Newbie

      Hi all,

      I have a server that pushes data to clients. Data could be classified by events and data about different events come randomly to server from the 3rd source. Client connects to server and says "I want updates for data about event=N"
      When data for event N arrives, server does iteration through all callback handlers, selects those that want to be notified about event N and invokes handleCallback on them.

      My question is what API to use when client is saying "I am intrested in event N" ?

      My suggestion is to put value into the metadata map when client calls
      Client#addListener(...)
      and get this value on the server side in ServerInvoker#handleInternalInvocation(...). In this case extension for class ServerInvoker is needed.

      Why there is no out of the box solution for this ?





        • 1. Re: How to classify instances of InvokerCallbackHandler ?
          jaikiran pai Master

          Maybe you could create multiple server invocation handlers, each serving a different "sub-system" (which can correspond to an event). The Client which does the addListener can then connect/listen to the appropriate sub-system using the following constructor:

          public Client(InvokerLocator locator, String subsystem) throws Exception


          This way, the dedicated server invocation handler will handle the appropriate clients based on the sub-system.

          • 2. Re: How to classify instances of InvokerCallbackHandler ?
            Ron Sigal Master

            Hi DanielTraven,

            "DanielTravin" wrote:

            Why there is no out of the box solution for this ?


            I guess no one ever asked for it. The fact is that Remoting 2 is no longer under active development, or I would consider adding something like that.

            However, I believe that jaikiran has given a good solution.

            By the way, I don't mean to say that Remoting 2 is not actively supported, just that new features are more likely to appear in Remoting 3.