Content deleted Content added
m fixing Javadoc:SE usage |
→Example: Order was confusing. |
||
Line 19:
==Example==
The following classes implement a simple client-server program using RMI that displays a message.
'''<code>RmiServerIntf</code> interface''' — defines the interface that is used by the client and implemented by the server.▼
<syntaxhighlight lang=java>▼
import java.rmi.Remote;▼
import java.rmi.RemoteException;▼
public interface RmiServerIntf extends Remote {▼
String getMessage() throws RemoteException;▼
}▼
</syntaxhighlight>▼
'''<code>RmiServer</code> class''' — listens to RMI requests and implements the interface which is used by the client to invoke remote methods.
Line 57 ⟶ 68:
System.out.println("PeerServer bound in registry");
}
▲}
▲</syntaxhighlight>
▲'''<code>RmiServerIntf</code> interface''' — defines the interface that is used by the client and implemented by the server.
▲<syntaxhighlight lang=java>
▲import java.rmi.Remote;
▲import java.rmi.RemoteException;
▲public interface RmiServerIntf extends Remote {
▲ String getMessage() throws RemoteException;
}
</syntaxhighlight>
|