I have code from previous assignments but need the code transformed to meet new criteria.
This week, we have been looking at using distributed objects to build networked applications. Your next programming assignment is to design and build the rental car management system from week 3 using Java RMI.
During Weeks 3 and 4, you implemented a distributed rental car management system using Java TCP Sockets and object streams. The goal of this project is to use code from your TCP project and create a new implementation of the rental car management system using Java RMI.
The basic design approach is based on the fact that the client will be interacting with the remote interface provided by a remote inventory manager object. The first step of this project is to define the remote interface provided by the inventory manager. The public methods provided by your existing inventory manager should form the basis for your remote interface specification. At most, minor changes should be needed. If you are passing messages into your inventory manager methods, you should consider that some of the items in your existing message class would not be needed in the RMI environment.
Once you have a remote interface defined, you should create a remote inventory class that implements the remote interface. This class will contain most of the code from the inventory manager of your previous assignment. This class must be built as an RMI object, so remember to do all the things necessary to create a remote object.
Next, create the object server for your remote inventory manager object. Here you may not be using any of the code from the server in your previous project. Remember, all a remote object server needs to do is create an instance of the remote object and register it with the RMI registry.
Finally, you will need to create the client for your remote object. For this, you will start with the client code from your previous project which includes all the GUI and event handling code. Remove all the socket and data stream variables and setup. In the constructor of the client, add code to acquire a reference to the remote inventory manager. In the event handler, instead of using object streams to send a message, you will simply invoke methods on the remote object and process the values returned by those method calls.