SlideShare une entreprise Scribd logo
1  sur  14
Télécharger pour lire hors ligne
ECE 566- Parallel and Distributed Technology
Distributed Objects: CORBA/Java
              RMI
          Manish Parashar
      parashar@ece.rutgers.edu
      Department of Electrical &
       Computer Engineering
         Rutgers University
Distributed Objects: Goals
• Let any object reside anywhere in the
  network, and allow an application to
  interact with these objects exactly in the
  same way as they do with a local objects
• Provide the ability to construct an object on
  one host and transmit it to another host
• Enable an agent on one host to create a new
  object on another host.
Lecture 14 & 15    ECE 566 - Parallel and Distributed   2
                              Computing
Distributed Objects: Operations
• Locate remote object
• Creating remote objects
• Invoke methods on remote objects
• Obtain results from a remote method
  invocation
• Delete remote object


Lecture 14 & 15   ECE 566 - Parallel and Distributed   3
                             Computing
Distributed Objects: Properties
• Object locator
• Communication
      – data type
      – data representation
      – synchronous/asynchronous
•    State Persistence
•    Security
•    Reliability/Availability
•    Load Balancing
Lecture 14 & 15     ECE 566 - Parallel and Distributed   4
                               Computing
Java RMI
• Components
      – Object Interfaces
             • extends the Remote interface
      – Server side implementation of the interface
             • extends the java.rmi.server.UnicastRemoteObject
      – RMI registry
      – rmic compiler for stub and skeleton generation
• Others Issues
      – Serialization
      – Exception handling
      – Constructors
Lecture 14 & 15                ECE 566 - Parallel and Distributed   5
                                          Computing
Java RMI: Object Interfaces

              import java.rmi.Remote;
              import java.rmi.RemoteException;

              public interface DataRetrieval extends Remote
              {
                String GetData()
                      throws RemoteException;
              }




Lecture 14 & 15              ECE 566 - Parallel and Distributed   6
                                        Computing
Java RMI: Server Implementation
import DataRetrieval;
import java.rmi.Naming;
import java.rmi.RemoteException;
import java.rmi.RMISecurityManager;
import java.rmi.server.UnicastRemoteObject;            public String GetData()
import java.net.InetAddress;                                        throws RemoteException
                                                        {
                                                          String client = null;
public class DataRetrievalImpl
     extends UnicastRemoteObject                             try
     implements DataRetrieval                                {
                                                               client = getClientHost();
{                                                            }
  private int call;                                          catch(Exception e)
                                                             {
                                                               System.out.println(quot;exception: quot; + e);
 public DataRetrievalImpl()                                    client = quot;unknownquot;;
     throws RemoteException                                  }
 {                                                           call++;
   super();                                                  System.out.println(client + quot;
   call = 0;                                                                   request, data is:quot; + call);
 }                                                           return quot;data is:quot; + call;
                                                         }

     Lecture 14 & 15                ECE 566 - Parallel and Distributed                                       7
                                               Computing
Java RMI: Server Implementation
     public static void main(String args[])
     {
       System.out.println(quot;Started server...quot;);
       try
       {
         InetAddress host = InetAddress.getLocalHost();
         String name = quot;//quot; + host.getHostName() + quot;/DataRetrievalquot;;
         System.out.println(quot;binding to quot; + name);
         System.setSecurityManager(new RMISecurityManager());
         DataRetrievalImpl data = new DataRetrievalImpl();
         Naming.rebind(name,data);
       }
       catch(Exception e)
       {
         System.out.println(quot;exception: quot; + e);
       }
     }
 }
Lecture 14 & 15                ECE 566 - Parallel and Distributed      8
                                          Computing
Java RMI: Client
   import DataRetrieval;
   import java.rmi.Naming;
   public class DataRetrievalClient
   {
      public static void main(String[] args)
      {
        if (args.length != 1)
        {
           System.out.println(quot;Please give server namequot;);
           return;
        }
        try
        {
           DataRetrieval data = null;
           String name = quot;rmi://quot; + args[0] + quot;/DataRetrievalquot;;
           data = (DataRetrieval)Naming.lookup(name);
           String reply;
           reply = data.GetData();
           System.out.println(quot;Got quot;+reply);
        }
        catch(Exception e)
        {
           System.out.println(quot;Exception quot;+e);
        }
        System.exit(0);
      }
Lecture 14 & 15                     ECE 566 - Parallel and Distributed   9
   }
                                                 Computing
