Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Event messaging between remote systems is a bit tricky. Here's what has to happen:</p> <ul> <li><p>The client must register interest in the events fired on the server side. To register, the client must be remotely available to the event source object.</p></li> <li><p>In order to be able the register, the client must find the server to begin with, so the server object must be remotely available to the client.</p></li> </ul> <p>Ick, right? And that's the simple <a href="http://www.javaranch.com/patterns/" rel="nofollow">pattern</a> for implementing remote event handling. A few weeks ago I started a tutorial that was heade down this path -- it's right here, and I'm hoping to add something to it before the end of the week. Alas, the need to make the rent has interfered and I'm not able to add to it as quickly as I'd like. If you can't wait, however, that's the key: both sides have to be remotely available for the messaging system to work. </p> <p>that server as well as the client must be remote objects.</p> <p>Let all clients implement a Remote interface.</p> <pre><code>RemoteClientIfc extends Remote { void inform(); } //have a remote method register() on the *Server* object which accepts RemoteClientIfc. //c'd be something like this... register(RemoteClientIfc client){ arrayListofClients.add(client); } //So client will do a look up on the remote server object and register itself. remoteObj.register(clientInstance); //In the remote server you //can probably have another method to send notifications to the client. //Run through the ArrayList and call //inform() on each of them. //Thus the client will receive notification. tellClients(){ Iterator i = .... while (i.hasNext()){ ((RemoteClientIfc).i.next()).inform(); } } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload