Questions and Answers. A. RMI allows us to invoke a method of java object that executes on another machine.

Similar documents
JAVA RMI. Remote Method Invocation

Outline. EEC-681/781 Distributed Computing Systems. The OSI Network Architecture. Inter-Process Communications (IPC) Lecture 4

SUMMARY INTRODUCTION REMOTE METHOD INVOCATION

Distributed Systems. 02r. Java RMI Programming Tutorial. Paul Krzyzanowski TA: Long Zhao Rutgers University Fall 2017

RMI (Remote Method Invocation) Over the year, there have been 3 different approaches to application development:

IBD Intergiciels et Bases de Données

Contents. Java RMI. Java RMI. Java RMI system elements. Example application processes/machines Client machine Process/Application A

Object Interaction. Object Interaction. Introduction. Object Interaction vs. RPCs (2)

Introduction & RMI Basics. CS3524 Distributed Systems Lecture 01

Remote Method Invocation in Java

Grid Computing. Java Remote Method Invocation (RMI) RMI Application. Grid Computing Fall 2006 Paul A. Farrell 9/5/2006

JAC444 - Lecture 11. Remote Method Invocation Segment 2 - Develop RMI Application. Jordan Anastasiade Java Programming Language Course

Generic architecture

Chapter 15: Distributed Communication. Sockets Remote Procedure Calls (RPCs) Remote Method Invocation (RMI) CORBA Object Registration

Remote Objects and RMI

Distributed Systems. Distributed Object Systems 2 Java RMI. Java RMI. Example. Applet continued. Applet. slides2.pdf Sep 9,

Distributed Systems COMP 212. Lecture 10 Othon Michail

Remote Procedure Call

Agent and Object Technology Lab Dipartimento di Ingegneria dell Informazione Università degli Studi di Parma. Distributed and Agent Systems RMI

DISTRIBUTED OBJECTS AND REMOTE INVOCATION

03 Remote invocation. Request-reply RPC. Coulouris 5 Birrel_Nelson_84.pdf RMI

Distributed Objects SPL/ SPL 201 / 0 1

Remote Method Invocation

Last Class: Network Overview. Today: Distributed Systems

CC755: Distributed and Parallel Systems

presentation DAD Distributed Applications Development Cristian Toma

5 Distributed Objects: The Java Approach

CS 5523 Operating Systems: Remote Objects and RMI

Distributed Systems. 5. Remote Method Invocation

Remote Method Invocation

JAVA RMI Java, summer semester

RMI. (Remote Method Invocation)

Distributed Computing

5.4. Events and notifications

Desarrollo de Aplicaciones en Red RMI. Introduction. Considerations. Considerations. RMI architecture

RMI Case Study. A Typical RMI Application

The UNIVERSITY of EDINBURGH. SCHOOL of INFORMATICS. CS4/MSc. Distributed Systems. Björn Franke. Room 2414

CS555: Distributed Systems [Fall 2017] Dept. Of Computer Science, Colorado State University

Distributed Programming in Java. Distribution (2)

Lecture 5: Object Interaction: RMI and RPC

RMI: Design & Implementation

Course Snapshot. The Next Few Classes. Parallel versus Distributed Systems. Distributed Systems. We have covered all the fundamental OS components:

RMI Example RMI. CmpE 473 Internet Programming RMI

Course Snapshot. The Next Few Classes

Info 408 Distributed Applications programming 2 nd semester of Credits: 5 Lecturer: Antoun Yaacoub Ph.D.

IJESRT. http: //

Lecture VI: Distributed Objects. Remote Method Invocation

Verteilte Systeme (Distributed Systems)

DISTRIBUTED COMPUTING

Distributed Programming with RMI. Overview CORBA DCOM. Prepared By: Shiba R. Tamrakar

Written by: Dave Matuszek

Lecture 18 Inside Java RMI

Distributed Systems. 6. Remote Method Invocation. Werner Nutt

A Typical RMI Application

A Typical RMI Application. Case Study

RMI. Remote Method Invocation. 16-Dec-16

Last Class: RPCs. Today:

Structured communication (Remote invocation)

Distributed Systems Recitation 3. Tamim Jabban

THE RMI PROXY USER GUIDE

Distributed object component middleware I - Java RMI

Distributed object component middleware I - Java RMI

Chapter 5 Distributed Objects and Remote Invocation

COMMUNICATION PROTOCOLS: REMOTE PROCEDURE CALL (RPC)

Message Passing vs. Distributed Objects. 5/15/2009 Distributed Computing, M. L. Liu 1

Reflection/RMI 4/28/2009

Programming with RMI Reminder

CSci Introduction to Distributed Systems. Communication: RPC In Practice

03 Remote invoaction. Request-reply RPC. Coulouris 5 Birrel_Nelson_84.pdf RMI

Java Programming Language Advance Feature

Distributed Software Systems

