SlideShare a Scribd company logo
1 of 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

More Related Content

What's hot

Remote Method Invocation (Java RMI)
Remote Method Invocation (Java RMI)Remote Method Invocation (Java RMI)
Remote Method Invocation (Java RMI)Sonali Parab
 
Remote Method Invocation
Remote Method InvocationRemote Method Invocation
Remote Method Invocationashishspace
 
A Short Java RMI Tutorial
A Short Java RMI TutorialA Short Java RMI Tutorial
A Short Java RMI TutorialGuo Albert
 
Java RMI Presentation
Java RMI PresentationJava RMI Presentation
Java RMI PresentationMasud Rahman
 
Remote Method Invocation in JAVA
Remote Method Invocation in JAVARemote Method Invocation in JAVA
Remote Method Invocation in JAVAJalpesh Vasa
 
Java rmi tutorial
Java rmi tutorialJava rmi tutorial
Java rmi tutorialHarikaReddy115
 
Introduction to Remote Method Invocation (RMI)
Introduction to Remote Method Invocation (RMI)Introduction to Remote Method Invocation (RMI)
Introduction to Remote Method Invocation (RMI)eLink Business Innovations
 
Remote Method Innovation (RMI) In JAVA
Remote Method Innovation (RMI) In JAVARemote Method Innovation (RMI) In JAVA
Remote Method Innovation (RMI) In JAVAPrankit Mishra
 
Rmi architecture
Rmi architectureRmi architecture
Rmi architectureMaulik Desai
 
Remote Method Invocation (RMI)
Remote Method Invocation (RMI)Remote Method Invocation (RMI)
Remote Method Invocation (RMI)Peter R. Egli
 
remote method invocation
remote method invocationremote method invocation
remote method invocationRavi Theja
 
Elements of Java Language
Elements of Java Language Elements of Java Language
Elements of Java Language Hitesh-Java
 

What's hot (20)

Remote Method Invocation (Java RMI)
Remote Method Invocation (Java RMI)Remote Method Invocation (Java RMI)
Remote Method Invocation (Java RMI)
 
Java rmi
Java rmiJava rmi
Java rmi
 
Java rmi
Java rmiJava rmi
Java rmi
 
Remote Method Invocation
Remote Method InvocationRemote Method Invocation
Remote Method Invocation
 
A Short Java RMI Tutorial
A Short Java RMI TutorialA Short Java RMI Tutorial
A Short Java RMI Tutorial
 
Java RMI Presentation
Java RMI PresentationJava RMI Presentation
Java RMI Presentation
 
Java RMI
Java RMIJava RMI
Java RMI
 
Remote Method Invocation in JAVA
Remote Method Invocation in JAVARemote Method Invocation in JAVA
Remote Method Invocation in JAVA
 
Rmi ppt
Rmi pptRmi ppt
Rmi ppt
 
Rmi
RmiRmi
Rmi
 
Rmi ppt-2003
Rmi ppt-2003Rmi ppt-2003
Rmi ppt-2003
 
Java rmi tutorial
Java rmi tutorialJava rmi tutorial
Java rmi tutorial
 
Introduction to Remote Method Invocation (RMI)
Introduction to Remote Method Invocation (RMI)Introduction to Remote Method Invocation (RMI)
Introduction to Remote Method Invocation (RMI)
 
Remote Method Innovation (RMI) In JAVA
Remote Method Innovation (RMI) In JAVARemote Method Innovation (RMI) In JAVA
Remote Method Innovation (RMI) In JAVA
 
Rmi architecture
Rmi architectureRmi architecture
Rmi architecture
 
Rmi
RmiRmi
Rmi
 
Rmi presentation
Rmi presentationRmi presentation
Rmi presentation
 
Remote Method Invocation (RMI)
Remote Method Invocation (RMI)Remote Method Invocation (RMI)
Remote Method Invocation (RMI)
 
remote method invocation
remote method invocationremote method invocation
remote method invocation
 
Elements of Java Language
Elements of Java Language Elements of Java Language
Elements of Java Language
 

Similar to Distributed Programming using RMI

Remote Method Invocation
Remote Method InvocationRemote Method Invocation
Remote Method InvocationSonali Parab
 
Oracle docs rmi applications
Oracle docs rmi applicationsOracle docs rmi applications
Oracle docs rmi applicationsBiswabrata Banerjee
 
