Java Reference
In-Depth Information
* @throws IOException Indicates there is a problem accessing the data.
*/
public List<DVD> getDVDs() throws IOException;
/**
* A properly formatted <code>String</code> expressions returns all
* matching DVD items. The <code>String</code> must be formatted as a
* regular expression.
*
* @param query The formatted regular expression used as the search
* criteria.
* @return The list of DVDs that match the query. Can be an empty
* Collection.
* @throws IOException Indicates there is a problem accessing the data.
* @throws PatternSyntaxException Indicates there is a syntax problem in
* the regular expression.
*/
public Collection<DVD> findDVD(String query)
throws IOException, PatternSyntaxException;
/**
* Lock the requested DVD. This method blocks until the lock succeeds,
* or for a maximum of 5 seconds, whichever comes first.
*
* @param UPC The UPC of the DVD to reserve
* @throws InterruptedException Indicates the thread is interrupted.
* @throws IOException on any network problem
*/
boolean reserveDVD(String UPC) throws IOException, InterruptedException;
/**
* Unlock the requested record. Ignored if the caller does not have
* a current lock on the requested record.
*
* @param UPC The UPC of the DVD to release
* @throws IOException on any network problem
*/
void releaseDVD(String UPC) throws IOException;
}
To complete an RMI implementation we need one more class. The class that actually
implements the remote interface is displayed in Listing 6-9. Most of the code has been omit-
ted for brevity, but the unexpurgated version can be viewed in the project download from the
Source Code section of the Apress website. One of the important things to note is that we
extend UnicastRemoteObject rather than Activatable . We also implement DVDDatabaseRemote .
This will ensure that the proper methods are implemented.
Search WWH ::




Custom Search