SlideShare uma empresa Scribd logo
1 de 45
IADCS Diploma Course Distributed Programming with Java U Nyein Oo COO/Director(IT) Myanma Computer Co., Ltd
Why Distributed Application? ,[object Object],[object Object],[object Object],[object Object],[object Object]
Client/Server Systems? ,[object Object],[object Object],[object Object]
Three components of CSS ,[object Object],[object Object],[object Object]
IPL at Client Machine User Interface Layer (Web Browser) Information Processing Layer (Application Client) Information Storage Layer (Application Server) Client Machine Server Machine
IPL at Server Machine User Interface Layer (Web Browser) Information Processing Layer (Application Client) Information Storage Layer (Application Server) Client Machine Server Machine
Different type of Method Invocation ,[object Object],[object Object],[object Object],[object Object]
Distributed Computing Environment(DCE) ,[object Object],[object Object],[object Object],[object Object],[object Object]
How Distributed Systems work? ,[object Object],[object Object]
The services and Technologies used within DCE Cell ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
What is a DCOM? ,[object Object],[object Object],[object Object],[object Object]
DCOM(cont) ,[object Object],[object Object],[object Object],[object Object]
DCOM(cont) ,[object Object],[object Object],[object Object],[object Object],[object Object]
CORBA ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Method invocation in CORBA IDL Stub IDL  Skeleton Client Host Server Host client Object Server Object ORB
Benefits using CORBA ,[object Object],[object Object],[object Object],[object Object],[object Object]
Why Java Distributed Object Model Need? ,[object Object],[object Object],[object Object],[object Object]
RMI (your best choice for java) ,[object Object],[object Object],[object Object],[object Object],[object Object]
RMI(cont;) ,[object Object],[object Object],[object Object],[object Object]
RMI Architecture ,[object Object],[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object],[object Object],[object Object],Advantages using Remote Interface
Three tier Architecture of Java RMI Client Object Server Object Stub Skeleton Remote Reference Layer Remote Reference Layer Transport Layer Transport Layer Lower Layer Protocols Lower Layer Protocols
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Inside RMI
java.rmi Package ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
java.rmi.registry Package ,[object Object]
java.rmi.server Package ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
java.rmi.activation Package ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
java.rmi.dgc Package ,[object Object],[object Object],[object Object]
Three Tiered Layering of Java RMI   ,[object Object],[object Object],[object Object]
Implementing RMI   ,[object Object],[object Object],[object Object]
Implementing RMI on Remote Host   ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Implementing RMI on Remote Host (Contd…) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Implementing RMI on Local Host   ,[object Object],[object Object]
Genreation Remote Interface //remote interface import java.net.*; import java.security.*; import java.rmi.*; public interface MyServer extends java.rmi.Remote{ String getAndSetMessage(String message) throws java.rmi.RemoteException; }
Generation Client RMI import java.rmi.RMISecurityManager; import java.rmi.Naming; import java.net.*; import java.security.*; public class MyClient{ public static void main(String args[]){ System.setSecurityManager(new RMISecurityManager()); try{ MyServerser=(MyServer)Naming.lookup("//147.81.10.2/ServerTest"); String serverString=ser.getAndSetMessage("I amd Trying "); System.out.println("reply from the server is "+serverString); }catch(Exception e){ System.out.println(e); } } }
Generation Server RMI import java.rmi.*; import java.rmi.server.*; import java.rmi.registry.*; import java.security.*; import java.net.*; public class MyServerImpl extends UnicastRemoteObject implements MyServer{ static String hostName="147.81.10.2"; String name; public MyServerImpl(String name) throws RemoteException{ super(); this.name=name; }
Generation Server RMI (cont) public String getAndSetMessage(String message)throws RemoteException{ return("My name is "+name+"Thanks for message"+message); } public static void main(String args[]){ System.setSecurityManager(new RMISecurityManager()); try{ String objectname="Servertest"; MyServerImpl theServer=new MyServerImpl(objectname); Naming.rebind("//"+hostName+"/"+objectname,theServer); System.out.println("I am Registered"); }catch(Exception e) { System.out.println(e); } }}
Steps to Compilation ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object],[object Object],[object Object],Steps to Compilation(cont)
Example-2(Remote Interface) //Remote Interface import java.rmi.*; import java.net.*; public interface Server1 extends Remote { public void doSomething() throws RemoteException;  }
Client Remote import java.rmi.*; import java.net.*; import java.rmi.server.*; public class Client1 { public static void main(String[] args) { System.setSecurityManager(new RMISecurityManager()); try { Server1 ro = (Server1)Naming.lookup("doSomething"); System.out.println("Location: "+System.getProperty("LOCATION")); ro.doSomething(); } catch (Exception e){ e.printStackTrace(); System.exit(-1); } } }
Server Remote import java.rmi.*; import java.rmi.server.*; import java.rmi.registry.*; public class Server1Impl extends java.rmi.server.UnicastRemoteObject implements Server1 { public static void main(String[] args) { System.setSecurityManager(new RMISecurityManager()); try { Server1Impl obj = new Server1Impl(); Naming.rebind("doSomething", obj); System.out.println("doSomething bound in registry"); } catch (Exception e) { e.printStackTrace(); return; } }
Server Remote (cont) public Server1Impl() throws RemoteException {  } public void doSomething() throws RemoteException { System.out.println("This message is printed by the Server1 object"); System.out.println("Location: " + System.getProperty("LOCATION")); } }
Invoke rmi registry & Run Client Remote
Running Remote Server

