March 2002
Intermediate to advanced
496 pages
11h 44m
English
The RMI server is responsible for creating an instance of a service implementation and then registering it with the remote method invocation registry (rmiregistry). This actually amounts to only a few lines of code, and is extremely easy to do. In small systems, the server could even be combined with the service implementation by adding a main() method for this purpose, though a separation of classes is a cleaner design.
import java.rmi.*; import java.rmi.server.*; // Chapter 11, Listing 3 public class LightBulbServer { public static void main(String args[]) { System.out.println ("Loading RMI service"); try { // Load the service RMILightBulbImpl bulbService = new RMILightBulbImpl(); // Examine ...Read now
Unlock full access