Integrative Programing Chapter 1
Integrative Programing Chapter 1
OVERVIEW OF INTERSYSTEM
COMMUNICATION
➢ Ans:
▪ communication facilities
Middleware
• Inter-enterprise
• Web Services
• AddRef() and Release() are used to manage reference counts (for memory
management)
• This means that a client proxy dynamically loads multiple server stubs in the
remoting layer depending on the number of interfaces being used.
▪ 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.
6/17/2023 46
Copyright©2019/20 Tarekegn D.(MSc)\
❑ RMI System Architecture (How it works)
50
6/17/2023 Copyright©2019/20 Tarekegn
D.(MSc)\
❑ Example: App server: class
import java.rmi.*;
import java.rmi.server.*;
51
6/17/2023 Copyright©2019/20 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);
}
}
}
52
6/17/2023 Copyright©2019/20 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);
}
}
}
53
6/17/2023 Copyright©2019/20 Tarekegn
D.(MSc)\
❑ rmic(RMI Compiler)
▪ The class that implements the remote object should be compiled as usual
– rmic App
• rmiregistry
• java AppServer
• java AppClient
▪ If all goes well, you should get the “App, Service!” message
55
6/17/2023 Copyright©2019/20 Tarekegn
D.(MSc)\
Web Services
Web services are open standard ( XML, SOAP, HTTP etc.) based
Web applications that interact with other web applications for the
purpose of exchanging data
• Web Services are self-contained, modular, distributed, dynamic
applications
• Web services are XML-based information exchange systems that
use the Internet for direct application-to-application interaction
• These systems can include
– Programs
– Objects
– Messages
– documents.
Remote Invocation
A procedure call abstraction for communicating between
entities
Indirect Communication
Communicating without direct coupling between sender
and receiver
Thank You
?
6/17/2023 Copyright©2019/20 Tarekegn D.(MSc)\ 78