Forums Register Login

RemoteException and IOException

+Pie Number of slices to send: Send
Currenlty my lock method inside Data access Interface throws both java.rmi.RemoteException and java.io.IOException exceptions. And unlock does not throw IOException. Should unlock also throw both java.rmi.RemoteException and IOException. Or if these methods just throw IOExcpetion then it is fine.
Also does the data close method has to throw a IOException?
And does all the methods inside the Data access Interface has to throw DatabaseException, because not all methods inside Data class throws DatabaseException example getFieldInfo().
Thanks.
[ September 10, 2002: Message edited by: Samual Harvey ]
[ September 10, 2002: Message edited by: Samual Harvey ]
+Pie Number of slices to send: Send
Hi Samual,


Currenlty my lock method inside Data throws both java.rmi.RemoteException and java.io.IOException exceptions.


Actually you don't even have to throw RemoteException from lock() since RemoteException is an IOException.


... And unlock does not throw IOException. Should unlock also throw both java.rmi.RemoteException and IOException.


Nope. Just throw RemoteException in unlock(). unlock() simply ignores invalid requests by the requirements, so there is no need to throw IOException.


Also does the data close method has to throw a IOException?


Nope. The designer of Data has gone out of his way to ignore the possible IOException thrown by RandomAccessFile's close() method.
Hope this helps,
Michael Morris
+Pie Number of slices to send: Send
Michael,
How about this:-

And does all the methods inside the Data access Interface has to throw DatabaseException, because not all methods inside Data class throws DatabaseException example getFieldInfo().


Thanks.
+Pie Number of slices to send: Send
Hi Samual,
Nope. Just leave it like it is. Data has been designed to throw a DatabaseException whenever the RandomAccessFile cannot be accessed or when attempting to create or delete an invalid record.
Michael Morris
Stinging nettles are edible. But I really want to see you try to eat this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 663 times.
Similar Threads
Writing Data Client
Diffrent Excpetion thrown by Data class constructor & methods
FBN : Exception in High level Data Interface
Local and remote interfaces
Basic design for review
More...

All times above are in ranch (not your local) time.
The current ranch time is
Apr 16, 2024 09:57:34.