Lecture-IPT-Chapter-1A-INTERSYSTEM COMMUNICATION
Lecture-IPT-Chapter-1A-INTERSYSTEM COMMUNICATION
Lecture-IPT-Chapter-1A-INTERSYSTEM COMMUNICATION
OVERVIEW OF INTERSYSTEM
COMMUNICATION
Middleware
• Web Services
• Technology neutral interfaces to packages
implemented based on
compilation of the IDL
OMG has defined mappings
for:
C, C++, Java, COBOL,
03/06/2022 66
Copyright©2021/22 Tarekegn D.(MSc)\
CORBA... Application Implementing involves in
general the following steps
• AddRef() and Release() are used to manage reference counts (for memory
management)
The top layer is the basic programming architecture, which is visible to the developers
of the client and object server programs.
The middle layer is the remoting architecture, which transparently makes the interface
pointers or object references meaningful across different processes.
The bottom layer is the wire protocol architecture, which further extends the remoting
architecture to work across different machines.
03/06/2022 80
Copyright©2021/22 Tarekegn D.(MSc)\
RMI System Architecture
Responsible for:
– Setting up connections to remote address spaces
– Managing the connections
– Listening to incoming calls
– Maintaining a table of remote objects that reside in the same address space
– Setting up connections for an incoming call
– Locating the dispatcher for the target of the remote call
On the server side the call is received by the RMI system and
connected to a skeleton, which is responsible for un-marshalling the
arguments and invoking the server's implementation of the method.
89
03/06/2022 Copyright©2021/22 Tarekegn D.
(MSc)\
Example: App server: class
import java.rmi.*;
import java.rmi.server.*;
90
03/06/2022 Copyright©2021/22 Tarekegn D.
(MSc)\
Example: Registering the App server
class AppServer {
public static void main (String[] argv) {
try {
Naming.rebind("rmi://localhost/AppServer",
new App("App, Service!"));
System.out.println("App Server is ready.");
}
catch (Exception e) {
System.out.println("App Server failed: " + e);
}
}
}
91
03/06/2022 Copyright©2021/22 Tarekegn D.
(MSc)\
Example: The App client program
class AppClient {
public static void main (String[] args) {
AppInterface app;
String name = "rmi://localhost/AppServer";
try {
app = (AppInterface)Naming.lookup(name);
System.out.println(app.AppCall());
}
catch (Exception e) {
System.out.println("AppClient exception: " + e);
}
}
}
92
03/06/2022 Copyright©2021/22 Tarekegn D.
(MSc)\
rmic(RMI Compiler)
The class that implements the remote object should be compiled as usual
Then, it should be compiled with rmic:
– rmic App
– This will generate files App_Stub.class and App_Skel.class
If all goes well, you should get the “App, Service!” message
94
03/06/2022 Copyright©2021/22 Tarekegn D.
(MSc)\
RPC vs RMI
RMI supports system-wide object references
RMI can have object-specific stubs, not necessar-
ily have general-purpose client-side and server-
side stubs
Pass objects as arguments (object migration)
Migrated objects can interact with both original
and new hosts
s n
– SOAP
atio
– UDDI
Ap ts,
plic
p
• Contains 2 Artifacts:
res Conce
– Service
and
– Service description
hite ces:
• Plays 3 roles:
Arc servi
ctu
– Service provider
– Service registry b
We
– Service requester
• Supports 3 behaviors(Operations):
– Publish: service descriptions
• Service provider &Service registry
– Find/ lookup: service descriptions
• Service requester &Service registry
– Bind/ invoke: services & service description.
• Service requester &Service provider
100
03/06/2022 Copyright©2021/22 Tarekegn D.(MSc)\
Communication Paradigms
Socket communication
Low-level API for communication using underlying
network protocols
Remote Invocation
A procedure call abstraction for communicating between
entities
Indirect Communication
Communicating without direct coupling between sender
and receiver
VS
Thank You
?
03/06/2022 Copyright©2021/22 Tarekegn D.(MSc)\ 134