Lecture 17 Java Remote Method Invoca/on

COMP 6231: Distributed System Design

Remote Method Invocation

Communication Basics, RPC & RMI. CS403/534 Distributed Systems Erkay Savas Sabanci University

Chapter 4 Remote Procedure Calls and Distributed Transactions

How are classes loaded into the Java Virtual Machine (JVM)? from the local file system (CLASSPATH). by an instance of ClassLoader

Communication and Distributed Processing

Java RMI Activation: A running example We have the following classes: MyRemoteInterface: the remote interface. Client: the client that invokes a

Java Remote Method Invocation Specification

Lecture 06: Distributed Object

Distributed Objects and Remote Invocation. Programming Models for Distributed Applications

Communication and Distributed Processing

RPC and RMI. 2501ICT Nathan

55:182/22C:182. Distributed Application Frameworks Java RMI, CORBA, Web Services (SOAP)

Bharati Vidyapeeth s Institute of Computer Applications and Management A-4, Paschim Vihar, New Delhi-63.

REMOTE METHOD INVOCATION INTRODUCTION TO RMI, A JAVA API FOR RPC-STYLE INVOCATION OF REMOTE OBJECT METHODS

COMP 6231 Distributed Systems Design. Tutorial 2 by Alexandre Hudon January 21 st, 2013

Component-Based Software Engineering


Remote Method Invocation. Benoît Garbinato

Remote Method Invocation Benoît Garbinato

Advanced Java Programming. Networking

RPC flow. 4.3 Remote procedure calls IDL. RPC components. Procedure. Program. sum (j,k) int j,k; {return j+k;} i = sum (3,7); Local procedure call

Java RMI Middleware Project

Distributed Systems Lecture 2 1. External Data Representation and Marshalling (Sec. 4.3) Request reply protocol (failure modes) (Sec. 4.

Distributed Objects. Remote Method Invokation

Remote Method Invocation R.M.I.

Dynamic code downloading using Java TM (Using the java.rmi.server.codebase Property)

Are Sockets a Good Programming Paradigm? EDA095 Remote Method Invocation. The Remote Procedure Call Model. The Remote Procedure Call Architecture

Transcription:

Q.1) What is Remote method invocation (RMI)? A. RMI allows us to invoke a method of java object that executes on another machine. B. RMI allows us to invoke a method of java object that executes on another Thread in multithreaded programming. C. RMI allows us to invoke a method of java object that executes parallely in same machine. D. None of the mentioned ANSWER : RMI allows us to invoke a method of java object that executes on another machine. Remote method invocationor RMI allows us to invoke a method of java object that executes on another machine.. Q.2) Java is designed for the distributed environment of the Internet, because it handles protocols A. UDP B. TCP/IP C. FTP D. TEL ANSWER : TCP/IP TCP is a connection-oriented transport protocol that sends data as an unstructured stream of bytes. By using sequence numbers and acknowledgment messages, TCP can provide a sending node with delivery information about packets transmitted to a destination node. Where data has been lost in transit from source to destination, TCP can retransmit the data until either a timeout condition is reached or until successful delivery has been achieved. T CP can also recognize duplicate messages and will discard them appropriately. If the sending computer is transmitting too fast for the receiving computer, TCP can employ flow control mechanisms to slow data transfer. TCP can also communicates delivery information to the upper-layer protocols and applications it supports. All these characteristics makes TCP an end-to-end reliable transport protocol. Q.3) RMI is about. A. Accessing remote objects and invoking methods from remote objects. B. java.lang.cloneable C. Passing objects between a server and a client D. Passing primitive data between a server and a client ANSWER : Accessing remote objects and invoking methods from remote objects. In the Java distributed object model, a remote object is one whose methods can be invoked from another Java Virtual Machine, potentially on a different host. An object of this type is described by one or more remote interfaces, which are Java interfaces that declare the methods of the remote object. Remote method invocation (RMI) is the action of invoking a method of a remote interface on a remote object. Most importantly, a method invocation on a remote object has the same syntax as a method invocation on a local object. Q.4) Java support RMI. What does this RMI stands for? A. Random Memory Interface Page 1

