Originally posted by David Winters Junior:
in the lock() and unlock() methods i do not provide any details within these methods.
Do you mean you didn't write any javadoc for these 2 methods in your Data.java ? What do you mean by "provide any details within these methods" ?
I use a LockManager class to encapsulate the reserving/releasing of records.This class is then used by a facade class which call methods within the LockManager class to do the locking/unlocking of records. Is this okay to do once it is documented or will it be an automatic fail if i do this.
So your lock and unlock methods are using a LockManager. This is fine, your Data object is allowed to use
java objects to perform its tasks..
The constraint is to respect the interface provided by SUN, how it is implemented is up to you.
Also in the interface specification, unlock() and unlock() methods throw a RecordNotFoundException,is it okay to call further exceptions from these methods within my LockManager class or should i adhere to the method declaration with the interface specification.
Inside lock and unlock (the other methods also) you can handle any exception you want/need to.. However, since you comply with the interface provided by SUN, lock/unlock.. cannot throw other exception than the one specified.
Here's a dummy example nothing close to what's need to be done, simply to demonstrate the use of Exception..
You can handle exception in your method, but you can only throw RecordNotFoundException.
On top of that, you can always throw RuntimeException or subclasses of RecordNotFoundException.
Hope this helps
Alex