Simple Rmi Program Using Netbeans For Php

  

A RMI application can be divided into two part,Client program and Server program. A Server program creates some remote object, make their references available for the client to invoke method on it. A Client program make request for remote objects on server and invoke method on them.

Description

Please see attached file for full program details and criteria:
Program Description:
You will use Java RMI to write a simple client-server application to play Lottery.
• The player should select 6 distinct numbers in the range 1-50 and
o Wins if any one of those numbers matches the single number generated at random on the server.
Summary of the Program:
You will have to:
• Define the remote methods to allow the client to send the numbers to the server.
• Implement these methods as a remote object.
• Write a client to invoke the remote methods.
• Use the rmic program to produce a stub and a skeleton.
• Use the rmiregistry tool to register the server.
Programming Criteria:
1. Defining the Interface
• Firstly define the server methods.
• The Lotto server receives and reads the list of numbers selected by the client.
• Then it checks that this list is valid (distinct numbers in the range 1-50):
o If not, return an error message to the client.
o If yes, make the lottery draw and see if the client has any winning numbers.
o Return the result to the client.
The SERVER is comprised of an INTERFACE and a CLASS.
• THE INTERFACE:
o Provides the definition for the methods that can be called from the client.
o Essentially the interface defines the client's view of the remote object.
• THE CLASS:
o Provides the implementation.
o Define these methods in a Java LottoInfo interface.
o Derive the interface from the Remote class or from java.io.Serializable interface (The interface must extend from java.rmi.Remote.
o All the method declarations must include the throws java.rmi.RemoteException clause).
2. Implementing the Remote Objects on the Server
Write the LottoInfoImpl class that implements the LottoInfo interface and the
LottoServer class that creates an object and registers it on the server.
1. Write the LottoInfoImpl class that contains the actual methods to receive the numbers.
2. Derive the class from the UnicastRemoteObject class
3. Create a LottoServer class with a method that creates a object. Register this object with the RMI remote object registry, name and bind it to a port using the Naming class and the rebind() method.
3. Programming the Client
Produce the LottoClient class that locates the server and invokes the remote methods.
The command to start the client will be
$ java LottoClient rmi://machine/remote_object
• Where the URL refers to the registry
o (Usually on the same machine that the server runs on, probably localhost).
Retrieve the remote object using the Naming class, by passing the use of the registry to the lookup() method. Then make the remote method call on this object.
4. Producing the Distributed Objects
Finally, compile and run the distributed objects:
1. Compile all the classes.
2. Your RMI java programs are only a part of the application.
a. It uses two other pieces of code called the stub and the skeleton. These reformat the method parameters and encapsulate them into a RMI data unit. Run the command rmic LottoInfoImpl to generate the stub and the skeleton.
3. Launch the registry rmiregistry.
a. Be sure to run the registry in the RMI server directory that contains the stub and skeleton.
4. Run the server and the client on a same machine and directory.
a. Then try to run the client and the server on two different machines.
Other Criteria:
• All coding should have comments written on them making the code easy to understand
• Source code should be included
• A small user guide to be included on how to use the program
• Using NetBeans to create the program (if possible)
• Simple program that fulfils all the points mentioned above in the Programming Criteria
1
1
0%

Netbeans Php Interpreter Windows

21 Feb 2012

New Proposal

Netbeans Php Tutorial For Beginners

Netbeans for php development

Create an account now and send a proposal now to get this project.

Netbeans Php Tutorial

Sign up