Mais conteúdo relacionado

Mais procurados

Visibility control in java
Visibility control in javaVisibility control in java
Visibility control in java
Tech_MX
 

Mais procurados (20)

Visibility control in java
Visibility control in javaVisibility control in java
Visibility control in java
 
Session bean
Session beanSession bean
Session bean
 
IIS
IISIIS
IIS
 
Java servlets and CGI
Java servlets and CGIJava servlets and CGI
Java servlets and CGI
 
Google App Engine
Google App EngineGoogle App Engine
Google App Engine
 
Transport layer (computer networks)
Transport layer (computer networks)Transport layer (computer networks)
Transport layer (computer networks)
 
RMI
RMIRMI
RMI
 
Rmi presentation
Rmi presentationRmi presentation
Rmi presentation
 
Web servers
Web serversWeb servers
Web servers
 
enterprise java bean
enterprise java beanenterprise java bean
enterprise java bean
 
Message oriented middleware
Message oriented middlewareMessage oriented middleware
Message oriented middleware
 
Servlets
ServletsServlets
Servlets
 
HyperText Transfer Protocol (HTTP)
HyperText Transfer Protocol (HTTP)HyperText Transfer Protocol (HTTP)
HyperText Transfer Protocol (HTTP)
 
Jdbc architecture and driver types ppt
Jdbc architecture and driver types pptJdbc architecture and driver types ppt
Jdbc architecture and driver types ppt
 
IEEE 802.11 and Bluetooth
IEEE 802.11 and BluetoothIEEE 802.11 and Bluetooth
IEEE 802.11 and Bluetooth
 
Web controls
Web controlsWeb controls
Web controls
 
Introduction to java beans
Introduction to java beansIntroduction to java beans
Introduction to java beans
 
Wireless LAN technologies
Wireless LAN technologiesWireless LAN technologies
Wireless LAN technologies
 
File and directory
File and directoryFile and directory
File and directory
 
Remote Method Invocation in JAVA
Remote Method Invocation in JAVARemote Method Invocation in JAVA
Remote Method Invocation in JAVA
 

Destaque

Java rmi 개발 가이드
Java rmi 개발 가이드Java rmi 개발 가이드
Java rmi 개발 가이드
중선 곽
 
Distributed Objects: CORBA/Java RMI
Distributed Objects: CORBA/Java RMIDistributed Objects: CORBA/Java RMI
Distributed Objects: CORBA/Java RMI
elliando dias
 
Java rmi example program with code
Java rmi example program with codeJava rmi example program with code
Java rmi example program with code
kamal kotecha
 

Destaque (13)

Java rmi 개발 가이드
Java rmi 개발 가이드Java rmi 개발 가이드
Java rmi 개발 가이드
 
10 Typical Problems in Enterprise Java Applications
10 Typical Problems in Enterprise Java Applications10 Typical Problems in Enterprise Java Applications
10 Typical Problems in Enterprise Java Applications
 