Remote Method Invocation, Advanced programming
Remote Method Invocation, Advanced programmingRemote Method Invocation, Advanced programming
Remote Method Invocation, Advanced programmingGera Paulos
 
Java - Remote method invocation
Java - Remote method invocationJava - Remote method invocation
Java - Remote method invocationRiccardo Cardin
 
Distributed Objects and JAVA
Distributed Objects and JAVADistributed Objects and JAVA
Distributed Objects and JAVAelliando dias
 
Remote method invocation
Remote method invocationRemote method invocation
Remote method invocationDew Shishir
 
Javarmi 130925082348-phpapp01
Javarmi 130925082348-phpapp01Javarmi 130925082348-phpapp01
Javarmi 130925082348-phpapp01heenamithadiya
 
MIDELWARE TECH
MIDELWARE TECHMIDELWARE TECH
MIDELWARE TECHmuthahar.sk
 
6. The grid-COMPUTING OGSA and WSRF
6. The grid-COMPUTING OGSA and WSRF6. The grid-COMPUTING OGSA and WSRF
6. The grid-COMPUTING OGSA and WSRFDr Sandeep Kumar Poonia
 
Session 1 Tp1
Session 1 Tp1Session 1 Tp1
Session 1 Tp1phanleson
 
Basic java
Basic java Basic java
Basic java Raghu nath
 

Similar to Distributed Programming using RMI (20)

Remote method invocatiom
Remote method invocatiomRemote method invocatiom
Remote method invocatiom
 
RMI (Remote Method Invocation)
RMI (Remote Method Invocation)RMI (Remote Method Invocation)
RMI (Remote Method Invocation)
 
DS
DSDS
DS
 
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
 
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
 
Remote method invocation
Remote method invocationRemote method invocation
Remote method invocation
 
Rmi3
Rmi3Rmi3
Rmi3
 
Javarmi 130925082348-phpapp01
Javarmi 130925082348-phpapp01Javarmi 130925082348-phpapp01
Javarmi 130925082348-phpapp01
 
MIDELWARE TECH
MIDELWARE TECHMIDELWARE TECH
MIDELWARE TECH
 
6. The grid-COMPUTING OGSA and WSRF
6. The grid-COMPUTING OGSA and WSRF6. The grid-COMPUTING OGSA and WSRF
6. The grid-COMPUTING OGSA and WSRF
 
Session 1 Tp1
Session 1 Tp1Session 1 Tp1
Session 1 Tp1
 
Basic java part_ii
Basic java part_iiBasic java part_ii
Basic java part_ii
 
Basic java
Basic java Basic java
Basic java
 

More from backdoor

Java Database Connectivity
Java Database ConnectivityJava Database Connectivity
Java Database Connectivitybackdoor
 
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 Appletbackdoor
 
Java Network Programming
Java Network ProgrammingJava Network Programming
Java Network Programmingbackdoor
 
Windows Programming with Swing
Windows Programming with SwingWindows Programming with Swing
Windows Programming with Swingbackdoor
 
Windows Programming with AWT
Windows Programming with AWTWindows Programming with AWT
Windows Programming with AWTbackdoor
 
Multithreading
MultithreadingMultithreading
Multithreadingbackdoor
 
Object and Classes in Java
Object and Classes in JavaObject and Classes in Java
Object and Classes in Javabackdoor
 
IO and serialization
IO and serializationIO and serialization
IO and serializationbackdoor
 
Exception Handling
Exception HandlingException Handling
Exception Handlingbackdoor
 
Java Intro
Java IntroJava Intro
Java Introbackdoor
 
Object Oriented Programming with Java
Object Oriented Programming with JavaObject Oriented Programming with Java
Object Oriented Programming with Javabackdoor
 
AWT Program output
AWT Program outputAWT Program output
AWT Program outputbackdoor
 
Net Man
Net ManNet Man
Net Manbackdoor
 
Data Security
Data SecurityData Security
Data Securitybackdoor
 
Ne Course Part One
Ne Course Part OneNe Course Part One
Ne Course Part Onebackdoor
 
Ne Course Part Two
Ne Course Part TwoNe Course Part Two
Ne Course Part Twobackdoor
 
Net Sec
Net SecNet Sec
Net Secbackdoor
 
Security Policy Checklist
Security Policy ChecklistSecurity Policy Checklist
Security Policy Checklistbackdoor
 
