Lecture 8 - Distributed Java Programming
Lecture 8 - Distributed Java Programming
Systems Using
Java
Lecture 8
Lecture Outline
INTRODUCTION
Distributed Systems
• A distributed system is a network that consists of
autonomous computers that are connected using a
distribution middleware.
• Functional Separation
• Inherent Distribution
• Power imbalance and Load variation
• Reliability
• Resource sharing
Distributed Systems - Reasons
• Functional Separation:
• Information
– Different information is created and
maintained by different persons (e.g., Web
pages);
• People
– Computer supported collaborative work
(virtual teams, engineering, virtual surgery)
Cluster:
“A type of parallel or distributed processing system,
which consists of a collection of interconnected stand-
alone computers cooperatively working together as a
single, integrated computing resource”
Distributed Systems - Reasons
• Reliability:
– Long term preservation and data backup
(replication) at different location.
• Economies:
– Sharing a printer by many users and reduce
the cost of ownership.
– Building a supercomputer out of a network of
computers.
Distributed Systems - Examples
• Internet
• Intranet
• Mobile/Ubiquitous Computing
• Automatic Teller Machine Network
The Internet
intranet %
%
% ISP
backbone
satellite link
desktop computer:
server:
network link:
Local area
Web server network
email server
print
File server
other servers
the rest of
the Internet
router/firewall
Internet
Mobile
phone
Printer Laptop
Camera Host site
MIDDLEWARE
Introduction
• A distributed system is a network that
consists of autonomous computers that are
connected using a distribution middleware.
Middleware
– programming
abstraction
– masking Operating System
heteorogeneity of:
• underlying
Computer and Network
networks hardware
• hardware
• operating systems
Distributed Object Middleware
JAVA RMI
Java RMI
remote object
(server)
RMI Registry
RMI IMPLEMENTATION
Steps to writing a Java distributed
Application
2025-03-24 43
Code for Server Program
• Write a client program in it, fetch the remote object and invoke the required
method using this object.
• To develop a client program −
• Create a client class from where your intended to invoke the remote object.
– Get the RMI registry using the getRegistry() method of the
LocateRegistry class which belongs to the package java.rmi.registry.
– Fetch the object from the registry using the method lookup() of the
class Registry which belongs to the package java.rmi.registry.
– To this method, you need to pass a string value representing the bind
name as a parameter. This will return you the remote object.
– The lookup() returns an object of type remote, down cast it to the type
Student.
– Finally invoke the required method using the obtained remote object.
Any Questions?