RMI en java
RMI en javaRMI en java
RMI en java
 
Introduction To Rmi
Introduction To RmiIntroduction To Rmi
Introduction To Rmi
 
Java RMI
Java RMIJava RMI
Java RMI
 
Distributed Objects: CORBA/Java RMI
Distributed Objects: CORBA/Java RMIDistributed Objects: CORBA/Java RMI
Distributed Objects: CORBA/Java RMI
 
RPC - LLAMADAS REMOTAS
RPC - LLAMADAS REMOTASRPC - LLAMADAS REMOTAS
RPC - LLAMADAS REMOTAS
 
Service Oriented Architecture and Business Process Modeling Overview
Service Oriented Architecture and Business Process Modeling OverviewService Oriented Architecture and Business Process Modeling Overview
Service Oriented Architecture and Business Process Modeling Overview
 
RPC
RPCRPC
RPC
 
Java rmi example program with code
Java rmi example program with codeJava rmi example program with code
Java rmi example program with code
 
THE INTERNET OF THINGS
THE INTERNET OF THINGSTHE INTERNET OF THINGS
THE INTERNET OF THINGS
 
Internet-of-things- (IOT) - a-seminar - ppt - by- mohan-kumar-g
Internet-of-things- (IOT) - a-seminar - ppt - by- mohan-kumar-gInternet-of-things- (IOT) - a-seminar - ppt - by- mohan-kumar-g
Internet-of-things- (IOT) - a-seminar - ppt - by- mohan-kumar-g
 
Project management
Project managementProject management
Project management
 

Semelhante a Distributed Programming using RMI

Distributed Objects and JAVA
Distributed Objects and JAVADistributed Objects and JAVA
Distributed Objects and JAVA
elliando dias
 
remote method invocation
remote method invocationremote method invocation
remote method invocation
Ravi Theja
 

Semelhante a Distributed Programming using RMI (20)

Remote method invocatiom
Remote method invocatiomRemote method invocatiom
Remote method invocatiom
 
Remote Method Invocation
Remote Method InvocationRemote Method Invocation
Remote Method Invocation
 
RMI (Remote Method Invocation)
RMI (Remote Method Invocation)RMI (Remote Method Invocation)
RMI (Remote Method Invocation)
 
DS
DSDS
DS
 
Rmi
RmiRmi
Rmi
 
Rmi
RmiRmi
Rmi
 
Remote Method Invocation
Remote Method InvocationRemote Method Invocation
Remote Method Invocation
 
Oracle docs rmi applications
Oracle docs rmi applicationsOracle docs rmi applications
Oracle docs rmi applications
 
Rmi
RmiRmi
Rmi
 
ADB Lab Manual.docx
ADB Lab Manual.docxADB Lab Manual.docx
ADB Lab Manual.docx
 
Chapter 6-Remoting
Chapter 6-RemotingChapter 6-Remoting
Chapter 6-Remoting
 
Rmi
RmiRmi
Rmi
 
Remote Method Invocation, Advanced programming
Remote Method Invocation, Advanced programmingRemote Method Invocation, Advanced programming
Remote Method Invocation, Advanced programming
 
Java - Remote method invocation
Java - Remote method invocationJava - Remote method invocation
Java - Remote method invocation
 
Distributed Objects and JAVA
Distributed Objects and JAVADistributed Objects and JAVA
Distributed Objects and JAVA
 
Rmi ppt
Rmi pptRmi ppt
Rmi ppt
 
remote method invocation
remote method invocationremote method invocation
remote method invocation
 
Java RMI
Java RMIJava RMI
Java RMI
 
Remote Method Invocation
Remote Method InvocationRemote Method Invocation
Remote Method Invocation
 
Remote method invocation
Remote method invocationRemote method invocation
Remote method invocation
 

Mais de backdoor

Java Database Connectivity
Java Database ConnectivityJava Database Connectivity
Java Database Connectivity
backdoor
 
Distributed Programming using RMI
 Distributed Programming using RMI Distributed Programming using RMI
Distributed Programming using RMI
backdoor
 
