com.arsdigita.runtime
Class Startup

java.lang.Object
  extended bycom.arsdigita.runtime.CompoundInitializer
      extended bycom.arsdigita.runtime.Startup
All Implemented Interfaces:
Initializer

public class Startup
extends CompoundInitializer

An entry point initializer for the CCM runtime. This class may be used to bootstrap the CCM runtime environment into a state where it is safe to perform database I/O. It does this by accessing a persistent list of all the initializers required by the currently loaded packages. This guarantees that any of these packages has the opportunity to load any object-relational metadata and register any domain-data coupling metadata before any database I/O is performed.

Version:
$Id: //core-platform/dev/src/com/arsdigita/runtime/Startup.java#13 $
Author:
Rafael Schloming <rhs@mit.edu>, Justin Ross <jross@redhat.com>

Field Summary
static String versionId
           
 
Constructor Summary
Startup()
          Constructs a new startup by defaulting the connection source to a dedicated connection source that uses the JDBC URL specified by the waf.runtime.jdbc_url parameter.
Startup(ConnectionSource source)
          Prepares a startup object with a list of child Initializers to run in order to initialize the runtime.
 
Method Summary
protected  void addRuntimeInitializers()
           
protected  Collection getRuntimeInitializerNames()
          Fetches the names of initializers loaded into the database.
static boolean hasRun()
           
static void main(String[] args)
           
 void run()
          Executes the initialization process using the default session and global metadata root.
static void run(Session session, Initializer init)
          Executes the initialization process.
 
Methods inherited from class com.arsdigita.runtime.CompoundInitializer
add, init, init, init
 
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
Constructor Detail

Startup

public Startup()
Constructs a new startup by defaulting the connection source to a dedicated connection source that uses the JDBC URL specified by the waf.runtime.jdbc_url parameter.


Startup

public Startup(ConnectionSource source)
Prepares a startup object with a list of child Initializers to run in order to initialize the runtime. This method relies on a caller-provided connection source.

Parameters:
source - The connection source used to recover the list of initializers from the database; it cannot be null.
Method Detail

addRuntimeInitializers

protected void addRuntimeInitializers()

getRuntimeInitializerNames

protected Collection getRuntimeInitializerNames()
Fetches the names of initializers loaded into the database. Made protected so that test code can override the initializers loaded at test startup.

Returns:
Collection of initializer names.

run

public static final void run(Session session,
                             Initializer init)
Executes the initialization process. This method is going to move.


run

public final void run()
Executes the initialization process using the default session and global metadata root.

See Also:
MetadataRoot.getMetadataRoot(), SessionManager.getSession()

hasRun

public static boolean hasRun()

main

public static final void main(String[] args)
                       throws SQLException
Throws:
SQLException


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