Java Reference
In-Depth Information
RMI-based solutions have several key components:
RMI client application : This runs within the client's JVM. Supporting the RMI client
application is the Java Remote Method Protocol ( JRMP). 1
RMI registry : Maintained by the application server, this provides object discovery
to RMI clients.
RMI server : Hosted by the application server's JVM, this is responsible for executing
remote objects.
Web server : This is responsible for serving new code to the RMI client application.
You build a distributed application using RMI as you would any other Java application:
through interfaces and classes. In your distributed application, some objects are remotable
that is, you can invoke a remotable object's methods across JVMs through the protocol pro-
vided by the RMI. You gain references to these objects using the RMI registry running on a
well-known server; the registry returns a stub that implements the methods provided by the
remote object. Under the hood, a remote object isn't the same as a local object; instead, it's
a proxy, implementing network interfaces that communicate with the remote JVM's
instance of the object. Stub objects implement the same interface that the remote object
implements, meaning that it can be cast to any of the objects implementable by the remote
object. Figure 11-2 shows this relationship; the remote object is the solid circle in the RMI
server, and the stub is the dotted circle in the RMI client.
Figure 11-2. The relationship between remote and local objects in the RMI implementation
1.
Other protocols, such as the Java RMI over Internet Inter-Orb Protocol (RMI-IIOP), as well as proprietary
implementations can support RMI; these are not supported by the CDC and are not discussed here.
 
Search WWH ::




Custom Search