Programming Server side with Sevlet
 Programming Server side with Sevlet  Programming Server side with Sevlet
Programming Server side with Sevlet
backdoor
 
Client Side Programming with Applet
Client Side Programming with AppletClient Side Programming with Applet
Client Side Programming with Applet
backdoor
 
Java Network Programming
Java Network ProgrammingJava Network Programming
Java Network Programming
backdoor
 
Windows Programming with Swing
Windows Programming with SwingWindows Programming with Swing
Windows Programming with Swing
backdoor
 
Windows Programming with AWT
Windows Programming with AWTWindows Programming with AWT
Windows Programming with AWT
backdoor
 
Multithreading
MultithreadingMultithreading
Multithreading
backdoor
 
Object and Classes in Java
Object and Classes in JavaObject and Classes in Java
Object and Classes in Java
backdoor
 
IO and serialization
IO and serializationIO and serialization
IO and serialization
backdoor
 
Exception Handling
Exception HandlingException Handling
Exception Handling
backdoor
 
Java Intro
Java IntroJava Intro
Java Intro
backdoor
 
Object Oriented Programming with Java
Object Oriented Programming with JavaObject Oriented Programming with Java
Object Oriented Programming with Java
backdoor
 
AWT Program output
AWT Program outputAWT Program output
AWT Program output
backdoor
 
Data Security
Data SecurityData Security
Data Security
backdoor
 
Ne Course Part One
Ne Course Part OneNe Course Part One
Ne Course Part One
backdoor
 
Ne Course Part Two
Ne Course Part TwoNe Course Part Two
Ne Course Part Two
backdoor
 
Security Policy Checklist
Security Policy ChecklistSecurity Policy Checklist
Security Policy Checklist
backdoor
 

Mais de backdoor (20)

Java Database Connectivity
Java Database ConnectivityJava Database Connectivity
Java Database Connectivity
 
Distributed Programming using RMI
 Distributed Programming using RMI Distributed Programming using RMI
Distributed Programming using RMI
 
Programming Server side with Sevlet
 Programming Server side with Sevlet  Programming Server side with Sevlet
Programming Server side with Sevlet
 
Client Side Programming with Applet
Client Side Programming with AppletClient Side Programming with Applet
Client Side Programming with Applet
 
Java Network Programming
Java Network ProgrammingJava Network Programming
Java Network Programming
 
Windows Programming with Swing
Windows Programming with SwingWindows Programming with Swing
Windows Programming with Swing
 
Windows Programming with AWT
Windows Programming with AWTWindows Programming with AWT
Windows Programming with AWT
 
Multithreading
MultithreadingMultithreading
Multithreading
 
Object and Classes in Java
Object and Classes in JavaObject and Classes in Java
Object and Classes in Java
 
IO and serialization
IO and serializationIO and serialization
IO and serialization
 
Exception Handling
Exception HandlingException Handling
Exception Handling
 
Java Intro
Java IntroJava Intro
Java Intro
 
Object Oriented Programming with Java
Object Oriented Programming with JavaObject Oriented Programming with Java
Object Oriented Programming with Java
 
AWT Program output
AWT Program outputAWT Program output
AWT Program output
 
Net Man
Net ManNet Man
Net Man
 
Data Security
Data SecurityData Security
Data Security
 
Ne Course Part One
Ne Course Part OneNe Course Part One
Ne Course Part One
 
Ne Course Part Two
Ne Course Part TwoNe Course Part Two
Ne Course Part Two
 
Net Sec
Net SecNet Sec
Net Sec
 
Security Policy Checklist
Security Policy ChecklistSecurity Policy Checklist
Security Policy Checklist
 

Último

Call Girls Electronic City Just Call 👗 7737669865 👗 Top Class Call Girl Servi...
Call Girls Electronic City Just Call 👗 7737669865 👗 Top Class Call Girl Servi...Call Girls Electronic City Just Call 👗 7737669865 👗 Top Class Call Girl Servi...
Call Girls Electronic City Just Call 👗 7737669865 👗 Top Class Call Girl Servi...
amitlee9823
 
