1)Shouldnt i also be throwing RemoteException in lock(),handling is seperatly from IOExceptio, which is what i am doing for all other methods throwing RemoteException?
2)The conversion of InterruptedException into IOException in RemoteData's lock() and then the conversion of this IOException into DatabaseException in Model ,and final handling of this Exception in Controller,is this an proper way of how to do it?
The Sun Certified Java Developer Exam with J2SE 5: paper version from Amazon, PDF from Apress, Online reference: Books 24x7 Personal blog
I don't quite understand where this lock() method is.
throwing of RemoteException by lock() method becomes redundant, what is the way out here?
The Sun Certified Java Developer Exam with J2SE 5: paper version from Amazon, PDF from Apress, Online reference: Books 24x7 Personal blog
If you want to throw RemoteException so that your controller can catch it, then you will have to catch it in your lock method and then rethrow it. This is easy enough. Or are you asking how to do this?
RemoteExceptions thrown in case of some remote error while trying to lock will be invariantly caught by my catch caluse for IOException in Model class and it is not possible to invoke the RemoteException catch clause this way
Also do let me know your opinion on my explanation of informing client of remote errors .
The Sun Certified Java Developer Exam with J2SE 5: paper version from Amazon, PDF from Apress, Online reference: Books 24x7 Personal blog
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime. |