Remote Interfaces, Objects, and Methods
by, 07-07-2012 at 05:18 PM (664 Views)
Distributed applications are madeup of classes and interfaces, just the way all other Java applications are made. Methods are declared by the interfaces. Methods which have been declared are implemented by the classes. Perhaps, an additional method would also be declared. In distributed applications certain implementations are present in Java virtual machines, however others are not. Objects along with method which could possibly be invoked are known to be the remote objects.
When a remote interface is implemented, object would become remote that would be having these given characteristics.
• java.rmi.Remote interface is extended by the remote interface.
• Interface’s each method would be declaring the java.rmi.RemoteException, in throw clause.
Remote object and non remote objects are treated differently by RMI when objects are passed on from one of the Java Virtual machine towards some other. Instead of making one implementation object copy in Java virtual machine, remote stub is passed by RMI for the remote object. Stub would be playing role of the local representative or proxy for the remote objects. At local stub, methods are invoked by the client who is responsible to carry out the invocations at remote objects.