| UMBC | CSEE | Tarr | CS491D |
This application will require that both the client and server have remote objects. The server has a remote object which implements the following interface:
public interface AuctionServer extends Remote {
public void placeItemForBid(String ownerName, String itemName,
String itemDesc, double startBid, int auctionTime)
throws RemoteException;
public void bidOnItem(String bidderName, String itemName,
double bid) throws RemoteException;
public Item[] getItems() throws RemoteException;
public void registerListener(AuctionListener al, String itemName)
throws RemoteException
}
These methods do the following:
public void placeItemForBid(String ownerName, String itemName,
String itemDesc, double startBid, int auctionTime)
Puts a new item up for auction by the owner with name ownerName.
The itemName argument uniquely identifies the new item to be
auctioned. If an item by that name already is up for auction
on the server, a RemoteException is thrown. A description of
the item is given by the itemDesc argument. The starting
(minimum) bid is given by the startBid argument. The item
will be available for auction for the number of milliseconds
given by the auctionTime argument.
public void bidOnItem(String bidderName, String itemName, double bid)The bidder with name bidderName makes a new bid on the item specified by the itemName argument. The bid amount is specified by the bid argument. For the bid to be accepted it must be higher than the current bid on the specified item, else a RemoteException is thrown.
public Item[] getItems()Returns an array of items available for auction. Each Item object consists of the owner's name, item name, item description, current bid, current bidder's name and time remaining on the auction period for the item.
public void registerListener(AuctionListener al, String itemName)Registers a listener with the auction server for changes in the item specified by the itemName argument. Whenever the current bid on the specified item changes (or its auction period expires), the AuctionListener is notified via its update() method. Note that the AuctionListener object is a remote object!
Any client object which desires to be notified of changes in the bid status of a specific item must implement the following interface:
public interface AuctionListener extends Remote {
public void update(Item item) throws RemoteException;
}
The update() method of this interface does the following:
public void update(Item item)Invoked by the auction server for each AuctionListener which has registered to be notified of changes in the bid status of the specified item.
Implement the client interface any way you like, either textual or graphical.
Test your application with at least three auction items, two clients and the server.
Your project code must also be well documented and use a reasonable indentation style. In particular, places where design patterns are implemented should be noted in the code.
Finally, a short report, no more than five pages in length, should be submitted describing the design patterns that appear in your project, either as part of the RMI framework itself or explicitly as part of your server or client implementation.
As in all your work, NO COPYING OR PLAGIARISM. If such is detected, no credit for the project will be given and appropriate actions for academic dishonesty will be taken.
submit cs491d project2 <filenamelist>
where filenamelist is a list of one or more files. You can submit a
file as often as you like; the latest file submitted overwrites any
previous submissions. To list the names of the files you have submitted,
type
submitls cs491d project2
To remove a previously submitted file, type
submitrm cs491d project2 <filename>
No project will be accepted after December 11, 2000. NO EXCEPTIONS! NO EXCUSES!
|
Bob Tarr University of Maryland, Baltimore County tarr@umbc.edu | UMBC | CSEE | Tarr | CS491D |