Russian Call Girls In Gurgaon ❤️8448577510 ⊹Best Escorts Service In 24/7 Delh...
Russian Call Girls In Gurgaon ❤️8448577510 ⊹Best Escorts Service In 24/7 Delh...Russian Call Girls In Gurgaon ❤️8448577510 ⊹Best Escorts Service In 24/7 Delh...
Russian Call Girls In Gurgaon ❤️8448577510 ⊹Best Escorts Service In 24/7 Delh...
lizamodels9
 
Call Girls Jp Nagar Just Call 👗 7737669865 👗 Top Class Call Girl Service Bang...
Call Girls Jp Nagar Just Call 👗 7737669865 👗 Top Class Call Girl Service Bang...Call Girls Jp Nagar Just Call 👗 7737669865 👗 Top Class Call Girl Service Bang...
Call Girls Jp Nagar Just Call 👗 7737669865 👗 Top Class Call Girl Service Bang...
amitlee9823
 
Call Girls In DLf Gurgaon ➥99902@11544 ( Best price)100% Genuine Escort In 24...
Call Girls In DLf Gurgaon ➥99902@11544 ( Best price)100% Genuine Escort In 24...Call Girls In DLf Gurgaon ➥99902@11544 ( Best price)100% Genuine Escort In 24...
Call Girls In DLf Gurgaon ➥99902@11544 ( Best price)100% Genuine Escort In 24...
lizamodels9
 
Quick Doctor In Kuwait +2773`7758`557 Kuwait Doha Qatar Dubai Abu Dhabi Sharj...
Quick Doctor In Kuwait +2773`7758`557 Kuwait Doha Qatar Dubai Abu Dhabi Sharj...Quick Doctor In Kuwait +2773`7758`557 Kuwait Doha Qatar Dubai Abu Dhabi Sharj...
Quick Doctor In Kuwait +2773`7758`557 Kuwait Doha Qatar Dubai Abu Dhabi Sharj...
daisycvs
 

Último (20)

Uneak White's Personal Brand Exploration Presentation
Uneak White's Personal Brand Exploration PresentationUneak White's Personal Brand Exploration Presentation
Uneak White's Personal Brand Exploration Presentation
 
VVVIP Call Girls In Greater Kailash ➡️ Delhi ➡️ 9999965857 🚀 No Advance 24HRS...
VVVIP Call Girls In Greater Kailash ➡️ Delhi ➡️ 9999965857 🚀 No Advance 24HRS...VVVIP Call Girls In Greater Kailash ➡️ Delhi ➡️ 9999965857 🚀 No Advance 24HRS...
VVVIP Call Girls In Greater Kailash ➡️ Delhi ➡️ 9999965857 🚀 No Advance 24HRS...
 
Mondelez State of Snacking and Future Trends 2023
Mondelez State of Snacking and Future Trends 2023Mondelez State of Snacking and Future Trends 2023
Mondelez State of Snacking and Future Trends 2023
 
Call Girls Electronic City Just Call 👗 7737669865 👗 Top Class Call Girl Servi...
Call Girls Electronic City Just Call 👗 7737669865 👗 Top Class Call Girl Servi...Call Girls Electronic City Just Call 👗 7737669865 👗 Top Class Call Girl Servi...
Call Girls Electronic City Just Call 👗 7737669865 👗 Top Class Call Girl Servi...
 
Russian Call Girls In Gurgaon ❤️8448577510 ⊹Best Escorts Service In 24/7 Delh...
Russian Call Girls In Gurgaon ❤️8448577510 ⊹Best Escorts Service In 24/7 Delh...Russian Call Girls In Gurgaon ❤️8448577510 ⊹Best Escorts Service In 24/7 Delh...
Russian Call Girls In Gurgaon ❤️8448577510 ⊹Best Escorts Service In 24/7 Delh...
 
Business Model Canvas (BMC)- A new venture concept
Business Model Canvas (BMC)-  A new venture conceptBusiness Model Canvas (BMC)-  A new venture concept
Business Model Canvas (BMC)- A new venture concept
 
Call Girls Jp Nagar Just Call 👗 7737669865 👗 Top Class Call Girl Service Bang...
Call Girls Jp Nagar Just Call 👗 7737669865 👗 Top Class Call Girl Service Bang...Call Girls Jp Nagar Just Call 👗 7737669865 👗 Top Class Call Girl Service Bang...
Call Girls Jp Nagar Just Call 👗 7737669865 👗 Top Class Call Girl Service Bang...
 
