O'Reilly logo

J2EE™ and Beyond: Design, Develop, and Deploy World-Class Java™ Software by Art Taylor

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Using RMI Callbacks

Most remote object invocations use one-way invocation; the client obtains a remote object reference and makes calls on the methods of that remote reference. But sometimes it is convenient to provide two-way communication with a server object, allowing a client to make a call on a server object and having the server object respond to the client using a callback method. An efficient implementation of such a remote server would use internal multithreading to manage the clients. The following example demonstrates such an approach.

In this example we have a client application that would like to monitor orders as they are shipped. To implement this solution, we will register the client applications with the server to receive status ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required