com.arsdigita.initializer
Class Startup

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

public class Startup
extends Object

Convenience class designed to run initializers. Either manually specify the values for web app root and script name, or set java properties with names WEB_APP_ROOT or SCRIPT_NAME.

Since:
ACS 4.7
Version:
$Revision: #11 $ $Date: 2004/04/07 $
Author:
Michael Bryzek, Dennis Gregorovic

Field Summary
static String SCRIPT_NAME
          The name of the property containing the script name
static String versionId
           
static String WEB_APP_ROOT
          The name of the property containing the web app root
 
Constructor Summary
Startup()
          Wrapper for Startup(String, String) which looks for the system properties named WEB_APP_ROOT and SCRIPT_NAME.
Startup(String webAppRoot, String scriptName)
          Sets up environment variables.
 
Method Summary
 void destroy()
          Shut down the startup script.
 Set init()
          Starts up the web environment for the ACS.
 void setLastInitializer(String lastInitializer)
          Sets the name of the last initializer to run.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

versionId

public static final String versionId
See Also:
Constant Field Values

WEB_APP_ROOT

public static final String WEB_APP_ROOT
The name of the property containing the web app root

See Also:
Constant Field Values

SCRIPT_NAME

public static final String SCRIPT_NAME
The name of the property containing the script name

See Also:
Constant Field Values
Constructor Detail

Startup

public Startup(String webAppRoot,
               String scriptName)
Sets up environment variables. Example:
 String scriptName = "/WEB-INF/resources/enterprise.init";
 String webAppRoot =
    "/usr/local/jakarta-tomcat-3.2.3/webapps/enterprise";

  Startup startup = new Startup(webAppRoot, scriptName);
  startup.init();

Parameters:
webAppRoot - The web app root to use (e.g. $TOMCAT_HOME/webapps/enterprise);
scriptName - The relative (from web app root) path to the script that defines the initializers (e.g. /WEB-INF/resources/enterprise.init)

Startup

public Startup()
        throws InitializationException
Wrapper for Startup(String, String) which looks for the system properties named WEB_APP_ROOT and SCRIPT_NAME.

Throws:
InitializationException - If we cannot find either property.
Method Detail

setLastInitializer

public void setLastInitializer(String lastInitializer)
Sets the name of the last initializer to run. If not set, all the initializers will run.

Parameters:
lastInitializer - The name of the last initializer to run (e.g. com.arsdigita.persistence.Initializer)

init

public Set init()
         throws InitializationException
Starts up the web environment for the ACS.

Returns:
Collection of the names of all initializers run.
Throws:
InitializationException

destroy

public void destroy()
Shut down the startup script.



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