The assignment says:
Any unimplemented exceptions in this interface must all be created as member classes of the suncertify.db package.
"Java in a Nutshell" defines member classes this way:
A member class is a class that is declared as a non-static member of a containing class.
I just placed those exceptions (RecordNotFoundException, DuplicateKeyException, SecurityException) in package suncertify.db,
without making them inner classes to any containing class.
Did I violate this requirement ?
I do not think that the use of javax.ejb.DuplicateKeyException - is good. I think that we should make a new Exception.
I did as follows:
SecurityException already exists (in java.lang). RecordNotFoundException and DuplicateKeyException I have extends from java.lang.IllegalArgumentException.
A javax.ejb.DuplicateKeyException designed specifically for the EJB.
And as it turned out, the editor himself makes reference to the message.
David Kachen wrote:I did as follows:
SecurityException already exists (in java.lang).
Javadoc of the SecurityException says:
So i think you should create your own SecurityException instead of reusing this one (because your code will throw the exception and not a security manager)
Thrown by the security manager to indicate a security violation.