Re: Remote Observer

Gregg Wonderly <[email protected]>
Newsgroups gmane.comp.java.sun.rmi
Message-ID <[email protected]>
Niclas Hedhman wrote:
> On Thursday 25 August 2005 02:45, McLain, Jesse wrote:
>
>>Can anyone tell me how to implement the Remote Observer pattern? What
>>I'm trying for is an RMI server that will serve as Observable, and RMI
>>client apps that will observe it. An example would be excellent.
>
>
> At first the task seems simple. The client observer class implements a
> RemoteObserver interface and exports a stub which it passes to the "server".
...
> And such subject is larger than I have energy to discuss here. There is a
> specification around Remote Events, being part of Jini which may contain
> discussions around this topic.

There are two types of event transport typically used with remote observation.  The remote observable might push events
back to the observer via callbacks, or a streaming network connection.  The observer might also poll the observable to
more quickly recognize that data is not flowing.

In high up time environments, there are periodic 'health check' events that are required to make sure both ends of a
communications path are present.  With a streaming socket connection, you might use keepalive as one health check
activity.  But, you'd need to use an NIO channel with notifications to asynchrously see the socket shutdown and know
that there was a problem.

What I did in one application was have the observable push incremental changes to the client as they occured, over a
socket as an Object*Stream that includes a high water mark and automatic throttling if the observer is not handling data
fast enough.  The Observer, would also make a periodic remote call to the observable to collect a composite view of the
state to catchup in case of lost events.

Gregg Wonderly

===========================================================================
To unsubscribe, send email to [email protected] and include in the body
of the message "signoff RMI-USERS".  For general help, send email to
[email protected] and include in the body of the message "help".

For a list of frequently asked RMI questions please refer to:
http://java.sun.com/j2se/1.3/docs/guide/rmi/faq.html

To view past RMI-USERS postings, please see:
http://archives.java.sun.com/archives/rmi-users.html
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.