The structure of Java RMI - Universidad de...

Preview:

Citation preview

+

The structure of Java RMI

Brief introduction to the internal structure of Java RMI

V 0.1 © 2014 José María Foces Morán. All rights reserved

+ Java RMI needs three hosts: The Client, The Server and the Web server

V 0.1 © 2014 José María Foces Morán. All rights reserved

2

Apache2 web serverpaloalto.unileon.es

· Server program· rmiregistry· Remote Objectprotocol.unileon.es

Client hostclient.unileon.es

+ Java RMI needs three hosts: The Client, The Server and the Web server

V 0.1 © 2014 José María Foces Morán. All rights reserved

3

Apache2 web serverpaloalto.unileon.es

· Server program· rmiregistry· Remote Objectprotocol.unileon.es

Client hostclient.unileon.es

Creates and runs the remote object

+ Java RMI needs three hosts: The Client, The Server and the Web server

V 0.1 © 2014 José María Foces Morán. All rights reserved

4

Apache2 web serverpaloalto.unileon.es

· Server program· rmiregistry· Remote Objectprotocol.unileon.es

Client hostclient.unileon.es

Creates and runs the remote object

Server

+ Java RMI needs three hosts: The Client, The Server and the Web server

V 0.1 © 2014 José María Foces Morán. All rights reserved

5

Apache2 web serverpaloalto.unileon.es

· Server program· rmiregistry· Remote Objectprotocol.unileon.es

Client hostclient.unileon.es

Creates and runs the remote object

ServerRemote Object Impl

+ Java RMI needs three hosts: The Client, The Server and the Web server

V 0.1 © 2014 José María Foces Morán. All rights reserved

6

Apache2 web serverpaloalto.unileon.es

· Server program· rmiregistry· Remote Objectprotocol.unileon.es

Client hostclient.unileon.es

Creates and runs the remote object

ServerRemote Object Impl

Records remote objects names...

rmiregistry

+ Java RMI needs three hosts: The Client, The Server and the Web server

V 0.1 © 2014 José María Foces Morán. All rights reserved

7

Apache2 web serverpaloalto.unileon.es

· Server program· rmiregistry· Remote Objectprotocol.unileon.es

Client hostclient.unileon.es

Creates and runs the remote objectServer

Remote Object Impl

Records remote objects names...

rmiregistryAslan - TCP port 1234

registers new object into remiregistry

TCP port 1234

+ Java RMI needs three hosts: The Client, The Server and the Web server

V 0.1 © 2014 José María Foces Morán. All rights reserved

8

Apache2 web serverpaloalto.unileon.es

· Server program· rmiregistry· Remote Objectprotocol.unileon.es

Client hostclient.unileon.es

ServerRemote Object Impl

rmiregistryAslan - TCP port 1234

TCP port 1234

Client

+ Java RMI needs three hosts: The Client, The Server and the Web server

V 0.1 © 2014 José María Foces Morán. All rights reserved

9

Apache2 web serverpaloalto.unileon.es

· Server program· rmiregistry· Remote Objectprotocol.unileon.es

Client hostclient.unileon.es

ServerRemote Object Impl

rmiregistryAslan - TCP port 1234

TCP port 1234

Client

Lookup "Aslan" at protocol.unileon.es's rmiregistry

+ Java RMI needs three hosts: The Client, The Server and the Web server

V 0.1 © 2014 José María Foces Morán. All rights reserved

10

Apache2 web serverpaloalto.unileon.es

· Server program· rmiregistry· Remote Objectprotocol.unileon.es

Client hostclient.unileon.es

ServerRemote Object Impl

rmiregistryAslan - TCP port 1234

TCP port 1234

Client

Remote object's STUB

+ Java RMI needs three hosts: The Client, The Server and the Web server

V 0.1 © 2014 José María Foces Morán. All rights reserved

11

Apache2 web serverpaloalto.unileon.es

· Server program· rmiregistry· Remote Objectprotocol.unileon.es

Client hostclient.unileon.es

ServerRemote Object Impl

rmiregistryAslan - TCP port 1234

TCP port 1234

Client

Remote object's STUB

+ Java RMI needs three hosts: The Client, The Server and the Web server

V 0.1 © 2014 José María Foces Morán. All rights reserved

12

Apache2 web serverpaloalto.unileon.es

· Server program· rmiregistry· Remote Objectprotocol.unileon.es

Client hostclient.unileon.es

ServerRemote Object Impl

rmiregistryAslan - TCP port 1234

TCP port 1234

ClientRemote object's STUB

+ Java RMI needs three hosts: The Client, The Server and the Web server

V 0.1 © 2014 José María Foces Morán. All rights reserved

13

Apache2 web serverpaloalto.unileon.es

· Server program· rmiregistry· Remote Objectprotocol.unileon.es

Client hostclient.unileon.es

Interface class file must be

copied to the web server

ServerRemote Object Impl

rmiregistryAslan - TCP port 1234

TCP port 1234

ClientRemote object's STUB

Remote object's interface

+ Java RMI needs three hosts: The Client, The Server and the Web server

V 0.1 © 2014 José María Foces Morán. All rights reserved

14

Apache2 web serverpaloalto.unileon.es

· Server program· rmiregistry· Remote Objectprotocol.unileon.es

Client hostclient.unileon.es

ServerRemote Object Impl

rmiregistryAslan - TCP port 1234

TCP port 1234

ClientRemote object's STUB

Remote object's interface

Access interface's class filefor finishing the the Stub

+ Java RMI needs three hosts: The Client, The Server and the Web server

V 0.1 © 2014 José María Foces Morán. All rights reserved

15

Apache2 web serverpaloalto.unileon.es

· Server program· rmiregistry· Remote Objectprotocol.unileon.es

Client hostclient.unileon.es

ServerRemote Object Impl

rmiregistryAslan - TCP port 1234

TCP port 1234

ClientRemote object's STUB

Remote object's interface

Client invokes STUB methods

+ Java RMI needs three hosts: The Client, The Server and the Web server

V 0.1 © 2014 José María Foces Morán. All rights reserved

16

Apache2 web serverpaloalto.unileon.es

Client hostclient.unileon.es

ServerRemote Object Impl

TCP port 1234

ClientRemote object's STUB

Remote object's interface

STUB speaks RMI protocol with remote object

parameters

return value

Recommended