Bcis Csm Chapter Three
Bcis Csm Chapter ThreeBcis Csm Chapter Three
Bcis Csm Chapter Threebackdoor
 

More from backdoor (20)

Java Database Connectivity
Java Database ConnectivityJava Database Connectivity
Java Database Connectivity
 
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
 
Bcis Csm Chapter Three
Bcis Csm Chapter ThreeBcis Csm Chapter Three
Bcis Csm Chapter Three
 

Recently uploaded

Mysore Call Girls 8617370543 WhatsApp Number 24x7 Best Services
Mysore Call Girls 8617370543 WhatsApp Number 24x7 Best ServicesMysore Call Girls 8617370543 WhatsApp Number 24x7 Best Services
Mysore Call Girls 8617370543 WhatsApp Number 24x7 Best ServicesDipal Arora
 
HONOR Veterans Event Keynote by Michael Hawkins
HONOR Veterans Event Keynote by Michael HawkinsHONOR Veterans Event Keynote by Michael Hawkins
HONOR Veterans Event Keynote by Michael HawkinsMichael W. Hawkins
 
FULL ENJOY Call Girls In Majnu Ka Tilla, Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Majnu Ka Tilla, Delhi Contact Us 8377877756FULL ENJOY Call Girls In Majnu Ka Tilla, Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Majnu Ka Tilla, Delhi Contact Us 8377877756dollysharma2066
 
Call Girls Pune Just Call 9907093804 Top Class Call Girl Service Available
Call Girls Pune Just Call 9907093804 Top Class Call Girl Service AvailableCall Girls Pune Just Call 9907093804 Top Class Call Girl Service Available
Call Girls Pune Just Call 9907093804 Top Class Call Girl Service AvailableDipal Arora
 
Lucknow 💋 Escorts in Lucknow - 450+ Call Girl Cash Payment 8923113531 Neha Th...
Lucknow 💋 Escorts in Lucknow - 450+ Call Girl Cash Payment 8923113531 Neha Th...Lucknow 💋 Escorts in Lucknow - 450+ Call Girl Cash Payment 8923113531 Neha Th...
Lucknow 💋 Escorts in Lucknow - 450+ Call Girl Cash Payment 8923113531 Neha Th...anilsa9823
 
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
 
Monthly Social Media Update April 2024 pptx.pptx
Monthly Social Media Update April 2024 pptx.pptxMonthly Social Media Update April 2024 pptx.pptx
Monthly Social Media Update April 2024 pptx.pptxAndy Lambert
 
Monte Carlo simulation : Simulation using MCSM
Monte Carlo simulation : Simulation using MCSMMonte Carlo simulation : Simulation using MCSM
Monte Carlo simulation : Simulation using MCSMRavindra Nath Shukla
 
It will be International Nurses' Day on 12 May
It will be International Nurses' Day on 12 MayIt will be International Nurses' Day on 12 May
It will be International Nurses' Day on 12 MayNZSG
 
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 Serviceritikaroy0888
 
RSA Conference Exhibitor List 2024 - Exhibitors Data
RSA Conference Exhibitor List 2024 - Exhibitors DataRSA Conference Exhibitor List 2024 - Exhibitors Data
RSA Conference Exhibitor List 2024 - Exhibitors DataExhibitors Data
 
Call Girls Hebbal Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
Call Girls Hebbal Just Call 👗 7737669865 👗 Top Class Call Girl Service BangaloreCall Girls Hebbal Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
Call Girls Hebbal Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangaloreamitlee9823
 
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 2023Neil Kimberley
 
👉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...rajveerescorts2022
 
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 Centuryrwgiffor
 
Best VIP Call Girls Noida Sector 40 Call Me: 8448380779
Best VIP Call Girls Noida Sector 40 Call Me: 8448380779Best VIP Call Girls Noida Sector 40 Call Me: 8448380779
Best VIP Call Girls Noida Sector 40 Call Me: 8448380779Delhi Call girls
 
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756dollysharma2066
 
John Halpern sued for sexual assault.pdf
John Halpern sued for sexual assault.pdfJohn Halpern sued for sexual assault.pdf
John Halpern sued for sexual assault.pdfAmzadHosen3
 
Insurers' journeys to build a mastery in the IoT usage
Insurers' journeys to build a mastery in the IoT usageInsurers' journeys to build a mastery in the IoT usage
Insurers' journeys to build a mastery in the IoT usageMatteo Carbone
 