Phases of Negotiation .pptx
 Phases of Negotiation .pptx Phases of Negotiation .pptx
Phases of Negotiation .pptx
 
Cracking the Cultural Competence Code.pptx
Cracking the Cultural Competence Code.pptxCracking the Cultural Competence Code.pptx
Cracking the Cultural Competence Code.pptx
 
Famous Olympic Siblings from the 21st Century
Famous Olympic Siblings from the 21st CenturyFamous Olympic Siblings from the 21st Century
Famous Olympic Siblings from the 21st Century
 
👉Chandigarh Call Girls 👉9878799926👉Just Call👉Chandigarh Call Girl In Chandiga...
👉Chandigarh Call Girls 👉9878799926👉Just Call👉Chandigarh Call Girl In Chandiga...👉Chandigarh Call Girls 👉9878799926👉Just Call👉Chandigarh Call Girl In Chandiga...
👉Chandigarh Call Girls 👉9878799926👉Just Call👉Chandigarh Call Girl In Chandiga...
 
Call Girls Zirakpur👧 Book Now📱7837612180 📞👉Call Girl Service In Zirakpur No A...
Call Girls Zirakpur👧 Book Now📱7837612180 📞👉Call Girl Service In Zirakpur No A...Call Girls Zirakpur👧 Book Now📱7837612180 📞👉Call Girl Service In Zirakpur No A...
Call Girls Zirakpur👧 Book Now📱7837612180 📞👉Call Girl Service In Zirakpur No A...
 
How to Get Started in Social Media for Art League City
How to Get Started in Social Media for Art League CityHow to Get Started in Social Media for Art League City
How to Get Started in Social Media for Art League City
 
Call Girls In Panjim North Goa 9971646499 Genuine Service
Call Girls In Panjim North Goa 9971646499 Genuine ServiceCall Girls In Panjim North Goa 9971646499 Genuine Service
Call Girls In Panjim North Goa 9971646499 Genuine Service
 
Call Girls In DLf Gurgaon ➥99902@11544 ( Best price)100% Genuine Escort In 24...
Call Girls In DLf Gurgaon ➥99902@11544 ( Best price)100% Genuine Escort In 24...Call Girls In DLf Gurgaon ➥99902@11544 ( Best price)100% Genuine Escort In 24...
Call Girls In DLf Gurgaon ➥99902@11544 ( Best price)100% Genuine Escort In 24...
 
Call Girls Service In Old Town Dubai ((0551707352)) Old Town Dubai Call Girl ...
Call Girls Service In Old Town Dubai ((0551707352)) Old Town Dubai Call Girl ...Call Girls Service In Old Town Dubai ((0551707352)) Old Town Dubai Call Girl ...
Call Girls Service In Old Town Dubai ((0551707352)) Old Town Dubai Call Girl ...
 
(Anamika) VIP Call Girls Napur Call Now 8617697112 Napur Escorts 24x7
(Anamika) VIP Call Girls Napur Call Now 8617697112 Napur Escorts 24x7(Anamika) VIP Call Girls Napur Call Now 8617697112 Napur Escorts 24x7
(Anamika) VIP Call Girls Napur Call Now 8617697112 Napur Escorts 24x7
 
A DAY IN THE LIFE OF A SALESMAN / WOMAN
A DAY IN THE LIFE OF A  SALESMAN / WOMANA DAY IN THE LIFE OF A  SALESMAN / WOMAN
A DAY IN THE LIFE OF A SALESMAN / WOMAN
 
Call Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service Available
Call Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service AvailableCall Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service Available
Call Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service Available
 
Quick Doctor In Kuwait +2773`7758`557 Kuwait Doha Qatar Dubai Abu Dhabi Sharj...
Quick Doctor In Kuwait +2773`7758`557 Kuwait Doha Qatar Dubai Abu Dhabi Sharj...Quick Doctor In Kuwait +2773`7758`557 Kuwait Doha Qatar Dubai Abu Dhabi Sharj...
Quick Doctor In Kuwait +2773`7758`557 Kuwait Doha Qatar Dubai Abu Dhabi Sharj...
 

