edu.nmu.os.shell
Class ShellFactory

java.lang.Object
  |
  +--edu.nmu.os.shell.ShellFactory
Direct Known Subclasses:
ShellFactoryImpl

public abstract class ShellFactory
extends java.lang.Object

Creates Shells using the factory design pattern

Since:
jdk1.4
Version:
0.1, Jan 25, 2003 12:14:01 AM
Author:
Matt Murphy
See Also:
Shell

Constructor Summary
ShellFactory()
           
 
Method Summary
abstract  Shell createShell(java.lang.String[] args)
          Creates a new Shell as specified by the given arguments
static ShellFactory getFactory(java.lang.String name)
          Gets the ShellFactory specified by the given name
static ShellFactory registerFactory(java.lang.String name, ShellFactory sf)
          Registers the given ShellFactory under the given name
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ShellFactory

public ShellFactory()
Method Detail

getFactory

public static ShellFactory getFactory(java.lang.String name)
                               throws ShellFactoryException,
                                      java.lang.NullPointerException,
                                      java.lang.IllegalArgumentException
Gets the ShellFactory specified by the given name

Parameters:
name - the alias or fully qualified classname of the ShellFactory to get
Returns:
the ShellFactory specified by name
Throws:
ShellFactoryException - if the ShellFactory was not found
java.lang.NullPointerException - if name is null
java.lang.IllegalArgumentException - if name is the empty String

registerFactory

public static ShellFactory registerFactory(java.lang.String name,
                                           ShellFactory sf)
                                    throws java.lang.NullPointerException,
                                           java.lang.IllegalArgumentException
Registers the given ShellFactory under the given name

Parameters:
name - the name of the ShellFactory
sf - the ShellFactory to register
Returns:
the ShellFactory that was replaced, or null if this is the first registration under name
Throws:
java.lang.NullPointerException - if name is null
java.lang.IllegalArgumentException - if name is the empty String

createShell

public abstract Shell createShell(java.lang.String[] args)
                           throws ShellFactoryException
Creates a new Shell as specified by the given arguments

Parameters:
args - implementation specific arguments describing how the Shell should be created
Returns:
the Shell
Throws:
ShellFactoryException - if there is a problem creating the Shell