May 2001
Intermediate to advanced
1088 pages
30h 13m
English
To implement a remote object, you must create a class that is a subclass of java.rmi. server.UnicastRemoteObject and implements one or more remote methods. You must write the implementation for the remote methods yourself, of course.
The main method of the server (the main doesn't need to be in the same class) must do one peculiar thing—it must set up a security manager like this:
if (System.getSecurityManager() == null)
{
System.setSecurityManager(new RMISecurityManager());
}
Because of the way RMI can pass objects back and forth and perform dynamic class loading, you need a special security manager to make sure someone doesn't send you a bogus class file.
To activate your remote object (i.e. make it available ...
Read now
Unlock full access