The Policy file


Listing 13.5


grant {
	permission java.security.AllPermission;
};

The code for this example is complete.


How to compile and run this program


Compile Class Files

I am assuming that all source files are in a directory named "Lazy". Compile the source files using the command line:

c:\Lazy> javac *.java

 

Create Stub and Skeleton classes using RMIC

c:\Lazy> rmic LazyServerImpl

 

Start the Registry service

c:\Lazy> start rmiregistry

or

c:\Lazy> rmiregistry

 

Start the activation daemon

c:\Lazy>rmid -J-Djava.security.policy=policy.txt

You can view the Runrmid.bat file in the examples\Lazy directory to get help.


Run the setup

java -Djava.security.policy=policy.txt -Djava.rmi.server.codebase=file:/c:/Lazy/ Setup

You can view the RunSetup.bat file in the examples\Lazy directory to get help.


Run the client

java -Djava.security.policy=policy.txt Client

You can view the Runclient.bat file in the examples\Lazy directory to get help.

The result should be:

"HelloWorld!"

 


 

 

RMI BOOK MAIN PAGE                Top

  
Copyright © 2001 www.universalteacher.com