Global Positioning System Reference
In-Depth Information
3. createRuntimeRegistry(intport) : Creating a registry externally
from the command line is usually the best choice, since client and
server can be run and killed independently. On the other hand, it is
very convenient (during development) to create a registry from the
Java program. The important difference is that the registry only runs
as long as the initiating JVM is alive.
The method first looks for an external registry running on the
localhost , allocates it, or creates one for the runtime of the Java
program.
The programmer does not need to differentiate between
the two.
4. getHost() : Helper method, if a rmiRegistry is set.
5. getPort() : Helper method, if a rmiRegistry is set.
6. getRmiURL() : Helper method, if a rmiRegistry is set.
7. getLocalhostName() : Helper method.
8. getLocalhostAddress() : Helper method.
9. exportAsRemoteObject(RemoteremoteImplementation) : Using this
method, all real objects only need to implement a Remote interface
plus the methods to be invoked remotely. Thus, the programmer is
not confused by extending the UnicastRemoteObject .
10. unexportRemoteObject(RemoteremoteImplementation) : The method
reverses the export and should be used to withdraw the remote avail-
ability and before shutting down the application in a clean way.
11. registerRemoteObject(Stringname,RemoteremoteObject) : Before
a remote object can be addressed on a registry, it has to be bound to
it, or published under a certain name.
12. RemotelookupRMIURL(StringRMIURL) : Finally, after the remote ob-
ject is exported and registered, it can be looked up by a client. The
RMI URL conveniently combines host, port, and published name of
the remote object.
 
Search WWH ::




Custom Search