org.apache.xbean.server.spring.main
Class SpringBootstrap

java.lang.Object
  extended byorg.apache.xbean.server.spring.main.SpringBootstrap

public class SpringBootstrap
extends java.lang.Object

SpringBootstrap is the main class used by a Spring based server. This class uses the following strategies to determine the configuration file to load: Command line parameter --bootstrap FILE Manifest entry XBean-Bootstrap in the startup jar META-INF/xbean-bootstrap.xml This class atempts to first load the configuration file from the local file system and if that fails it attempts to load it from the classpath. SpringBootstrap expects the configuration to contain a service with the id "main" which is an implementation of org.apache.xbean.server.main.Main. This class will set the system property xbean.base.dir to the directory containing the startup jar if the property has not alredy been set (on the command line).

Since:
2.0
Version:
$Id$
Author:
Dain Sundstrom

Constructor Summary
SpringBootstrap()
           
 
Method Summary
 void boot()
          Loads the main instance from the Spring configuration file and executes it.
 java.lang.String getConfigurationFile()
          Gets the configuration file from which the main instance is loaded.
 java.lang.String[] getMainArguments()
          Gets the arguments passed to the main instance.
 java.util.List getPropertyEditorPaths()
          Gets the paths that are appended to the system property editors search path.
 java.lang.String getServerBaseDirectory()
          Gets the base directory of the server.
 void initialize(java.lang.String[] args)
          Determines the configuration file and server base directory.
 Main loadMain()
          Loads the main instance from the configuration file.
static void main(java.lang.String[] args)
          Initializes and boots the server using the supplied arguments.
static void main(java.lang.String[] args, SpringBootstrap springBootstrap)
          Like the main(args) method but allows a configured bootstrap instance to be passed in.
 void setConfigurationFile(java.lang.String configurationFile)
          Sets the configuration file from which the main instance is loaded.
 void setMainArguments(java.lang.String[] mainArguments)
          Sets the arguments passed to the main instance.
 void setPropertyEditorPaths(java.util.List propertyEditorPaths)
          Sets the paths that are appended to the system property editors search path.
 void setServerBaseDirectory(java.lang.String serverBaseDirectory)
          Sets the base directory of the server.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SpringBootstrap

public SpringBootstrap()
Method Detail

main

public static void main(java.lang.String[] args)
Initializes and boots the server using the supplied arguments. If an error is thrown from the boot method, this method will pring the error to standard error along with the stack trace and exit with the exit specified in the FatalStartupError or exit code 9 if the error was not a FatalStartupError.

Parameters:
args - the arguments used to start the server

main

public static void main(java.lang.String[] args,
                        SpringBootstrap springBootstrap)
Like the main(args) method but allows a configured bootstrap instance to be passed in.

See Also:
main(String[])

getConfigurationFile

public java.lang.String getConfigurationFile()
Gets the configuration file from which the main instance is loaded.

Returns:
the configuration file from which the main instance is loaded

setConfigurationFile

public void setConfigurationFile(java.lang.String configurationFile)
Sets the configuration file from which the main instance is loaded.

Parameters:
configurationFile - the configuration file from which the main instance is loaded

getMainArguments

public java.lang.String[] getMainArguments()
Gets the arguments passed to the main instance.

Returns:
the arguments passed to the main instance

setMainArguments

public void setMainArguments(java.lang.String[] mainArguments)
Sets the arguments passed to the main instance.

Parameters:
mainArguments - the arguments passed to the main instance

getPropertyEditorPaths

public java.util.List getPropertyEditorPaths()
Gets the paths that are appended to the system property editors search path.

Returns:
the paths that are appended to the system property editors search path

setPropertyEditorPaths

public void setPropertyEditorPaths(java.util.List propertyEditorPaths)
Sets the paths that are appended to the system property editors search path.

Parameters:
propertyEditorPaths - the paths that are appended to the system property editors search path

getServerBaseDirectory

public java.lang.String getServerBaseDirectory()
Gets the base directory of the server.

Returns:
the base directory of the server

setServerBaseDirectory

public void setServerBaseDirectory(java.lang.String serverBaseDirectory)
Sets the base directory of the server.

Parameters:
serverBaseDirectory - the base directory of the server

initialize

public void initialize(java.lang.String[] args)
Determines the configuration file and server base directory.

Parameters:
args - the arguments passed to main

loadMain

public Main loadMain()
Loads the main instance from the configuration file.

Returns:
the main instance

boot

public void boot()
Loads the main instance from the Spring configuration file and executes it.



Copyright © {inceptionYear}-2006 Apache Software Foundation. All Rights Reserved.