-offers one method getConnection()
-is bound as the ONLY RMI Object to the RMI registry
-returns a RemoteData object, which is constructed with
a reference to the server side Data member
-implemented the lock()/unlock() and changed signature to synchronized ...
-added a HasSet to track the locked records, but do not track who locked
(This would require a HashMap to store additional the callee reference)
The purpose of this class is to verify that only the owner who locked
also unlocks. The rest of the functionality is the same as the
locking mechanism in data class, but uses a HashMap for the key-value pair.
(key=callerID object reference used, value=record locked in db)
declares the business methods called by the GUI client
-getAllTitles() // returns table titles
-getOriginAirports() // returns all origin airports for search
-getDestinationAirports()// returns all destination airports for search
-book() // book a flight
-criteriaFInd() // do a search in the db
I do it in the data class because the requirements say ...
You did not implement the lock/unlock methods in the data class, did you loose points for this ?
I see your point , i could change the lock/unlock signature in data class to ...(Object callee, int record)
as in my LockManager and so forget the additional LockManager.
2.) Each RemoteData references the Lockmanager and calls lock/unlock when needed. In my Lockmanager
the signature would be somehting like : lock/ unlock (Object callee, int record) and simply stores the callee
reference this and its records.