com.arsdigita.initializer
Class Script

java.lang.Object
  extended bycom.arsdigita.initializer.Script

public class Script
extends Object

Script

Version:
$Revision: #21 $ $Date: 2004/04/07 $
Author:
rhs@mit.edu

Field Summary
static String versionId
           
 
Constructor Summary
Script(InputStream is)
          Constructs a new initialization script from the given input stream.
Script(InputStream is, String iniName)
           
Script(Reader r)
          Constructs a new initialization script from the given reader.
Script(Reader r, String iniName)
          Constructs a new Script
Script(String s)
          Constructs a new initialization script from the given string.
Script(StringBuffer bs)
          Constructs a new initialization script from the given string buffer.
Script(StringBuffer bs, String iniName)
           
Script(String s, String iniName)
           
 
Method Summary
 boolean addInitializer(Initializer ini)
          Adds an initializer to the script.
protected  void finalize()
           
 Initializer getInitializer(String name)
           
 List getInitializers()
          Returns all the initializers specified in this script.
static Script readConfig(Reader reader)
           
 void shutdown()
          Shuts down all initializers that this script contains.
 void shutdown(String iniName)
          Shuts down the specified initializer and any initializers it required in order to start.
 Set startup()
          Starts up all initializers that this script contains.
 Set startup(String iniName)
          Starts up the specified initializer and any initializers it requires in order to start.
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

versionId

public static final String versionId
See Also:
Constant Field Values
Constructor Detail

Script

public Script(StringBuffer bs)
       throws InitializationException
Constructs a new initialization script from the given string buffer.

Parameters:
bs - The script.

Script

public Script(StringBuffer bs,
              String iniName)
       throws InitializationException

Script

public Script(String s)
       throws InitializationException
Constructs a new initialization script from the given string.

Parameters:
s - The script.

Script

public Script(String s,
              String iniName)
       throws InitializationException

Script

public Script(InputStream is)
       throws InitializationException
Constructs a new initialization script from the given input stream.

Parameters:
is - The script.

Script

public Script(InputStream is,
              String iniName)
       throws InitializationException

Script

public Script(Reader r)
       throws InitializationException
Constructs a new initialization script from the given reader.

Parameters:
r - The script.

Script

public Script(Reader r,
              String iniName)
       throws InitializationException
Constructs a new Script

Parameters:
r - Reader for the script parser
iniName - Name of the last initializer to run, or null. Used to selectively run only part of the initialization script
Throws:
InitializationException
Method Detail

readConfig

public static final Script readConfig(Reader reader)
                               throws InitializationException
Throws:
InitializationException

addInitializer

public boolean addInitializer(Initializer ini)
                       throws InitializationException
Adds an initializer to the script.

Parameters:
ini - The initializer.
Returns:
true if the parser should continue adding initializers
Throws:
InitializationException

getInitializer

public Initializer getInitializer(String name)

getInitializers

public List getInitializers()
Returns all the initializers specified in this script.

Returns:
A list of initializers.

startup

public Set startup()
            throws InitializationException
Starts up all initializers that this script contains.

Throws:
InitializationException

startup

public Set startup(String iniName)
            throws InitializationException
Starts up the specified initializer and any initializers it requires in order to start.

Parameters:
iniName - The name of the initializer last to start. Note: This parameter is redundant, as if it is set in the constructor, only initializers up to the final one will be parsed.
Returns:
A Collection containing the names of all initalizers run
Throws:
InitializationException

shutdown

public void shutdown()
              throws InitializationException
Shuts down all initializers that this script contains.

Throws:
InitializationException

shutdown

public void shutdown(String iniName)
              throws InitializationException
Shuts down the specified initializer and any initializers it required in order to start.

Parameters:
iniName - The name of the initializer to stop.
Throws:
InitializationException

finalize

protected void finalize()
                 throws Throwable
Throws:
Throwable


Copyright (c) 2004 Red Hat, Inc. Corporation. All Rights Reserved. Generated at July 20 2004:2337 UTC