Java Reference
In-Depth Information
Listing 6-9. DvdDatabaseImpl.java
public class DvdDatabaseImpl extends UnicastRemoteObject
implements DvdDatabaseRemote {
/**
* A version number for this class so that serialization can occur
* without worrying about the underlying class changing between
* serialization and deserialization.
*/
private static final long serialVersionUID = 5165L;
/**
* The Logger instance. All log messages from this class are routed through
* this member. The Logger namespace is <code>sampleproject.remote</code>.
*/
private static Logger log = Logger.getLogger("sampleproject.remote");
/**
* The database handle.
*/
private DBClient db = null;
/**
* DvdDatabaseImpl default constructor
* @throws RemoteException Thrown if a <code>DvdDatabaseImpl</code>
* instance cannot be created.
*/
public DvdDatabaseImpl() throws RemoteException {
try {
db = new DvdDatabase();
} catch (FileNotFoundException e) {
throw new RemoteException(e.getMessage());
} catch (IOException e) {
throw new RemoteException(e.getMessage());
}
}
/**
* Returns the sampleproject.db.Dvd object matching the UPC.
*
* @param upc The upc code of the DVD to retrieve.
* @return The matching DVD object.
* @throws RemoteException Thrown if an exception occurs in the
* <code>DvdDatabaseImpl</code> class.
* @throws IOException Thrown if an <code>IOException</code> is
* encountered in the <code>db</code> class.
* <br>
* For more information, see {@link DvdDatabase}.
Search WWH ::




Custom Search