Remote Method Invocation RMI IST 411 Lecture 8
- Slides: 17
Remote Method Invocation (RMI) IST 411 Lecture 8 Spring 2004
List § A collection is a data structure, an object, that can hold references to other objects. § One collections-framework interface is a List § Frameworks include a number of features that minimize the amount of coding programmers need to do to create and manipulate collections § Members of the package java. util. *
List § A List (sometimes called a sequence) is an ordered Collection that can contain duplicate elements § Index is zero based § Interface List may be implemented by class Array. List § Array. List is a resizable-array implementation of a List § Array. List execute faster than Vectors
Remote Method Invocation § Remote method invocation § Distributed systems technology § One JVM invokes object methods that will run on another JVM on a network § Used in development of large-scale systems § Distribute resources and processing load across multiple machines
Remote Method Invocation § Before object-oriented programming, technology used was Remote Procedure Calls (RPC). § Developed by Sun Microsystems § Designed as a platform-neutral way of communicating between applications § Operating system or language independent
Remote Method Invocation § Difference between RPC and RMI: § Java is platform-neutral language § Java applications conceivably able to communicate with Java applications running on any hardware or operating system that supports JVM § RMI only support applications written in Java § RPC supports multiple languages
Remote Method Invocation § RMI systems are divided into two categories: § Clients – invokes object methods of the server § Servers – provides an RMI service § RMI servers must register with a lookup service so clients can find them § Java platform has an application called rmiregistry which runs as a separate process § Allows applications to register RMI services
Remote Method Invocation § Once a server is registered, waits for incoming RMI requests from clients
Remote Method Invocation § RMI clients send RMI messages to invoke an object method remotely § Client needs remote object reference § Normally obtained from the RMI registry § Format of an RMI remote object reference: rmi: //hostname: port/servicename § Hostname represents name of a server (or IP address) § Port is the location of the service on that machine; default port number for RMI registry is 1099 § Servicename is a string description of the service
Remote Method Invocation § Networking details of requests are transparent to application developer § Remote objects seem like local objects § Achieved through division or RMI system into two components: § Stub – acts as a proxy object; RMI service is defined as an interface, not as an implementation § Skeleton – responsible for listening for incoming RMI requests and passing them on to the RMI service
Remote Method Invocation § The stub is derived by compiling the remote object class using the rmic compiler § Utility supplied with J 2 SE SDK § A stub class forwards method invocations to the RMI layer; performs network communication to invoke method call on the remote object § In Java 1. 1, rmic produced 2 classes – a stub class and a skeleton class § Java 2 no longer requires the skeleton class
Remote Method Invocation § Messages are sent between the stub and skeleton using TCP sockets § Skeleton listens for incoming socket requests § When stub passes a request, it must package parameters § Either primitive datatypes, objects, or both § Called data marshalling § Skeleton reconstitutes parameters…unmarshalling § Use specialized subclasses of Object. Output. Stream and Object. Input. Stream classes § Parameters are passed by value
Remote Method Invocation § RMI Service Interface § Service interface defines the object methods that can be invoked remotely § Specifies parameters, return types, and exception that may be thown § All RMI service interfaces extend java. rmi. Remote § Common exception is: throws java. rmi. Remote. Exception which could occur when the system is down
Compiling and Executing § Compiling and executing the server and client § Compile the classes § Compile the remote object class using the rmic compiler rmic –v 1. 2 <name of the Java file> § Start the RMI registry rmiregistry § Make the remote object available to receive remote method calls, bind the object to the name in the RMI registry java <application>
Compiling and Executing § Run the client program java <client program name> § If the remote application is running on a different machine from the client, you can specify the IP address or host name on the command-line java <client program name> <IP address>
- Rmi in java
- Distributed objects and remote invocation
- Distributed objects and remote invocation
- Distributed objects and remote invocation
- Ist 411
- Ist 411
- Ist 411
- Microwave remote sensing lecture notes
- Southville invocation
- What does satan vow
- Rotaract pledge and invocation
- Epigram figure of speech
- Eagle court of honor invocation
- Odyssey invocation
- Pediatric in tagalog
- Biba no read down
- 01:640:244 lecture notes - lecture 15: plat, idah, farad
- Winter kommt winter kommt flocken fallen nieder