distributed computing - homework 4: rmi-based...
TRANSCRIPT
![Page 1: Distributed Computing - Homework 4: RMI-based Chatiao.hfuu.edu.cn/.../distributed_computing/hw04_rmi_chat.pdfRMICallbacks • RMI is a technology for building distributed applications](https://reader033.vdocuments.net/reader033/viewer/2022042008/5e70da685107610abf4669a3/html5/thumbnails/1.jpg)
Distributed ComputingHomework 4: RMI-based Chat
Thomas Weise · 汤卫思
[email protected] · http://www.it-weise.de
Hefei University, South Campus 2 合肥学院 南艳湖校区/南2区Faculty of Computer Science and Technology 计算机科学与技术系
Institute of Applied Optimization 应用优化研究所
230601 Shushan District, Hefei, Anhui, China 中国 安徽省 合肥市 蜀山区 230601Econ. & Tech. Devel. Zone, Jinxiu Dadao 99 经济技术开发区 锦绣大道99号
![Page 2: Distributed Computing - Homework 4: RMI-based Chatiao.hfuu.edu.cn/.../distributed_computing/hw04_rmi_chat.pdfRMICallbacks • RMI is a technology for building distributed applications](https://reader033.vdocuments.net/reader033/viewer/2022042008/5e70da685107610abf4669a3/html5/thumbnails/2.jpg)
Outline
1 RMI Chat
2 Homework
Distributed Computing Thomas Weise 2/10
website
![Page 3: Distributed Computing - Homework 4: RMI-based Chatiao.hfuu.edu.cn/.../distributed_computing/hw04_rmi_chat.pdfRMICallbacks • RMI is a technology for building distributed applications](https://reader033.vdocuments.net/reader033/viewer/2022042008/5e70da685107610abf4669a3/html5/thumbnails/3.jpg)
Overview
• Use Java RMI [1–3]
• Implement a RMI server for chat
Distributed Computing Thomas Weise 3/10
![Page 4: Distributed Computing - Homework 4: RMI-based Chatiao.hfuu.edu.cn/.../distributed_computing/hw04_rmi_chat.pdfRMICallbacks • RMI is a technology for building distributed applications](https://reader033.vdocuments.net/reader033/viewer/2022042008/5e70da685107610abf4669a3/html5/thumbnails/4.jpg)
Events and Model-View-Controler
• Many UIs are designed according to the Model-View-Controller (orModel-Delegate) pattern [4–7]
Distributed Computing Thomas Weise 4/10
![Page 5: Distributed Computing - Homework 4: RMI-based Chatiao.hfuu.edu.cn/.../distributed_computing/hw04_rmi_chat.pdfRMICallbacks • RMI is a technology for building distributed applications](https://reader033.vdocuments.net/reader033/viewer/2022042008/5e70da685107610abf4669a3/html5/thumbnails/5.jpg)
Events and Model-View-Controler
• Many UIs are designed according to the Model-View-Controller (orModel-Delegate) pattern [4–7]
• Some underlying process or model manages a state
Distributed Computing Thomas Weise 4/10
![Page 6: Distributed Computing - Homework 4: RMI-based Chatiao.hfuu.edu.cn/.../distributed_computing/hw04_rmi_chat.pdfRMICallbacks • RMI is a technology for building distributed applications](https://reader033.vdocuments.net/reader033/viewer/2022042008/5e70da685107610abf4669a3/html5/thumbnails/6.jpg)
Events and Model-View-Controler
• Many UIs are designed according to the Model-View-Controller (orModel-Delegate) pattern [4–7]
• Some underlying process or model manages a state
• Views display the state of the model
Distributed Computing Thomas Weise 4/10
![Page 7: Distributed Computing - Homework 4: RMI-based Chatiao.hfuu.edu.cn/.../distributed_computing/hw04_rmi_chat.pdfRMICallbacks • RMI is a technology for building distributed applications](https://reader033.vdocuments.net/reader033/viewer/2022042008/5e70da685107610abf4669a3/html5/thumbnails/7.jpg)
Events and Model-View-Controler
• Many UIs are designed according to the Model-View-Controller (orModel-Delegate) pattern [4–7]
• Some underlying process or model manages a state
• Views display the state of the model
• Views are updated by receiving events
Distributed Computing Thomas Weise 4/10
![Page 8: Distributed Computing - Homework 4: RMI-based Chatiao.hfuu.edu.cn/.../distributed_computing/hw04_rmi_chat.pdfRMICallbacks • RMI is a technology for building distributed applications](https://reader033.vdocuments.net/reader033/viewer/2022042008/5e70da685107610abf4669a3/html5/thumbnails/8.jpg)
Events and Model-View-Controler
• Many UIs are designed according to the Model-View-Controller (orModel-Delegate) pattern [4–7]
• Some underlying process or model manages a state
• Views display the state of the model
• Views are updated by receiving events
• Events usually encapsulated in objects
Distributed Computing Thomas Weise 4/10
![Page 9: Distributed Computing - Homework 4: RMI-based Chatiao.hfuu.edu.cn/.../distributed_computing/hw04_rmi_chat.pdfRMICallbacks • RMI is a technology for building distributed applications](https://reader033.vdocuments.net/reader033/viewer/2022042008/5e70da685107610abf4669a3/html5/thumbnails/9.jpg)
Events and Model-View-Controler
• Many UIs are designed according to the Model-View-Controller (orModel-Delegate) pattern [4–7]
• Some underlying process or model manages a state
• Views display the state of the model
• Views are updated by receiving events
• Events usually encapsulated in objects
• Views implement certain callback interfaces, i.e., have methods thatcan process events
Distributed Computing Thomas Weise 4/10
![Page 10: Distributed Computing - Homework 4: RMI-based Chatiao.hfuu.edu.cn/.../distributed_computing/hw04_rmi_chat.pdfRMICallbacks • RMI is a technology for building distributed applications](https://reader033.vdocuments.net/reader033/viewer/2022042008/5e70da685107610abf4669a3/html5/thumbnails/10.jpg)
Events and Model-View-Controler
• Many UIs are designed according to the Model-View-Controller (orModel-Delegate) pattern [4–7]
• Some underlying process or model manages a state
• Views display the state of the model
• Views are updated by receiving events
• Events usually encapsulated in objects
• Views implement certain callback interfaces, i.e., have methods thatcan process events
• Java is full of this, just google for ActionListener , MouseListener ,TableModelListener , VetoableChangeListener , . . .
Distributed Computing Thomas Weise 4/10
![Page 11: Distributed Computing - Homework 4: RMI-based Chatiao.hfuu.edu.cn/.../distributed_computing/hw04_rmi_chat.pdfRMICallbacks • RMI is a technology for building distributed applications](https://reader033.vdocuments.net/reader033/viewer/2022042008/5e70da685107610abf4669a3/html5/thumbnails/11.jpg)
RMI Callbacks
• RMI is a technology for building distributed applications
Distributed Computing Thomas Weise 5/10
![Page 12: Distributed Computing - Homework 4: RMI-based Chatiao.hfuu.edu.cn/.../distributed_computing/hw04_rmi_chat.pdfRMICallbacks • RMI is a technology for building distributed applications](https://reader033.vdocuments.net/reader033/viewer/2022042008/5e70da685107610abf4669a3/html5/thumbnails/12.jpg)
RMI Callbacks
• RMI is a technology for building distributed applications
• A server object is registered in a naming service( java.rmi.registry.Registry )
Distributed Computing Thomas Weise 5/10
![Page 13: Distributed Computing - Homework 4: RMI-based Chatiao.hfuu.edu.cn/.../distributed_computing/hw04_rmi_chat.pdfRMICallbacks • RMI is a technology for building distributed applications](https://reader033.vdocuments.net/reader033/viewer/2022042008/5e70da685107610abf4669a3/html5/thumbnails/13.jpg)
RMI Callbacks
• RMI is a technology for building distributed applications
• A server object is registered in a naming service( java.rmi.registry.Registry )
• Object functionality is provided via interfaces
Distributed Computing Thomas Weise 5/10
![Page 14: Distributed Computing - Homework 4: RMI-based Chatiao.hfuu.edu.cn/.../distributed_computing/hw04_rmi_chat.pdfRMICallbacks • RMI is a technology for building distributed applications](https://reader033.vdocuments.net/reader033/viewer/2022042008/5e70da685107610abf4669a3/html5/thumbnails/14.jpg)
RMI Callbacks
• RMI is a technology for building distributed applications
• A server object is registered in a naming service( java.rmi.registry.Registry )
• Object functionality is provided via interfaces
• The server side implements the functionality with a ‘real’ class
Distributed Computing Thomas Weise 5/10
![Page 15: Distributed Computing - Homework 4: RMI-based Chatiao.hfuu.edu.cn/.../distributed_computing/hw04_rmi_chat.pdfRMICallbacks • RMI is a technology for building distributed applications](https://reader033.vdocuments.net/reader033/viewer/2022042008/5e70da685107610abf4669a3/html5/thumbnails/15.jpg)
RMI Callbacks
• RMI is a technology for building distributed applications
• A server object is registered in a naming service( java.rmi.registry.Registry )
• Object functionality is provided via interfaces
• The server side implements the functionality with a ‘real’ class
• The client side automatically creates a proxy instance of the objectthat forwards all calls to the server
Distributed Computing Thomas Weise 5/10
![Page 16: Distributed Computing - Homework 4: RMI-based Chatiao.hfuu.edu.cn/.../distributed_computing/hw04_rmi_chat.pdfRMICallbacks • RMI is a technology for building distributed applications](https://reader033.vdocuments.net/reader033/viewer/2022042008/5e70da685107610abf4669a3/html5/thumbnails/16.jpg)
RMI Callbacks
• RMI is a technology for building distributed applications
• A server object is registered in a naming service( java.rmi.registry.Registry )
• Object functionality is provided via interfaces
• The server side implements the functionality with a ‘real’ class
• The client side automatically creates a proxy instance of the objectthat forwards all calls to the server
• In Java RMI, we can also create callback objects
Distributed Computing Thomas Weise 5/10
![Page 17: Distributed Computing - Homework 4: RMI-based Chatiao.hfuu.edu.cn/.../distributed_computing/hw04_rmi_chat.pdfRMICallbacks • RMI is a technology for building distributed applications](https://reader033.vdocuments.net/reader033/viewer/2022042008/5e70da685107610abf4669a3/html5/thumbnails/17.jpg)
RMI Callbacks
• RMI is a technology for building distributed applications
• A server object is registered in a naming service( java.rmi.registry.Registry )
• Object functionality is provided via interfaces
• The server side implements the functionality with a ‘real’ class
• The client side automatically creates a proxy instance of the objectthat forwards all calls to the server
• In Java RMI, we can also create callback objects
• These inherit from java.rmi.server.UnicastRemoteObject and
implement a callback interface derived from java.rmi.Remote
Distributed Computing Thomas Weise 5/10
![Page 18: Distributed Computing - Homework 4: RMI-based Chatiao.hfuu.edu.cn/.../distributed_computing/hw04_rmi_chat.pdfRMICallbacks • RMI is a technology for building distributed applications](https://reader033.vdocuments.net/reader033/viewer/2022042008/5e70da685107610abf4669a3/html5/thumbnails/18.jpg)
RMI Callbacks
• RMI is a technology for building distributed applications
• A server object is registered in a naming service( java.rmi.registry.Registry )
• Object functionality is provided via interfaces
• The server side implements the functionality with a ‘real’ class
• The client side automatically creates a proxy instance of the objectthat forwards all calls to the server
• In Java RMI, we can also create callback objects
• These inherit from java.rmi.server.UnicastRemoteObject and
implement a callback interface derived from java.rmi.Remote
• They can be passed to an RMI server without needing to beregistered in a registry
Distributed Computing Thomas Weise 5/10
![Page 19: Distributed Computing - Homework 4: RMI-based Chatiao.hfuu.edu.cn/.../distributed_computing/hw04_rmi_chat.pdfRMICallbacks • RMI is a technology for building distributed applications](https://reader033.vdocuments.net/reader033/viewer/2022042008/5e70da685107610abf4669a3/html5/thumbnails/19.jpg)
RMI Callbacks
• RMI is a technology for building distributed applications
• A server object is registered in a naming service( java.rmi.registry.Registry )
• Object functionality is provided via interfaces
• The server side implements the functionality with a ‘real’ class
• The client side automatically creates a proxy instance of the objectthat forwards all calls to the server
• In Java RMI, we can also create callback objects
• These inherit from java.rmi.server.UnicastRemoteObject and
implement a callback interface derived from java.rmi.Remote
• They can be passed to an RMI server without needing to beregistered in a registry
• −→ We can have distributed callbacks
Distributed Computing Thomas Weise 5/10
![Page 20: Distributed Computing - Homework 4: RMI-based Chatiao.hfuu.edu.cn/.../distributed_computing/hw04_rmi_chat.pdfRMICallbacks • RMI is a technology for building distributed applications](https://reader033.vdocuments.net/reader033/viewer/2022042008/5e70da685107610abf4669a3/html5/thumbnails/20.jpg)
RMI Callbacks
• RMI is a technology for building distributed applications
• A server object is registered in a naming service( java.rmi.registry.Registry )
• Object functionality is provided via interfaces
• The server side implements the functionality with a ‘real’ class
• The client side automatically creates a proxy instance of the objectthat forwards all calls to the server
• In Java RMI, we can also create callback objects
• These inherit from java.rmi.server.UnicastRemoteObject and
implement a callback interface derived from java.rmi.Remote
• They can be passed to an RMI server without needing to beregistered in a registry
• −→ We can have distributed callbacks, and therefore: distributedmodel-view-controler application structures
Distributed Computing Thomas Weise 5/10
![Page 21: Distributed Computing - Homework 4: RMI-based Chatiao.hfuu.edu.cn/.../distributed_computing/hw04_rmi_chat.pdfRMICallbacks • RMI is a technology for building distributed applications](https://reader033.vdocuments.net/reader033/viewer/2022042008/5e70da685107610abf4669a3/html5/thumbnails/21.jpg)
Callbacks for Chat!
• With this, we can implement a chat system!
Distributed Computing Thomas Weise 6/10
![Page 22: Distributed Computing - Homework 4: RMI-based Chatiao.hfuu.edu.cn/.../distributed_computing/hw04_rmi_chat.pdfRMICallbacks • RMI is a technology for building distributed applications](https://reader033.vdocuments.net/reader033/viewer/2022042008/5e70da685107610abf4669a3/html5/thumbnails/22.jpg)
Callbacks for Chat!
• With this, we can implement a chat system!
• Server
Distributed Computing Thomas Weise 6/10
![Page 23: Distributed Computing - Homework 4: RMI-based Chatiao.hfuu.edu.cn/.../distributed_computing/hw04_rmi_chat.pdfRMICallbacks • RMI is a technology for building distributed applications](https://reader033.vdocuments.net/reader033/viewer/2022042008/5e70da685107610abf4669a3/html5/thumbnails/23.jpg)
Callbacks for Chat!
• With this, we can implement a chat system!
• Server:• central instance distributing chat events
Distributed Computing Thomas Weise 6/10
![Page 24: Distributed Computing - Homework 4: RMI-based Chatiao.hfuu.edu.cn/.../distributed_computing/hw04_rmi_chat.pdfRMICallbacks • RMI is a technology for building distributed applications](https://reader033.vdocuments.net/reader033/viewer/2022042008/5e70da685107610abf4669a3/html5/thumbnails/24.jpg)
Callbacks for Chat!
• With this, we can implement a chat system!
• Server:• central instance distributing chat events• provides methods to login, log out, and to send messages
Distributed Computing Thomas Weise 6/10
![Page 25: Distributed Computing - Homework 4: RMI-based Chatiao.hfuu.edu.cn/.../distributed_computing/hw04_rmi_chat.pdfRMICallbacks • RMI is a technology for building distributed applications](https://reader033.vdocuments.net/reader033/viewer/2022042008/5e70da685107610abf4669a3/html5/thumbnails/25.jpg)
Callbacks for Chat!
• With this, we can implement a chat system!
• Server:• central instance distributing chat events• provides methods to login, log out, and to send messages• maintains a list of logged in clients
Distributed Computing Thomas Weise 6/10
![Page 26: Distributed Computing - Homework 4: RMI-based Chatiao.hfuu.edu.cn/.../distributed_computing/hw04_rmi_chat.pdfRMICallbacks • RMI is a technology for building distributed applications](https://reader033.vdocuments.net/reader033/viewer/2022042008/5e70da685107610abf4669a3/html5/thumbnails/26.jpg)
Callbacks for Chat!
• With this, we can implement a chat system!
• Server:• central instance distributing chat events• provides methods to login, log out, and to send messages• maintains a list of logged in clients
• Client
Distributed Computing Thomas Weise 6/10
![Page 27: Distributed Computing - Homework 4: RMI-based Chatiao.hfuu.edu.cn/.../distributed_computing/hw04_rmi_chat.pdfRMICallbacks • RMI is a technology for building distributed applications](https://reader033.vdocuments.net/reader033/viewer/2022042008/5e70da685107610abf4669a3/html5/thumbnails/27.jpg)
Callbacks for Chat!
• With this, we can implement a chat system!
• Server:• central instance distributing chat events• provides methods to login, log out, and to send messages• maintains a list of logged in clients
• Client• uses server to log in, log out, and to send message
Distributed Computing Thomas Weise 6/10
![Page 28: Distributed Computing - Homework 4: RMI-based Chatiao.hfuu.edu.cn/.../distributed_computing/hw04_rmi_chat.pdfRMICallbacks • RMI is a technology for building distributed applications](https://reader033.vdocuments.net/reader033/viewer/2022042008/5e70da685107610abf4669a3/html5/thumbnails/28.jpg)
Callbacks for Chat!
• With this, we can implement a chat system!
• Server:• central instance distributing chat events• provides methods to login, log out, and to send messages• maintains a list of logged in clients and corresponding callback
interfaces
• Client• uses server to log in, log out, and to send message• registeres a callback interface at log in
Distributed Computing Thomas Weise 6/10
![Page 29: Distributed Computing - Homework 4: RMI-based Chatiao.hfuu.edu.cn/.../distributed_computing/hw04_rmi_chat.pdfRMICallbacks • RMI is a technology for building distributed applications](https://reader033.vdocuments.net/reader033/viewer/2022042008/5e70da685107610abf4669a3/html5/thumbnails/29.jpg)
Callbacks for Chat!
• With this, we can implement a chat system!
• Server:• central instance distributing chat events• provides methods to login, log out, and to send messages• maintains a list of logged in clients and corresponding callback
interfaces
• Client• uses server to log in, log out, and to send message• registeres a callback interface at log in• client receives events from server and updates ui
Distributed Computing Thomas Weise 6/10
![Page 30: Distributed Computing - Homework 4: RMI-based Chatiao.hfuu.edu.cn/.../distributed_computing/hw04_rmi_chat.pdfRMICallbacks • RMI is a technology for building distributed applications](https://reader033.vdocuments.net/reader033/viewer/2022042008/5e70da685107610abf4669a3/html5/thumbnails/30.jpg)
Chat Program
• For this homework, the following things have been done
Distributed Computing Thomas Weise 7/10
![Page 31: Distributed Computing - Homework 4: RMI-based Chatiao.hfuu.edu.cn/.../distributed_computing/hw04_rmi_chat.pdfRMICallbacks • RMI is a technology for building distributed applications](https://reader033.vdocuments.net/reader033/viewer/2022042008/5e70da685107610abf4669a3/html5/thumbnails/31.jpg)
Chat Program
• For this homework, the following things have been done:• The functionality of a chat server has been defined in interface
IChatServer
Distributed Computing Thomas Weise 7/10
![Page 32: Distributed Computing - Homework 4: RMI-based Chatiao.hfuu.edu.cn/.../distributed_computing/hw04_rmi_chat.pdfRMICallbacks • RMI is a technology for building distributed applications](https://reader033.vdocuments.net/reader033/viewer/2022042008/5e70da685107610abf4669a3/html5/thumbnails/32.jpg)
Chat Program
• For this homework, the following things have been done:• The functionality of a chat server has been defined in interface
IChatServer
• The client callback interface has been defined in IChatClient
Distributed Computing Thomas Weise 7/10
![Page 33: Distributed Computing - Homework 4: RMI-based Chatiao.hfuu.edu.cn/.../distributed_computing/hw04_rmi_chat.pdfRMICallbacks • RMI is a technology for building distributed applications](https://reader033.vdocuments.net/reader033/viewer/2022042008/5e70da685107610abf4669a3/html5/thumbnails/33.jpg)
Chat Program
• For this homework, the following things have been done:• The functionality of a chat server has been defined in interface
IChatServer
• The client callback interface has been defined in IChatClient
• A chat client GUI that can connect to a chat server implementationhas fully been implemented in ChatClient
Distributed Computing Thomas Weise 7/10
![Page 34: Distributed Computing - Homework 4: RMI-based Chatiao.hfuu.edu.cn/.../distributed_computing/hw04_rmi_chat.pdfRMICallbacks • RMI is a technology for building distributed applications](https://reader033.vdocuments.net/reader033/viewer/2022042008/5e70da685107610abf4669a3/html5/thumbnails/34.jpg)
Chat Program
• For this homework, the following things have been done:• The functionality of a chat server has been defined in interface
IChatServer
• The client callback interface has been defined in IChatClient
• A chat client GUI that can connect to a chat server implementationhas fully been implemented in ChatClient
• An event class for chat events has been defined in ChatEvent
Distributed Computing Thomas Weise 7/10
![Page 35: Distributed Computing - Homework 4: RMI-based Chatiao.hfuu.edu.cn/.../distributed_computing/hw04_rmi_chat.pdfRMICallbacks • RMI is a technology for building distributed applications](https://reader033.vdocuments.net/reader033/viewer/2022042008/5e70da685107610abf4669a3/html5/thumbnails/35.jpg)
Chat Program
• For this homework, the following things have been done:• The functionality of a chat server has been defined in interface
IChatServer
• The client callback interface has been defined in IChatClient
• A chat client GUI that can connect to a chat server implementationhas fully been implemented in ChatClient
• An event class for chat events has been defined in ChatEvent
• A skeleton class for the chat server, but no functionality is provided inChatServer
Distributed Computing Thomas Weise 7/10
![Page 36: Distributed Computing - Homework 4: RMI-based Chatiao.hfuu.edu.cn/.../distributed_computing/hw04_rmi_chat.pdfRMICallbacks • RMI is a technology for building distributed applications](https://reader033.vdocuments.net/reader033/viewer/2022042008/5e70da685107610abf4669a3/html5/thumbnails/36.jpg)
Chat Program
• For this homework, the following things have been done:• The functionality of a chat server has been defined in interface
IChatServer
• The client callback interface has been defined in IChatClient
• A chat client GUI that can connect to a chat server implementationhas fully been implemented in ChatClient
• An event class for chat events has been defined in ChatEvent
• A skeleton class for the chat server, but no functionality is provided inChatServer
• What remains to be done is
Distributed Computing Thomas Weise 7/10
![Page 37: Distributed Computing - Homework 4: RMI-based Chatiao.hfuu.edu.cn/.../distributed_computing/hw04_rmi_chat.pdfRMICallbacks • RMI is a technology for building distributed applications](https://reader033.vdocuments.net/reader033/viewer/2022042008/5e70da685107610abf4669a3/html5/thumbnails/37.jpg)
Chat Program
• For this homework, the following things have been done:• The functionality of a chat server has been defined in interface
IChatServer
• The client callback interface has been defined in IChatClient
• A chat client GUI that can connect to a chat server implementationhas fully been implemented in ChatClient
• An event class for chat events has been defined in ChatEvent
• A skeleton class for the chat server, but no functionality is provided inChatServer
• What remains to be done is:• Fill the chat server ChatServer with life!
Distributed Computing Thomas Weise 7/10
![Page 38: Distributed Computing - Homework 4: RMI-based Chatiao.hfuu.edu.cn/.../distributed_computing/hw04_rmi_chat.pdfRMICallbacks • RMI is a technology for building distributed applications](https://reader033.vdocuments.net/reader033/viewer/2022042008/5e70da685107610abf4669a3/html5/thumbnails/38.jpg)
Chat Program
• For this homework, the following things have been done:• The functionality of a chat server has been defined in interface
IChatServer
• The client callback interface has been defined in IChatClient
• A chat client GUI that can connect to a chat server implementationhas fully been implemented in ChatClient
• An event class for chat events has been defined in ChatEvent
• A skeleton class for the chat server, but no functionality is provided inChatServer
• What remains to be done is:• Fill the chat server ChatServer with life!
• Follow the comments in ChatServer and IChatServer !
Distributed Computing Thomas Weise 7/10
![Page 39: Distributed Computing - Homework 4: RMI-based Chatiao.hfuu.edu.cn/.../distributed_computing/hw04_rmi_chat.pdfRMICallbacks • RMI is a technology for building distributed applications](https://reader033.vdocuments.net/reader033/viewer/2022042008/5e70da685107610abf4669a3/html5/thumbnails/39.jpg)
Chat Program
• For this homework, the following things have been done:• The functionality of a chat server has been defined in interface
IChatServer
• The client callback interface has been defined in IChatClient
• A chat client GUI that can connect to a chat server implementationhas fully been implemented in ChatClient
• An event class for chat events has been defined in ChatEvent
• A skeleton class for the chat server, but no functionality is provided inChatServer
• What remains to be done is:• Fill the chat server ChatServer with life!
• Follow the comments in ChatServer and IChatServer !• Start the server
Distributed Computing Thomas Weise 7/10
![Page 40: Distributed Computing - Homework 4: RMI-based Chatiao.hfuu.edu.cn/.../distributed_computing/hw04_rmi_chat.pdfRMICallbacks • RMI is a technology for building distributed applications](https://reader033.vdocuments.net/reader033/viewer/2022042008/5e70da685107610abf4669a3/html5/thumbnails/40.jpg)
Chat Program
• For this homework, the following things have been done:• The functionality of a chat server has been defined in interface
IChatServer
• The client callback interface has been defined in IChatClient
• A chat client GUI that can connect to a chat server implementationhas fully been implemented in ChatClient
• An event class for chat events has been defined in ChatEvent
• A skeleton class for the chat server, but no functionality is provided inChatServer
• What remains to be done is:• Fill the chat server ChatServer with life!
• Follow the comments in ChatServer and IChatServer !• Start the server, connect some clients to the server
Distributed Computing Thomas Weise 7/10
![Page 41: Distributed Computing - Homework 4: RMI-based Chatiao.hfuu.edu.cn/.../distributed_computing/hw04_rmi_chat.pdfRMICallbacks • RMI is a technology for building distributed applications](https://reader033.vdocuments.net/reader033/viewer/2022042008/5e70da685107610abf4669a3/html5/thumbnails/41.jpg)
Chat Program
• For this homework, the following things have been done:• The functionality of a chat server has been defined in interface
IChatServer
• The client callback interface has been defined in IChatClient
• A chat client GUI that can connect to a chat server implementationhas fully been implemented in ChatClient
• An event class for chat events has been defined in ChatEvent
• A skeleton class for the chat server, but no functionality is provided inChatServer
• What remains to be done is:• Fill the chat server ChatServer with life!
• Follow the comments in ChatServer and IChatServer !• Start the server, connect some clients to the server, chat. . .
Distributed Computing Thomas Weise 7/10
![Page 42: Distributed Computing - Homework 4: RMI-based Chatiao.hfuu.edu.cn/.../distributed_computing/hw04_rmi_chat.pdfRMICallbacks • RMI is a technology for building distributed applications](https://reader033.vdocuments.net/reader033/viewer/2022042008/5e70da685107610abf4669a3/html5/thumbnails/42.jpg)
Chat Program
• For this homework, the following things have been done:• The functionality of a chat server has been defined in interface
IChatServer
• The client callback interface has been defined in IChatClient
• A chat client GUI that can connect to a chat server implementationhas fully been implemented in ChatClient
• An event class for chat events has been defined in ChatEvent
• A skeleton class for the chat server, but no functionality is provided inChatServer
• What remains to be done is:• Fill the chat server ChatServer with life!
• Follow the comments in ChatServer and IChatServer !• Start the server, connect some clients to the server, chat. . .
• Send me your complete Eclipse project folder packed as zip archivewith name hw04_[your_student_id].zip (where [your_student_id] is
replaced with your student id)
Distributed Computing Thomas Weise 7/10
![Page 43: Distributed Computing - Homework 4: RMI-based Chatiao.hfuu.edu.cn/.../distributed_computing/hw04_rmi_chat.pdfRMICallbacks • RMI is a technology for building distributed applications](https://reader033.vdocuments.net/reader033/viewer/2022042008/5e70da685107610abf4669a3/html5/thumbnails/43.jpg)
Caspar David Friedrich, “Der Wanderer über dem Nebelmeer”, 1818http://en.wikipedia.org/wiki/Wanderer_above_the_Sea_of_Fog
谢谢谢谢谢谢Thank you
Thomas Weise [汤卫思][email protected]
http://www.it-weise.de
Hefei University, South Campus 2Institute of Applied OptimizationShushan District, Hefei, Anhui,
China
Distributed Computing Thomas Weise 8/10
![Page 44: Distributed Computing - Homework 4: RMI-based Chatiao.hfuu.edu.cn/.../distributed_computing/hw04_rmi_chat.pdfRMICallbacks • RMI is a technology for building distributed applications](https://reader033.vdocuments.net/reader033/viewer/2022042008/5e70da685107610abf4669a3/html5/thumbnails/44.jpg)
Bibliography
Distributed Computing Thomas Weise 9/10
![Page 45: Distributed Computing - Homework 4: RMI-based Chatiao.hfuu.edu.cn/.../distributed_computing/hw04_rmi_chat.pdfRMICallbacks • RMI is a technology for building distributed applications](https://reader033.vdocuments.net/reader033/viewer/2022042008/5e70da685107610abf4669a3/html5/thumbnails/45.jpg)
Bibliography I
1. Ann Wollrath, Roger Riggs, and Jim Waldo. A distributed object model for the java system. In Douglas C. Schmidt andDoug Lea, editors, Proceedings of the USENIX 1996 Conference on Object-Oriented Technologies (COOTS), Toronto, ON,Canada, 1996. URL http://pdos.csail.mit.edu/6.824/papers/waldo-rmi.pdf.
2. William Grosso. Java RMI. Sebastopol, CA, USA: O’Reilly Media, Inc., 2011. ISBN 1449315356 and 9781449315351. URLhttp://books.google.de/books?id=TeK5uL2dWwQC.
3. Josef Stepisnik. Distributed Object-Oriented Architectures: Sockets, Java RMI and CORBA. Hamburg, Germany: DiplomicaVerlag GmbH, 2007. ISBN 3836650339 and 9783836650335. URL http://books.google.de/books?id=qNGTzYdJt18C.
4. William Crawford and Jonathan Kaplan. J2EE Design Patterns. Patterns of the Real World. Sebastopol, CA, USA: O’ReillyMedia, Inc., 2003. ISBN 0596004273 and 9780596004279. URL http://books.google.de/books?id=x-7_W0P9KGsC.
5. Barbara Purchase and Steven Holzner. Design Patterns for Dummies. For Dummies Computers Series. New York, NY, USA:John Wiley & Sons Ltd., 2006. ISBN 0471798541 and 9780471798545. URLhttp://books.google.de/books?id=6rZbzSbKsQMC.
6. Robert T. Monroe, Andrew Kompanek, Ralph Melton, and David Garlan. Architectural styles, design patterns, and objects.IEEE Software Magazine, 14(1):43–52, January–February 1997. doi: 10.1109/52.566427. URLhttp://www.cs.cmu.edu/~able/publications/ObjPatternsArch-ieee97/.
7. Frank Buschmann, Regine Meunier, Hand Rohnert, Peter Sommerlad, and Michael Stal. Pattern-Oriented SoftwareArchitecture, Volume 1: A System of Patterns. New York, NY, USA: John Wiley & Sons Ltd., August 8, 1996. ISBN047-1958-697 and 978-0471958697. URL http://books.google.de/books?id=0kUFZDuqvmEC.
Distributed Computing Thomas Weise 10/10