written 7.7 years ago by | • modified 7.7 years ago |
Mumbai University > Information Technology > Sem 6 > Distributed System
Marks: 5 Marks
Year: May 2016
written 7.7 years ago by | • modified 7.7 years ago |
Mumbai University > Information Technology > Sem 6 > Distributed System
Marks: 5 Marks
Year: May 2016
written 7.7 years ago by |
The Java RMI (Remote Method Invocation) is a package for writing and executing distributed Java programs. The Java RMI provides a framework for developing and running servers (server objects). The services (methods) provided by those server objects can be accessed by clients in a way similar to method invocation. I.e. Java RMI hides almost all aspects of the distribution and provides a uniform way by which objects (distributed or not) may be accessed.
Writing Java programs using RMI can be described by the following steps:
Executing distributed Java programs using RMI can be described by the following steps:
Running the example.
The first thing to do when running Java programs using RMI is to start the rmi registry:
install:~> rmiregistry &
[1] 1449
install:~>
Next, the server must be started:
install:~> java examples.rmi.RMIServer
Registering as: "RMIServer"
RMIServer ready...
Finally, the client may be started and the setup tested:
install:~> java examples.rmi.RMIClient install.cs.aau.dk
Looking up: rmi://install.cs.aau.dk/RMIServer
String in server: Foobar
install:~>
(where install is the name of the machine you are using)
In case you are getting security errors, the following small hack should be able to deal with it. Put the following peice of text in a file called Grant.java and place it in the working directory:
grant
{
permission java.security.AllPermission;
};
And use it in the following way:
java -Djava.security.policy=Grant.java
examples.rmi.RMIClient install.cs.aau.dk