Download presentation
Presentation is loading. Please wait.
Published byJason Sanders Modified over 9 years ago
1
RMI Components java.rmi: client-side RMI classes, interfaces, and exceptions java.rmi.server: server-side RMI classes, interfaces, and exceptions java.rmi.registry: Classes for naming services java.rmi.dgc: distribute garbage collection
2
java.rmi.activation: Implements activate on demand RMI services. Objects instantiated on-demand by client-requests. References persistent over server crashes. rmic: compiler to generate stubs and skeletons rmiregistry: Utility server that provides naming service for RMI. Associates names with objects rmid: utility server to RMI activation framework
3
RMI Server Properties java.rmi.server.codebase: a url indicating code base from which classes should be loaded to network clients java.rmi.server.disableHttp: if true, RMI will not use Http to try to tunnel through firewalls. Default is false, meaning that Http wraps RMI calls
4
java.rmi.server.hostname: sets servers fully qualified host name, if name unavailable via DNS java.rmi.server.logCalls: if true, RMI will log information about calls. Default is false. java.rmi.dgc.leaseValue: The time in milliseconds until server notices client is no longer connected. Default is 10 minutes.
5
RMI Naming Methods Remote lookup(String name): Look up remote object by URL and return it bind(String name, Remote obj): bind an object to a specific URL unbind(String name): unbind an object at a URL rebind(String name, Remote obj): Replace the object currently bound with a new one String[] list(String name): list of URL’s from specified Registry
6
Creating RMI Application Create and compile remote object interface that extends java.rmi.Remote Implement a server application that contains a remote object class that implements your interface Compile the server application and run rmic to generate stubs classes.
7
Install the class files in a known location, such as web root directory. RMI by default uses web server to for sharing classes. Run rmiregistry on the server machine so it can manage remote objects Run the server application and have it install an instance of the remote object with a unique name in the registry. Implement a client application that connects to the server and looks up the remote object by name in a remote object registry. Compile, then Run client
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.