Distributed Programming using RMI

  • 1. IADCS Diploma Course Distributed Programming with Java U Nyein Oo COO/Director(IT) Myanma Computer Co., Ltd
  • 2.
  • 3.
  • 4.
  • 5. IPL at Client Machine User Interface Layer (Web Browser) Information Processing Layer (Application Client) Information Storage Layer (Application Server) Client Machine Server Machine
  • 6. IPL at Server Machine User Interface Layer (Web Browser) Information Processing Layer (Application Client) Information Storage Layer (Application Server) Client Machine Server Machine
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15. Method invocation in CORBA IDL Stub IDL Skeleton Client Host Server Host client Object Server Object ORB
  • 16.
  • 17.
  • 18.
  • 19.
  • 20.
  • 21.
  • 22. Three tier Architecture of Java RMI Client Object Server Object Stub Skeleton Remote Reference Layer Remote Reference Layer Transport Layer Transport Layer Lower Layer Protocols Lower Layer Protocols
  • 23.
  • 24.
  • 25.
  • 26.
  • 27.
  • 28.
  • 29.
  • 30.
  • 31.
  • 32.
  • 33.
  • 34. Genreation Remote Interface //remote interface import java.net.*; import java.security.*; import java.rmi.*; public interface MyServer extends java.rmi.Remote{ String getAndSetMessage(String message) throws java.rmi.RemoteException; }
  • 35. Generation Client RMI import java.rmi.RMISecurityManager; import java.rmi.Naming; import java.net.*; import java.security.*; public class MyClient{ public static void main(String args[]){ System.setSecurityManager(new RMISecurityManager()); try{ MyServerser=(MyServer)Naming.lookup("//147.81.10.2/ServerTest"); String serverString=ser.getAndSetMessage("I amd Trying "); System.out.println("reply from the server is "+serverString); }catch(Exception e){ System.out.println(e); } } }
  • 36. Generation Server RMI import java.rmi.*; import java.rmi.server.*; import java.rmi.registry.*; import java.security.*; import java.net.*; public class MyServerImpl extends UnicastRemoteObject implements MyServer{ static String hostName="147.81.10.2"; String name; public MyServerImpl(String name) throws RemoteException{ super(); this.name=name; }
  • 37. Generation Server RMI (cont) public String getAndSetMessage(String message)throws RemoteException{ return("My name is "+name+"Thanks for message"+message); } public static void main(String args[]){ System.setSecurityManager(new RMISecurityManager()); try{ String objectname="Servertest"; MyServerImpl theServer=new MyServerImpl(objectname); Naming.rebind("//"+hostName+"/"+objectname,theServer); System.out.println("I am Registered"); }catch(Exception e) { System.out.println(e); } }}
  • 38.
  • 39.
  • 40. Example-2(Remote Interface) //Remote Interface import java.rmi.*; import java.net.*; public interface Server1 extends Remote { public void doSomething() throws RemoteException; }
  • 41. Client Remote import java.rmi.*; import java.net.*; import java.rmi.server.*; public class Client1 { public static void main(String[] args) { System.setSecurityManager(new RMISecurityManager()); try { Server1 ro = (Server1)Naming.lookup("doSomething"); System.out.println("Location: "+System.getProperty("LOCATION")); ro.doSomething(); } catch (Exception e){ e.printStackTrace(); System.exit(-1); } } }
  • 42. Server Remote import java.rmi.*; import java.rmi.server.*; import java.rmi.registry.*; public class Server1Impl extends java.rmi.server.UnicastRemoteObject implements Server1 { public static void main(String[] args) { System.setSecurityManager(new RMISecurityManager()); try { Server1Impl obj = new Server1Impl(); Naming.rebind("doSomething", obj); System.out.println("doSomething bound in registry"); } catch (Exception e) { e.printStackTrace(); return; } }
  • 43. Server Remote (cont) public Server1Impl() throws RemoteException { } public void doSomething() throws RemoteException { System.out.println("This message is printed by the Server1 object"); System.out.println("Location: " + System.getProperty("LOCATION")); } }
  • 44. Invoke rmi registry & Run Client Remote