RMI Presentation - PowerPoint PPT Presentation

1 / 15
About This Presentation
Title:

RMI Presentation

Description:

RMI Presentation – PowerPoint PPT presentation

Number of Views:60
Avg rating:3.0/5.0
Slides: 16
Provided by: naj82
Category:
Tags: rmi | java | presentation

less

Transcript and Presenter's Notes

Title: RMI Presentation


1
RMI Presentation
2
Introduction
  • We are producing two main objects
  • The server object which will be composed of two
    main java programs
  • The program that represents the interface this
    program contains all of the prototypes of all of
    the functions that the object server can execute,
    and these prototypes represents the functions
    (services) offered by that object (the interface
    of that server).

3
  • Example
  • public interface someInterface
  • extends Remote // here we put all of the
    services
  • // i.e. all of the prototypes of the functoins
  • datatype somefunction (parameters)
  • throws RemoteException
  • // other prototypes.

4
  • We extends the previous interface from
    RemoteException, because failure might be from
  • Failure related problems.
  • Protocol errors.
  • Failure during linking and unlinking with server
    object.

5
  • The program that represents the implementation of
    the server services (functions) this program
    contains the implementations (bodies) of all of
    the functions (services) mentioned in the
    previous file (interface file)
  • For example
  • public class someClass extends UnicastRemoteObject
    implements someInteface
  • // we put here all of the bodies of all of the
    functions, also we put constructors.

6
  • Also including main() function which contains a
    code for creating the server object, and of
    course when it is created, all of its services
    will be ready for invocation. Also inside main()
    function we bind this object with a name in order
    to be used from clients objects.

7
  • The client object that composed from one main
    java program, this program contains all of the
    calling for needed functions that are provided
    from the server(s).
  • In the main() function of the client, we put the
    necessary code to link with the server object,
    using the IP address, or DNS name for the
    computer that holds that object.
  • After that we begin calling the functions of the
    server object.

8
Relationship
  • How the previous composition of java programs
    related to distributed systems???
  • When you have client objects and server objects
    on different computers, and when you begin
    calling methods (services) from servers by the
    clients, the execution of these methods will be
    on the PCs that contain the server objects.

9
  • Now, using the processor, memory, OS, etc., of
    these machines, when calling the servers
    functions will yield to composing a distributed
    system.

10
Working
  • In our example, HelloWorld we did the following
  • Create java programs.
  • Compile them ( javac .java).
  • Create stub and skeleton (rmic HelloServerImpl)
  • Start rmiRegistry, which is some how connecting
    clients with servers (start rmiRegistry)
  • Start server program (java HelloServerImple)
  • The previous steps are done completely on the PC
    that will hold the server object.

11
  • Compile Client program
  • Run client program.
  • The previous two steps done on the PC that will
    hold the client object.

12
Some Terms
  • A remote object is the one whose methods can be
    invoked from other objects( clients).
  • A remote interface is the interface that
    contains all of the methods (declaration) that
    will be provided be the remote objects.

13
  • Stubs and Skeletons when a client obtains a
    reference for a remote object, the remote object
    is not sent over the network to the client.
    Actually the clients gets a proxy or a stub. A
    stub acts as clients local representative for
    the remote object. The client invokes a method on
    the local stub, and the stub is responsible for
    calling the method on the remote object.

14
  • The skeleton is the server side proxy for the
    remote object. It is much like the stub class but
    resides on the server. The skeleton is
    responsible for calling the actual remote object
    implementation.

15
(No Transcript)
Write a Comment
User Comments (0)
About PowerShow.com