com.xenonsoft.bridgetown.examples.dvdrental
Class DefaultDVDFinder

java.lang.Object
  extended bycom.xenonsoft.bridgetown.examples.dvdrental.DefaultDVDFinder
All Implemented Interfaces:
IDVDFinder

public class DefaultDVDFinder
extends java.lang.Object
implements IDVDFinder

Default implementation of the DVD Finder interface for simplicity this class maintains its own XML database. The IoC Framework is set up to load this class as a Singleton so therefore only one copy of the finder and database should exist.

Version:
$Id: DefaultDVDFinder.java,v 1.4 2005/02/23 01:29:06 peter_pilgrim Exp $
Author:
Peter Pilgrim, 11-Aug-2004

Field Summary
static java.lang.String DEFAULT_XML_DATABASE_FILE
          Default database load filename
 
Constructor Summary
DefaultDVDFinder()
          Default constructor
 
Method Summary
 java.util.List findAll()
           
 java.util.List findByTitle(java.lang.String title)
           
 java.lang.String getDbFile()
          Gets the database file
 XMLMovieDatabase getXmldb()
          Gets the xml database
 void loadDatabase()
          Load database method is called by the IoC Framework (Method Injection)
 void setDbFile(java.lang.String dbFile)
          Sets the database file
 void setXmldb(XMLMovieDatabase xmldb)
          Sets the xml database.
 java.lang.String toString()
          Gets debuggable string
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DEFAULT_XML_DATABASE_FILE

public static final java.lang.String DEFAULT_XML_DATABASE_FILE
Default database load filename

See Also:
Constant Field Values
Constructor Detail

DefaultDVDFinder

public DefaultDVDFinder()
Default constructor

Method Detail

getDbFile

public java.lang.String getDbFile()
Gets the database file

Returns:
Returns the dbFile.

setDbFile

public void setDbFile(java.lang.String dbFile)
Sets the database file

Parameters:
dbFile - the new value for dbFile

getXmldb

public XMLMovieDatabase getXmldb()
Gets the xml database

Returns:
Returns the xmldb.

setXmldb

public void setXmldb(XMLMovieDatabase xmldb)
Sets the xml database. The IoC Framework injects the database property dependency into the finder.

Parameters:
xmldb - the new value for xmldb

loadDatabase

public void loadDatabase()
Load database method is called by the IoC Framework (Method Injection)


findAll

public java.util.List findAll()
Specified by:
findAll in interface IDVDFinder
Returns:
See Also:
IDVDFinder.findAll()

findByTitle

public java.util.List findByTitle(java.lang.String title)
Specified by:
findByTitle in interface IDVDFinder
Parameters:
title -
Returns:
See Also:
IDVDFinder.findByTitle(java.lang.String)

toString

public java.lang.String toString()
Gets debuggable string



Copyright © 2005 XeNoNSoFT.com. All Rights Reserved.