Java RMI: Registry/rmic
• RMI registry serves the role of the object manager
            • % rmiregistry
            • % rmiregistry <port #> // default is 1099
• Addressing a remote object
MyObject obj1 =
  (MyObject)Naming.lookup(“rmi://objecthost.myorg.com/Object1);
MyObject obj1 =
  (MyObject)Naming.lookup(“rmi://objecthost.myorg.com:2099/Object1);
• rmic compiler
            • rmic serversideimpl
            • generates client stub and server skeleton
            • bootstraps off java bytecode

Lecture 14 & 15                 ECE 566 - Parallel and Distributed     10
                                           Computing
CORBA
• Object Request Broker (ORB)
      – enable clients and server objects to interact
      – provide servers
             • naming services, security services, …
• Interface Definition Language (IDL)
• Dynamic Invocation Interface (DII)
      – Interface repository
• Internet Inter-Orb Protocol (IIOP)
Lecture 14 & 15            ECE 566 - Parallel and Distributed   11
                                      Computing
CORBA Solver
• Generate IDL description
• Generate client stub
             • idltojava -f client Solver.idl
             • generates Base Interface, holder classes & client stubs
                    package DCJ.examples;
                    public class _SolverStub
                                 extends org.omg.CORBA.portable.ObjectImpl
                                 implements DCJ.examples.Solver {



                    package DCJ.examples;
                    public class _ProblemSetStub
                                 extends org.omg.CORBA.portable.ObjectImpl
                                 implements DCJ.examples.ProblemSet {

Lecture 14 & 15                 ECE 566 - Parallel and Distributed           12
                                           Computing
CORBA Solver
• Generate server skeleton and implementation
             • idltojava -f server Solver.idl
             • generates abstract base class for remote implementation
    package DCJ.examples;
    public abstract class _ProblemSetImplBase extends org.omg.CORBA.portable.ObjectImpl
                                              implements DCJ.examples.ProblemSet,
                                                          org.omg.CORBA.portable.Skeleton {

    package DCJ.examples;
    public abstract class _SolverImplBase extends org.omg.CORBA.portable.ObjectImpl
                                          implements DCJ.examples.Solver,
                                                      org.omg.CORBA.portable.Skeleton {




Lecture 14 & 15                    ECE 566 - Parallel and Distributed                         13
                                              Computing
CORBA Solver
• Implement remote object
• Implement client
• Start name server
             • nameserve -ORBInitialport 1050
• Run Server
• Run Client




Lecture 14 & 15             ECE 566 - Parallel and Distributed   14
                                       Computing

Contenu connexe

Tendances

Corba and-java
Corba and-javaCorba and-java
Corba and-java
afreen58
 
Distributed objects & components of corba
Distributed objects & components of corbaDistributed objects & components of corba
Distributed objects & components of corba
Mayuresh Wadekar
 
Chapter10
Chapter10Chapter10
Chapter10
lopjuan
 
Corba introduction and simple example
Corba introduction and simple example Corba introduction and simple example
Corba introduction and simple example
Alexia Wang
 
Rmi, corba and java beans
Rmi, corba and java beansRmi, corba and java beans
Rmi, corba and java beans
Raghu nath
 

Tendances (20)

Corba
CorbaCorba
Corba
 
CORBA Basic and Deployment of CORBA
CORBA Basic and Deployment of CORBACORBA Basic and Deployment of CORBA
CORBA Basic and Deployment of CORBA
 
Corba
CorbaCorba
Corba
 
CORBA - Introduction and Details
CORBA - Introduction and DetailsCORBA - Introduction and Details
CORBA - Introduction and Details
 
Corba and-java
Corba and-javaCorba and-java
Corba and-java
 
Distributed objects & components of corba
Distributed objects & components of corbaDistributed objects & components of corba
Distributed objects & components of corba
 
Chapter10
Chapter10Chapter10
Chapter10
 
C O R B A Unit 4
C O R B A    Unit 4C O R B A    Unit 4
C O R B A Unit 4
 
Common Object Request Broker Architecture
Common Object Request Broker ArchitectureCommon Object Request Broker Architecture
Common Object Request Broker Architecture
 
Corba introduction and simple example
Corba introduction and simple example Corba introduction and simple example
Corba introduction and simple example
 
Corba concepts & corba architecture
Corba concepts & corba architectureCorba concepts & corba architecture
Corba concepts & corba architecture
 
Presentation On Com Dcom
Presentation On Com DcomPresentation On Com Dcom
Presentation On Com Dcom
 
CORBA
CORBACORBA
CORBA
 
Java RMI Presentation
Java RMI PresentationJava RMI Presentation
Java RMI Presentation
 
Corba
CorbaCorba
Corba
 
Rmi, corba and java beans
Rmi, corba and java beansRmi, corba and java beans
Rmi, corba and java beans
 
Unit iv
Unit ivUnit iv
Unit iv
 
Distributed objects
Distributed objectsDistributed objects
Distributed objects
 
Corba in power system
Corba in power systemCorba in power system
Corba in power system
 
DCOM Comparison
DCOM ComparisonDCOM Comparison
DCOM Comparison
 

En vedette

Distributed Programming using RMI
Distributed Programming using RMIDistributed Programming using RMI
Distributed Programming using RMI
backdoor
 
supriya gayen 11 - Copy
supriya gayen 11 - Copysupriya gayen 11 - Copy
supriya gayen 11 - Copy
Supriya Gayen
 
Comparison between-rpc-rmi-and-webservices-son-1228374226080667-8
Comparison between-rpc-rmi-and-webservices-son-1228374226080667-8Comparison between-rpc-rmi-and-webservices-son-1228374226080667-8
Comparison between-rpc-rmi-and-webservices-son-1228374226080667-8
helpsoft01
 

En vedette (20)

Oopsla 2007 - The Web: Distributed Objects Realized!
Oopsla 2007 - The Web: Distributed Objects Realized!Oopsla 2007 - The Web: Distributed Objects Realized!
Oopsla 2007 - The Web: Distributed Objects Realized!
 
Rmi presentation
Rmi presentationRmi presentation
Rmi presentation
 
java 6 (rmi-corba) education
java 6 (rmi-corba) educationjava 6 (rmi-corba) education
java 6 (rmi-corba) education
 
Social crm
Social crmSocial crm
Social crm
 
Distributed Programming using RMI
Distributed Programming using RMIDistributed Programming using RMI
Distributed Programming using RMI
 
A Case Study In Social CRM Without Technology: The Green Bay Packers
A Case Study In Social CRM Without Technology: The Green Bay PackersA Case Study In Social CRM Without Technology: The Green Bay Packers
A Case Study In Social CRM Without Technology: The Green Bay Packers
 
Distributed Multimedia Systems(DMMS)
Distributed Multimedia Systems(DMMS)Distributed Multimedia Systems(DMMS)
Distributed Multimedia Systems(DMMS)
 
Introduction To Rmi
Introduction To RmiIntroduction To Rmi
Introduction To Rmi
 
Java RMI
Java RMIJava RMI
Java RMI
 
Handling Byzantine Faults
Handling Byzantine FaultsHandling Byzantine Faults
Handling Byzantine Faults
 
TN566 labs
TN566 labsTN566 labs
TN566 labs
 
Station 1 POD1
Station 1 POD1Station 1 POD1
Station 1 POD1
 
Big Data Ecosystem at LinkedIn. Keynote talk at Big Data Innovators Gathering...
Big Data Ecosystem at LinkedIn. Keynote talk at Big Data Innovators Gathering...Big Data Ecosystem at LinkedIn. Keynote talk at Big Data Innovators Gathering...
Big Data Ecosystem at LinkedIn. Keynote talk at Big Data Innovators Gathering...
 
orkut and social networking
orkut and social networkingorkut and social networking
orkut and social networking
 
shiv nadar and hcl
shiv nadar and hclshiv nadar and hcl
shiv nadar and hcl
 
cv
cvcv
cv
 
supriya gayen 11 - Copy
supriya gayen 11 - Copysupriya gayen 11 - Copy
supriya gayen 11 - Copy
 
تحليل المعلومات في الشبكات الإجتماعية
تحليل المعلومات في الشبكات الإجتماعيةتحليل المعلومات في الشبكات الإجتماعية
تحليل المعلومات في الشبكات الإجتماعية
 
RMI
RMIRMI
RMI
 
Comparison between-rpc-rmi-and-webservices-son-1228374226080667-8
Comparison between-rpc-rmi-and-webservices-son-1228374226080667-8Comparison between-rpc-rmi-and-webservices-son-1228374226080667-8
Comparison between-rpc-rmi-and-webservices-son-1228374226080667-8
 

Similaire à Distributed Objects: CORBA/Java RMI

Remote Method Invocation
Remote Method InvocationRemote Method Invocation
Remote Method Invocation
elliando dias
 
Distributed Objects and JAVA
Distributed Objects and JAVADistributed Objects and JAVA
Distributed Objects and JAVA
elliando dias
 
Breaking Parser Logic: Take Your Path Normalization Off and Pop 0days Out!
Breaking Parser Logic: Take Your Path Normalization Off and Pop 0days Out!Breaking Parser Logic: Take Your Path Normalization Off and Pop 0days Out!
Breaking Parser Logic: Take Your Path Normalization Off and Pop 0days Out!
Priyanka Aash
 
Java remote method invocation
Java remote method invocationJava remote method invocation
Java remote method invocation
Van Dawn
 
How and why i roll my own node.js framework
How and why i roll my own node.js frameworkHow and why i roll my own node.js framework
How and why i roll my own node.js framework
Ben Lin
 

Similaire à Distributed Objects: CORBA/Java RMI (20)

Remote Method Invocation
Remote Method InvocationRemote Method Invocation
Remote Method Invocation
 
17rmi
17rmi17rmi
17rmi
 
Cp7 rpc
Cp7 rpcCp7 rpc
Cp7 rpc
 
Java rmi
Java rmiJava rmi
Java rmi
 
Using the Windows 8 Runtime from C++
Using the Windows 8 Runtime from C++Using the Windows 8 Runtime from C++
Using the Windows 8 Runtime from C++
 
JVM Mechanics: When Does the JVM JIT & Deoptimize?
JVM Mechanics: When Does the JVM JIT & Deoptimize?JVM Mechanics: When Does the JVM JIT & Deoptimize?
JVM Mechanics: When Does the JVM JIT & Deoptimize?
 
Distributed Objects and JAVA
Distributed Objects and JAVADistributed Objects and JAVA
Distributed Objects and JAVA
 
(DEV204) Building High-Performance Native Cloud Apps In C++
(DEV204) Building High-Performance Native Cloud Apps In C++(DEV204) Building High-Performance Native Cloud Apps In C++
(DEV204) Building High-Performance Native Cloud Apps In C++
 
Having Fun with Play
Having Fun with PlayHaving Fun with Play
Having Fun with Play
 
Breaking Parser Logic: Take Your Path Normalization Off and Pop 0days Out!
Breaking Parser Logic: Take Your Path Normalization Off and Pop 0days Out!Breaking Parser Logic: Take Your Path Normalization Off and Pop 0days Out!
Breaking Parser Logic: Take Your Path Normalization Off and Pop 0days Out!
 
Virtualizing Java in Java (jug.ru)
Virtualizing Java in Java (jug.ru)Virtualizing Java in Java (jug.ru)
Virtualizing Java in Java (jug.ru)
 
Construire une application JavaFX 8 avec gradle
Construire une application JavaFX 8 avec gradleConstruire une application JavaFX 8 avec gradle
Construire une application JavaFX 8 avec gradle
 
Silicon Valley JUG: JVM Mechanics
Silicon Valley JUG: JVM MechanicsSilicon Valley JUG: JVM Mechanics
Silicon Valley JUG: JVM Mechanics
 
Java remote method invocation
Java remote method invocationJava remote method invocation
Java remote method invocation
 
Rmi
RmiRmi
Rmi
 
How and why i roll my own node.js framework
How and why i roll my own node.js frameworkHow and why i roll my own node.js framework
How and why i roll my own node.js framework
 
Native Java with GraalVM
Native Java with GraalVMNative Java with GraalVM
Native Java with GraalVM
 
Building Testable PHP Applications
Building Testable PHP ApplicationsBuilding Testable PHP Applications
Building Testable PHP Applications
 
My java file
My java fileMy java file
My java file
 
Spring Boot
Spring BootSpring Boot
Spring Boot
 

Plus de elliando dias

Why you should be excited about ClojureScript
Why you should be excited about ClojureScriptWhy you should be excited about ClojureScript
Why you should be excited about ClojureScript
elliando dias
 
Nomenclatura e peças de container
Nomenclatura  e peças de containerNomenclatura  e peças de container
Nomenclatura e peças de container
elliando dias
 
Polyglot and Poly-paradigm Programming for Better Agility
Polyglot and Poly-paradigm Programming for Better AgilityPolyglot and Poly-paradigm Programming for Better Agility
Polyglot and Poly-paradigm Programming for Better Agility
elliando dias
 
Javascript Libraries
Javascript LibrariesJavascript Libraries
Javascript Libraries
elliando dias
 
How to Make an Eight Bit Computer and Save the World!
How to Make an Eight Bit Computer and Save the World!How to Make an Eight Bit Computer and Save the World!
How to Make an Eight Bit Computer and Save the World!
elliando dias
 
A Practical Guide to Connecting Hardware to the Web
A Practical Guide to Connecting Hardware to the WebA Practical Guide to Connecting Hardware to the Web
A Practical Guide to Connecting Hardware to the Web
elliando dias
 
Introdução ao Arduino
Introdução ao ArduinoIntrodução ao Arduino
Introdução ao Arduino
elliando dias
 
Incanter Data Sorcery
Incanter Data SorceryIncanter Data Sorcery
Incanter Data Sorcery
elliando dias
 
Fab.in.a.box - Fab Academy: Machine Design
Fab.in.a.box - Fab Academy: Machine DesignFab.in.a.box - Fab Academy: Machine Design
Fab.in.a.box - Fab Academy: Machine Design
elliando dias
 
Hadoop - Simple. Scalable.
Hadoop - Simple. Scalable.Hadoop - Simple. Scalable.
Hadoop - Simple. Scalable.
elliando dias
 
Hadoop and Hive Development at Facebook
Hadoop and Hive Development at FacebookHadoop and Hive Development at Facebook
Hadoop and Hive Development at Facebook
elliando dias
 
Multi-core Parallelization in Clojure - a Case Study
Multi-core Parallelization in Clojure - a Case StudyMulti-core Parallelization in Clojure - a Case Study
Multi-core Parallelization in Clojure - a Case Study
elliando dias
 

Plus de elliando dias (20)

Clojurescript slides
Clojurescript slidesClojurescript slides
Clojurescript slides
 
Why you should be excited about ClojureScript
Why you should be excited about ClojureScriptWhy you should be excited about ClojureScript
Why you should be excited about ClojureScript
 
Functional Programming with Immutable Data Structures
Functional Programming with Immutable Data StructuresFunctional Programming with Immutable Data Structures
Functional Programming with Immutable Data Structures
 
Nomenclatura e peças de container
Nomenclatura  e peças de containerNomenclatura  e peças de container
Nomenclatura e peças de container
 
Geometria Projetiva
Geometria ProjetivaGeometria Projetiva
Geometria Projetiva
 
Polyglot and Poly-paradigm Programming for Better Agility
Polyglot and Poly-paradigm Programming for Better AgilityPolyglot and Poly-paradigm Programming for Better Agility
Polyglot and Poly-paradigm Programming for Better Agility
 
Javascript Libraries
Javascript LibrariesJavascript Libraries
Javascript Libraries
 
How to Make an Eight Bit Computer and Save the World!
How to Make an Eight Bit Computer and Save the World!How to Make an Eight Bit Computer and Save the World!
How to Make an Eight Bit Computer and Save the World!
 
Ragel talk
Ragel talkRagel talk
Ragel talk
 
A Practical Guide to Connecting Hardware to the Web
A Practical Guide to Connecting Hardware to the WebA Practical Guide to Connecting Hardware to the Web
A Practical Guide to Connecting Hardware to the Web
 
Introdução ao Arduino
Introdução ao ArduinoIntrodução ao Arduino
Introdução ao Arduino
 
Minicurso arduino
Minicurso arduinoMinicurso arduino
Minicurso arduino
 
Incanter Data Sorcery
Incanter Data SorceryIncanter Data Sorcery
Incanter Data Sorcery
 
Rango
RangoRango
Rango
 
Fab.in.a.box - Fab Academy: Machine Design
Fab.in.a.box - Fab Academy: Machine DesignFab.in.a.box - Fab Academy: Machine Design
Fab.in.a.box - Fab Academy: Machine Design
 
The Digital Revolution: Machines that makes
The Digital Revolution: Machines that makesThe Digital Revolution: Machines that makes
The Digital Revolution: Machines that makes
 
Hadoop + Clojure
Hadoop + ClojureHadoop + Clojure
Hadoop + Clojure
 
Hadoop - Simple. Scalable.
Hadoop - Simple. Scalable.Hadoop - Simple. Scalable.
Hadoop - Simple. Scalable.
 
Hadoop and Hive Development at Facebook
Hadoop and Hive Development at FacebookHadoop and Hive Development at Facebook
Hadoop and Hive Development at Facebook
 
Multi-core Parallelization in Clojure - a Case Study
Multi-core Parallelization in Clojure - a Case StudyMulti-core Parallelization in Clojure - a Case Study
Multi-core Parallelization in Clojure - a Case Study
 

Dernier

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 

Dernier (20)

Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 

Distributed Objects: CORBA/Java RMI

  • 1. ECE 566- Parallel and Distributed Technology Distributed Objects: CORBA/Java RMI Manish Parashar parashar@ece.rutgers.edu Department of Electrical & Computer Engineering Rutgers University
  • 2. Distributed Objects: Goals • Let any object reside anywhere in the network, and allow an application to interact with these objects exactly in the same way as they do with a local objects • Provide the ability to construct an object on one host and transmit it to another host • Enable an agent on one host to create a new object on another host. Lecture 14 & 15 ECE 566 - Parallel and Distributed 2 Computing
  • 3. Distributed Objects: Operations • Locate remote object • Creating remote objects • Invoke methods on remote objects • Obtain results from a remote method invocation • Delete remote object Lecture 14 & 15 ECE 566 - Parallel and Distributed 3 Computing
  • 4. Distributed Objects: Properties • Object locator • Communication – data type – data representation – synchronous/asynchronous • State Persistence • Security • Reliability/Availability • Load Balancing Lecture 14 & 15 ECE 566 - Parallel and Distributed 4 Computing
  • 5. Java RMI • Components – Object Interfaces • extends the Remote interface – Server side implementation of the interface • extends the java.rmi.server.UnicastRemoteObject – RMI registry – rmic compiler for stub and skeleton generation • Others Issues – Serialization – Exception handling – Constructors Lecture 14 & 15 ECE 566 - Parallel and Distributed 5 Computing
  • 6. Java RMI: Object Interfaces import java.rmi.Remote; import java.rmi.RemoteException; public interface DataRetrieval extends Remote { String GetData() throws RemoteException; } Lecture 14 & 15 ECE 566 - Parallel and Distributed 6 Computing
  • 7. Java RMI: Server Implementation import DataRetrieval; import java.rmi.Naming; import java.rmi.RemoteException; import java.rmi.RMISecurityManager; import java.rmi.server.UnicastRemoteObject; public String GetData() import java.net.InetAddress; throws RemoteException { String client = null; public class DataRetrievalImpl extends UnicastRemoteObject try implements DataRetrieval { client = getClientHost(); { } private int call; catch(Exception e) { System.out.println(quot;exception: quot; + e); public DataRetrievalImpl() client = quot;unknownquot;; throws RemoteException } { call++; super(); System.out.println(client + quot; call = 0; request, data is:quot; + call); } return quot;data is:quot; + call; } Lecture 14 & 15 ECE 566 - Parallel and Distributed 7 Computing
  • 8. Java RMI: Server Implementation public static void main(String args[]) { System.out.println(quot;Started server...quot;); try { InetAddress host = InetAddress.getLocalHost(); String name = quot;//quot; + host.getHostName() + quot;/DataRetrievalquot;; System.out.println(quot;binding to quot; + name); System.setSecurityManager(new RMISecurityManager()); DataRetrievalImpl data = new DataRetrievalImpl(); Naming.rebind(name,data); } catch(Exception e) { System.out.println(quot;exception: quot; + e); } } } Lecture 14 & 15 ECE 566 - Parallel and Distributed 8 Computing
  • 9. Java RMI: Client import DataRetrieval; import java.rmi.Naming; public class DataRetrievalClient { public static void main(String[] args) { if (args.length != 1) { System.out.println(quot;Please give server namequot;); return; } try { DataRetrieval data = null; String name = quot;rmi://quot; + args[0] + quot;/DataRetrievalquot;; data = (DataRetrieval)Naming.lookup(name); String reply; reply = data.GetData(); System.out.println(quot;Got quot;+reply); } catch(Exception e) { System.out.println(quot;Exception quot;+e); } System.exit(0); } Lecture 14 & 15 ECE 566 - Parallel and Distributed 9 } Computing
  • 10. Java RMI: Registry/rmic • RMI registry serves the role of the object manager • % rmiregistry • % rmiregistry <port #> // default is 1099 • Addressing a remote object MyObject obj1 = (MyObject)Naming.lookup(“rmi://objecthost.myorg.com/Object1); MyObject obj1 = (MyObject)Naming.lookup(“rmi://objecthost.myorg.com:2099/Object1); • rmic compiler • rmic serversideimpl • generates client stub and server skeleton • bootstraps off java bytecode Lecture 14 & 15 ECE 566 - Parallel and Distributed 10 Computing
  • 11. CORBA • Object Request Broker (ORB) – enable clients and server objects to interact – provide servers • naming services, security services, … • Interface Definition Language (IDL) • Dynamic Invocation Interface (DII) – Interface repository • Internet Inter-Orb Protocol (IIOP) Lecture 14 & 15 ECE 566 - Parallel and Distributed 11 Computing
  • 12. CORBA Solver • Generate IDL description • Generate client stub • idltojava -f client Solver.idl • generates Base Interface, holder classes & client stubs package DCJ.examples; public class _SolverStub extends org.omg.CORBA.portable.ObjectImpl implements DCJ.examples.Solver { package DCJ.examples; public class _ProblemSetStub extends org.omg.CORBA.portable.ObjectImpl implements DCJ.examples.ProblemSet { Lecture 14 & 15 ECE 566 - Parallel and Distributed 12 Computing
  • 13. CORBA Solver • Generate server skeleton and implementation • idltojava -f server Solver.idl • generates abstract base class for remote implementation package DCJ.examples; public abstract class _ProblemSetImplBase extends org.omg.CORBA.portable.ObjectImpl implements DCJ.examples.ProblemSet, org.omg.CORBA.portable.Skeleton { package DCJ.examples; public abstract class _SolverImplBase extends org.omg.CORBA.portable.ObjectImpl implements DCJ.examples.Solver, org.omg.CORBA.portable.Skeleton { Lecture 14 & 15 ECE 566 - Parallel and Distributed 13 Computing
  • 14. CORBA Solver • Implement remote object • Implement client • Start name server • nameserve -ORBInitialport 1050 • Run Server • Run Client Lecture 14 & 15 ECE 566 - Parallel and Distributed 14 Computing