









Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!










2
3
7
8
9
13
14
15
16
19
interface Server extends Remote { Connection logon(String name, Client c) throws RemoteException; } 20
interface Connection extends Remote { / Say to everyone / void say(String msg) throws RemoteException; / ** Say to one person / void say(String who, String msg) throws RemoteException; String [] who() throws RemoteException; void logoff() throws RemoteException; }
21
interface Client extends Remote { void said(String who, String msg) throws RemoteException; void whoChanged(String [] who) throws RemoteException; } 22
ServerImpl Server s = new ServerImpl(); Hosted Remote Objects s
Object added to table because it implements extension of Remote interface
25
Server s = (Server) Naming.lookup (“//host/ChatServer”); s ServerImpl Stub Hosted Remote Objects ServerImpl
ChatServer ServerImpl Stub lookup returns stub 26
ClientImpl Hosted Remote Objects c s ServerImpl Stub Hosted Remote Objects ServerImpl
27
Connection conn = s.logon(“Bill”, c); s ServerImpl Stub
Stub code for remote logon call String “Bill” Stub for c Method: logon … to server process logon c ClientImpl 28
(Skeleton) code for remote logon call String “Bill” Stub for c Method: logon … from client process Hosted Remote Objects ServerImpl “Bill” ClientImpl Stub c unmarshalled arguments
31
s ServerImpl Stub
Stub code for remote logon call Stub for conn Return value: … from server process logon Conn Stub conn unmarshalled return value 32
33
grant { permission java.net.SocketPermission “: 1024-65535”, “connect,accept”; permission java.net.SocketPermission “:80”, “connect”; };**