B. Remote Method Invocation C. Random Method Invocation D. Remote Memory Interface ANSWER : Remote Method Invocation Remote Method Invocation (Java RMI) enables the programmer to create distributed Java technology-based to Java technology-based applications, in which the methods of remote Java objects can be invoked from other Java virtual machines*, possibly on different hosts. RMI uses object serialization to marshal and unmarshal parameters and does not truncate types, supporting true object-oriented polymorphism. Q.5) A remote object must be an instance of. A. java.rmi.remote B. java.rmi.remoteobject C. java.io.serializable D. java.lang.cloneable ANSWER : java.rmi.remote All remote interfaces extend, either directly or indirectly, the interface java.rmi.remote. Q.6) is a subinterface of java.rmi.remote that defines the methods for the server object. A. Server stub B. Server implementation C. Server object interface D. RMI Registry ANSWER : Server object interface The java.rmi.remote interface serves to identify all remote objects, any object that is a remote object must directly or indirectly implement this interface. All remote interfaces must be declared public. Q.7) Assume that the file named policy contains the permission for registering a remote object with an RMI registry. To run the program (e.g., RegisterWithRMIServer) that registers a remote object with an RMI registry, use the command from the command window. A. java RegisterWithRMIServer B. java java.security.policy=policy RegisterWithRMIServer C. java policy=policy RegisterWithRMIServer D. java RegisterWithRMIServer java java.security.policy=policy ANSWER : java java.security.policy=policy RegisterWithRMIServer The java.security.policy property, which is used to specify the security policy file that contains the permissions you intend to grant to various pieces of code. Q.8) The is used to handle the errors that may occur during the invocation of a Remote method. Remote Method Invocation uses Protocol A. Interface,TCP B. Exception,TCP C. Exception,UDP D. Interface,UDP Page 2

ANSWER : Exception,TCP There is diffrent type of Exception in RMI they are: 1.Exceptions During Remote Object Export 2.Exceptions During RMI Call 3.Exceptions or Errors During Return 4.Naming Exceptions These type of exception can occur during invocation of the remote method. Q.9) Which of these methods are member of Remote class? A. checkip() B. addlocation() C. AddServer() D. None of the mentioned ANSWER : None of the mentioned Remote class does not define any methods, its pupose is simply to indicate that an interface uses remote methods. Q.10) is a utility that registers remote objects and provides naming services for locating objects. A. Server stub B. Server object interface C. Server implementation D. RMI Registry ANSWER : RMI Registry The java.rmi.naming class allows remote objects to be retrieved and defined using the familiar Uniform Resource Locator (URL) syntax. The URL consists of protocol, host, port and name fields. The Registry service on the specified host and port is used to perform the specified operation. Q.11) To start an RMI registry, use from the command window. A. rmiregistry B. start rmiregistry C. rmiregistry 7000 D. start rmiregistry 7000 ANSWER : start rmiregistry,start rmiregistry 7000 To start the registry on the server, execute the rmiregistry command. This command produces no output and is typically run in the background. For example, on Windows 95 or Windows NT: start rmiregistry The registry by default runs on port 1099. To start the registry on a different port, specify the port number in the command. For example, to start the registry on port 7000 on Windows NT: start rmiregistry 7000 Q.12) What is the output of this program? import java.lang.reflect.*; class Additional_packages { public static void main(string args[]){ try { Page 3

Class c = Class.forName("java.awt.Dimension"); Constructor constructors[] = c.getconstructors(); for (int i = 0; i < constructors.length; i++) System.out.println(constructors[i]); catch (Exception e) { System.out.print("Exception"); A. Program prints all the constructors of java.awt.dimension package. B. Program prints all the possible constructors of class Class. C. Program prints Exception D. Runtime Error ANSWER : Program prints all the constructors of java.awt.dimension package. Output: $ javac Additional_packages.java $ java Additional_packages public java.awt.dimension(java.awt.dimension) public java.awt.dimension() public java.awt.dimension(int,int) Q.13) is an object that resides on the client host and serves as a surrogate for the remote server object. A. Server object interface B. Server implementation C. Server Skeleton D. Server stub ANSWER : Server stub A stub for a remote object is the client-side proxy for the remote object. Such a stub implements all the interfaces that are supported by the remote object implementation. The client invokes a method that is offered by the server. The invocation is received by the stub. The stub arranges the request and data in a linear stream. This is known as marshalling and sends that information to the machine that the server resides on. Q.14) is a class that implements the remote object interface. A. Server object interface B. Server Skeleton C. Server stub D. Server implementation ANSWER : Server implementation The java.rmi.registry.registry remote interface provides methods for lookup, binding, rebinding, unbinding, and listing the contents of a registry. The java.rmi.naming class uses the registry remote interface to provide URL based naming. package java.rmi.registry; Q.15) Which of these Exceptions is thrown by remote method? A. RemoteException Page 4

B. RemoteException C. RemoteAccessException D. RemoteInputOutputException ANSWER : RemoteException All remote methods throw RemoteException.A RemoteException is the common superclass for a number of communication-related exceptions that may occur during the execution of a remote method call. Each method of a remote interface, an interface that extends java.rmi.remote, must list RemoteException in its throws clause. Q.16) At Client, remote object proxy is termed as A. Stub B. RemoteRef C. Skeleton D. Skeleton ANSWER : Stub In Client Server architecture remote object proxy is called Stub. b) RemoteRef : The Remote reference layer provides RemoteRef object that represents link to remote service implementation object. c) Skeleton is a helper class that is used how to communicate with stub across RMI link. Page 5