The Sun Certified Java Developer Exam with J2SE 5: paper version from Amazon, PDF from Apress, Online reference: Books 24x7 Personal blog
The Sun Certified Java Developer Exam with J2SE 5: paper version from Amazon, PDF from Apress, Online reference: Books 24x7 Personal blog
Originally posted by Andrew Monkhouse:
For the purposes of this test, I have set the lease value to 10 seconds. I recommend against doing this in your real assignment or in the real world.
Are you allowed to set this value in the assignment? I've got Unreferenced to work, but using the default value (whatever that is?) it doesn't seem to get called (unless its a very long time). How did everyone else implement the lease value for Unreferenced?
The Sun Certified Java Developer Exam with J2SE 5: paper version from Amazon, PDF from Apress, Online reference: Books 24x7 Personal blog
Looking for better solution...<br />SCJP1.4
1. if the client haven't accomplish the startClient function and died(i mean the client machine crash.suppose the server is running on another machine).so ,what will happend to the server?
2. if the client accomplish the startClient but unaccomplish the run function and died.also,what will happend to the server?
3. under the above two circs,would the server side's unreferenced function still be calld?why?
The Sun Certified Java Developer Exam with J2SE 5: paper version from Amazon, PDF from Apress, Online reference: Books 24x7 Personal blog
Once line 6 has executed, the client has a reference to an instance of MyServer. If ever the client releases that reference (explicitly sets the variable server to null, or exits, or crashes) then Unreferenced will be called the next time the distributed garbage collector runs following the lease expiring.
Looking for better solution...<br />SCJP1.4
Consider Paul's rocket mass heater. |