"carrier='speedyAir',"origin = 'SFA'"
I have 3 ComboBox in GUI and will be refreshed after calling the searchButton
Unreferenced gives you a chance to clean up for the remote object that is hanging around and holding locks on records that would otherwise never been unlocked.
But do I need to write the Unreferenced interface by myself,and whick class should I implements the interface,if so,how can I imple it?
Look forward your reply!
Thanks!
Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius - and a lot of courage - to move in the opposite direction. - Ernst F. Schumacher
Specifically, you should keep a set of owned locks for each of those remote connection objects and in the unreferenced() method, iterate thru that set and call unlock() on each.
No because you have three double quotes, so therefore one of the sets is not closed.
Why are your refreshing the comboboxes? There is no need for you to do that. The comboboxes I assume are the unique values of Carrier, etc.
so in unreferenced it got an iterator and iterated through the locks and unlocked the records it had locked.
I am confused: do every client has a HashSet to hold the its locked records,but each client only has a locked record,why use the HashSet for every client.
Maybe you means that:there is only one HashSet in ConnectionFactoryImpl class to hold the locked records and Client ID for all clients. And in unreferenced() method,I only need to iterate the HashSet,but how can I find the suitable locked record in the HashSet,because I donnot know the Cliend Id,this unreferenced() is invoked by RMI runtime!
Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius - and a lot of courage - to move in the opposite direction. - Ernst F. Schumacher
As a word,I defined a HashSet for every client and a HashMap for all clients.
Is right?
Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius - and a lot of courage - to move in the opposite direction. - Ernst F. Schumacher
I will have a HashSet which will store the locks of one client in the RemoteDataAccess.class
What is store the in the HashSet,object or record number?
swimming certificate (A & B), shoelaces diploma, and some useless java ones.
Consider Paul's rocket mass heater. |