The License Plate Game (Assignment 4)


This is the second part of our CORBA-based programming assignment associated with the license plate game based on the TAO ORB.

Part One of the Assignment

In this part of the assignment, you'll enhance your previous CORBA license plate game program so that it uses AMI rather than SMI, a thread-per-connection or thread pool concurrency model rather than a reactive concurrency model, and an iterator rather than a vector of strings. As before, each client will have its own session, in which it will read commands from standard input and display the results from the server on its standard output. The commands will be sent to the server process, which will use a thread-per-connection or thread pool concurrency architecture to run commands and return results to each game session.

The license plate game server will be defined using two OMG IDL interfaces that should appear in the Game module. These two interfaces should be defined as follows:

For the first part of the assignment you need to do the following:

Part Two of the Assignment

In the second part of the assignment you'll actually implement the client and server application programs that actually perform the license plate game using CORBA. Below, we discuss the general behavior of these client and the server programs. See the course notes, the TAO online manual pages, and the Advanced CORBA Programming with C++ book for additional details.

Server Application

The license plate game server program should perform the following activities:
  1. Initializes the concurrency model of the ORB based on the contents of its svc.conf file.

  2. Initialize the ORB, get a locality constrained object reference for the RootPOA, and activate the POA manager.

  3. Create and activate an instance of the LP_Game_Factory object and write its object reference to a file. If you are a graduate student, please replace the use of the file to exchange object references with the CORBA Naming Service, which is implemented in TAO.

  4. Run the ORB's event loop, which will perform the appropriate operation designated by the type of operation received from the client. Naturally, you'll need to make sure that the game-specific resources used in your server are protected properly [ACE_RW_Thread_Mutex and/or ACE_Thread_Mutex] from race conditions resulting from multi-threading.

  5. You'll need to carefully reference count the number of threads that are accessing session resources so that your server behaves correctly when clients send quit() and shutdown() commands.

Client Application

The license plate game client program should perform the following activities:
  1. Initialize the ORB.

  2. Read the object reference for the LP_Game_Factory from a file and narrow it properly.

  3. Read commands from the user's standard input, convert these into the appropriate asynchronous operation calls to the LP_Game_Factory and LP_Game_Ex objects. It's recommended that you use a state machine on the client side to keep track of when you can invoke each operation, e.g., you can't invoke any operations on an LP_Game_Ex object until the reply for join() is received. Note that since the LP_Game_Factory::join() operation returns an LP_Game object reference you'll need to narrow this to an LP_Game_ExUse the ORB's event loop via the CORBA::ORB::work_pending() and CORBA::ORB::perform_work() operations to receive the reply and display it to the standard output of the client.

  4. When a client is finished playing the license plate game, it should call quit() so the server has a chance to reclaim the game resources.
If you're a graduate student, you should use the Makefile Project Creator (MPC) to generate the Makefiles or MSVC++ project files for the second part of the assignment. Also, please use the Naming Service, as well.

Concluding Remarks

I strongly encourage you to use, develop, and apply reusable C++ components based on the code you wrote for the earlier programming assignments.

Please see the online help for information on how to setup your development environment on Vanderbilt University's Linux computing system.