Call Girls Navi Mumbai Just Call 9907093804 Top Class Call Girl Service Avail...
Call Girls Navi Mumbai Just Call 9907093804 Top Class Call Girl Service Avail...Call Girls Navi Mumbai Just Call 9907093804 Top Class Call Girl Service Avail...
Call Girls Navi Mumbai Just Call 9907093804 Top Class Call Girl Service Avail...Dipal Arora
 

Recently uploaded (20)

Mysore Call Girls 8617370543 WhatsApp Number 24x7 Best Services
Mysore Call Girls 8617370543 WhatsApp Number 24x7 Best ServicesMysore Call Girls 8617370543 WhatsApp Number 24x7 Best Services
Mysore Call Girls 8617370543 WhatsApp Number 24x7 Best Services
 
HONOR Veterans Event Keynote by Michael Hawkins
HONOR Veterans Event Keynote by Michael HawkinsHONOR Veterans Event Keynote by Michael Hawkins
HONOR Veterans Event Keynote by Michael Hawkins
 
FULL ENJOY Call Girls In Majnu Ka Tilla, Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Majnu Ka Tilla, Delhi Contact Us 8377877756FULL ENJOY Call Girls In Majnu Ka Tilla, Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Majnu Ka Tilla, Delhi Contact Us 8377877756
 
Call Girls Pune Just Call 9907093804 Top Class Call Girl Service Available
Call Girls Pune Just Call 9907093804 Top Class Call Girl Service AvailableCall Girls Pune Just Call 9907093804 Top Class Call Girl Service Available
Call Girls Pune Just Call 9907093804 Top Class Call Girl Service Available
 
Lucknow 💋 Escorts in Lucknow - 450+ Call Girl Cash Payment 8923113531 Neha Th...
Lucknow 💋 Escorts in Lucknow - 450+ Call Girl Cash Payment 8923113531 Neha Th...Lucknow 💋 Escorts in Lucknow - 450+ Call Girl Cash Payment 8923113531 Neha Th...
Lucknow 💋 Escorts in Lucknow - 450+ Call Girl Cash Payment 8923113531 Neha Th...
 
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...
 
Monthly Social Media Update April 2024 pptx.pptx
Monthly Social Media Update April 2024 pptx.pptxMonthly Social Media Update April 2024 pptx.pptx
Monthly Social Media Update April 2024 pptx.pptx
 
Monte Carlo simulation : Simulation using MCSM
Monte Carlo simulation : Simulation using MCSMMonte Carlo simulation : Simulation using MCSM
Monte Carlo simulation : Simulation using MCSM
 
It will be International Nurses' Day on 12 May
It will be International Nurses' Day on 12 MayIt will be International Nurses' Day on 12 May
It will be International Nurses' Day on 12 May
 
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
 
RSA Conference Exhibitor List 2024 - Exhibitors Data
RSA Conference Exhibitor List 2024 - Exhibitors DataRSA Conference Exhibitor List 2024 - Exhibitors Data
RSA Conference Exhibitor List 2024 - Exhibitors Data
 
Call Girls Hebbal Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
Call Girls Hebbal Just Call 👗 7737669865 👗 Top Class Call Girl Service BangaloreCall Girls Hebbal Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
Call Girls Hebbal Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
 
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
 
👉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...
 
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
 
Best VIP Call Girls Noida Sector 40 Call Me: 8448380779
Best VIP Call Girls Noida Sector 40 Call Me: 8448380779Best VIP Call Girls Noida Sector 40 Call Me: 8448380779
Best VIP Call Girls Noida Sector 40 Call Me: 8448380779
 
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
 
John Halpern sued for sexual assault.pdf
John Halpern sued for sexual assault.pdfJohn Halpern sued for sexual assault.pdf
John Halpern sued for sexual assault.pdf
 
Insurers' journeys to build a mastery in the IoT usage
Insurers' journeys to build a mastery in the IoT usageInsurers' journeys to build a mastery in the IoT usage
Insurers' journeys to build a mastery in the IoT usage
 
Call Girls Navi Mumbai Just Call 9907093804 Top Class Call Girl Service Avail...
Call Girls Navi Mumbai Just Call 9907093804 Top Class Call Girl Service Avail...Call Girls Navi Mumbai Just Call 9907093804 Top Class Call Girl Service Avail...
Call Girls Navi Mumbai Just Call 9907093804 Top Class Call Girl Service Avail...
 

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