com.sri.emo.wizard.defaults
Class DefaultWizardRepository

java.lang.Object
  extended by com.sri.emo.wizard.defaults.DefaultWizardRepository
All Implemented Interfaces:
WizardRepository, Serializable
Direct Known Subclasses:
ExpressoAwareWizardRepository

public class DefaultWizardRepository
extends Object
implements WizardRepository, Serializable

Default instance of wizard repository. Stores factories and creates a new instance of each wizard when requested. This implementation is threadsafe. This is used for testing only.

Author:
Michael Rimov
See Also:
Serialized Form

Constructor Summary
DefaultWizardRepository()
          Default Constructor
 
Method Summary
 void addFactory(Serializable id, WizardFactory factory)
          Adds a factory to the repository.
 boolean equals(Object parm1)
           
 Wizard find(Serializable id)
          Retrieve a wizard based on id.
 int hashCode()
           
 List list()
          Retrieve instances of all wizards stored in the repository.
 void removeWizard(Serializable id)
          Removes a particular wizard from the repository.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DefaultWizardRepository

public DefaultWizardRepository()
Default Constructor

Method Detail

find

public Wizard find(Serializable id)
            throws WizardException
Description copied from interface: WizardRepository
Retrieve a wizard based on id.

Specified by:
find in interface WizardRepository
Parameters:
id - the identification field.
Returns:
Wizard instance.
Throws:
WizardException - upon repository query or wizard construction error.

list

public List list()
          throws WizardException
Description copied from interface: WizardRepository
Retrieve instances of all wizards stored in the repository.

Specified by:
list in interface WizardRepository
Returns:
java.util.List
Throws:
WizardException - upon listing or construction error.

addFactory

public void addFactory(Serializable id,
                       WizardFactory factory)
Description copied from interface: WizardRepository
Adds a factory to the repository. The interface will

Specified by:
addFactory in interface WizardRepository
Parameters:
id - the unique id of the wizard that we're going to hold.
factory - the factory to use for building new instances of Wizards

removeWizard

public void removeWizard(Serializable id)
Removes a particular wizard from the repository. Often more used for unit testing.

Specified by:
removeWizard in interface WizardRepository
Parameters:
id - the id of the wizard.

equals

public boolean equals(Object parm1)
Overrides:
equals in class Object

toString

public String toString()
Overrides:
toString in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object


Copyright © 2004-2006 Codeguild, Inc.. All Rights Reserved.