atg.nucleus
Class NucleusTestUtils.NucleusStartupOptions

java.lang.Object
  extended by atg.nucleus.NucleusTestUtils.NucleusStartupOptions
Enclosing class:
NucleusTestUtils

public static class NucleusTestUtils.NucleusStartupOptions
extends java.lang.Object

A class representing NucleusStartupOptions, used by startNucleusWithModules().


Constructor Summary
NucleusTestUtils.NucleusStartupOptions(java.lang.String[] pModules, java.lang.Class pClassRelativeTo, java.lang.String pInitialService)
          This constructor creates NucleusStartupOptions with the specified list of Dynamo modules ("DAS", "DPS", "DSS", "Publishing.base", etc).
NucleusTestUtils.NucleusStartupOptions(java.lang.String[] pModules, java.lang.Class pClassRelativeTo, java.lang.String pBaseConfigDirectory, java.lang.String pInitialService)
          This constructor creates NucleusStartupOptions with the specified list of Dynamo modules ("DAS", "DPS", "DSS", "Publishing.base", etc).
 
Method Summary
 java.lang.String getBaseConfigDirectory()
          Set the basic config directory.
 java.lang.Class getClassRelativeTo()
          Return the "class relative to" property.
 java.lang.String getInitialService()
          Gets the initialService.
 java.lang.String[] getLayers()
          Returns the Dynamo layers to run with.
 java.lang.String getLayersAsString()
          Return the layers as a string appropriate for passing to DynamoServerLauncher, calculateConfigPath.
 boolean getLiveconfig()
          Returns property liveconfig.
 java.lang.String[] getModules()
          Return the list of modules for starting Nucleus.
 void modifyNucleusCommandLineOptions(java.util.List<java.lang.String> listArgs)
          Modify Nucleus command-line options, as needed.
 void setLayers(java.lang.String[] pLayers)
          Sets the Dynamo layers to run with.
 void setLiveconfig(boolean pLiveconfig)
          Sets property liveconfig.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NucleusTestUtils.NucleusStartupOptions

public NucleusTestUtils.NucleusStartupOptions(java.lang.String[] pModules,
                                              java.lang.Class pClassRelativeTo,
                                              java.lang.String pInitialService)
This constructor creates NucleusStartupOptions with the specified list of Dynamo modules ("DAS", "DPS", "DSS", "Publishing.base", etc). Additionally sets opts to add a directory calculated relative to the location of pClassRelativeTo's package name from the classloader. The added config directory is calculated as (in psuedocode): (pClassRelativeTo's package location) + "/data/" + (pClassRelativeTo's simpleClassName) + "/config" and is only added if the directory exists.

You must specify a pInitialService parameter, which will be the initial service started by Nucleus (rather than the normally Initial component, which would do a full Nucleus component start-up).

Parameters:
pModules - the list of modules to use to calculate the Nucleus configuration path.
pClassRelativeTo - the class whose name and package will be used for the {packageName}/config/{simpleClassName}/data directory
pInitialService - the nucleus path of the Nucleus component to start-up. This is a required property to prevent accidental full start-up.
Throws:
javax.servlet.ServletException - if an error occurs

NucleusTestUtils.NucleusStartupOptions

public NucleusTestUtils.NucleusStartupOptions(java.lang.String[] pModules,
                                              java.lang.Class pClassRelativeTo,
                                              java.lang.String pBaseConfigDirectory,
                                              java.lang.String pInitialService)
This constructor creates NucleusStartupOptions with the specified list of Dynamo modules ("DAS", "DPS", "DSS", "Publishing.base", etc). Additionally sets opts to add a directory calculated relative to the location of pClassRelativeTo's package name from the classloader. The added config directory is calculated as (in psuedocode): (pClassRelativeTo's package location) + "/" + (pConfigDirectory or "data") + "/config" and is only added if the directory exists.

You must specify a pInitialService parameter, which will be the initial service started by Nucleus (rather than the normally Initial component, which would do a full Nucleus component start-up).

Parameters:
pModules - the list of modules to use to calculate the Nucleus configuration path.
pClassRelativeTo - the class whose package the config/data (or pBaseConfigDirectory/data) should be relative in.
pBaseConfigDirectory - the base configuration directory. If this parameter is non-null, the relative configuration subdirectory will be ("data/" + pBaseConfigDirectory) rather than "data/config".
pInitialService - the nucleus path of the Nucleus component to start-up. This is a required property to prevent accidental full start-up.
Throws:
javax.servlet.ServletException - if an error occurs
Method Detail

getModules

public java.lang.String[] getModules()
Return the list of modules for starting Nucleus. These modules are the modules whose config path will be included.


getClassRelativeTo

public java.lang.Class getClassRelativeTo()
Return the "class relative to" property. This is the Class whose package the config directory will be relative to.


getInitialService

public java.lang.String getInitialService()
Gets the initialService. This is the InitialService for Nucleus to resolve at start-up. Required.


getBaseConfigDirectory

public java.lang.String getBaseConfigDirectory()
Set the basic config directory. This is the directory that will be taked on to the package path of the classRelativeTo class. If this property is non-null, the relative configuration subdirectory will be ("data/" + baseConfigDirectory).


setLayers

public void setLayers(java.lang.String[] pLayers)
Sets the Dynamo layers to run with.


getLayers

public java.lang.String[] getLayers()
Returns the Dynamo layers to run with.


getLayersAsString

public java.lang.String getLayersAsString()
Return the layers as a string appropriate for passing to DynamoServerLauncher, calculateConfigPath.

Returns:
null if layers is null. Otherwise returns a space delimited list of layers.

setLiveconfig

public void setLiveconfig(boolean pLiveconfig)
Sets property liveconfig.

Parameters:
pLiveconfig - true if Nucleus should be started in liveconfig mode, false otherwise.

getLiveconfig

public boolean getLiveconfig()
Returns property liveconfig.

Returns:
true if liveconfig should be set, false otherwise.

modifyNucleusCommandLineOptions

public void modifyNucleusCommandLineOptions(java.util.List<java.lang.String> listArgs)
Modify Nucleus command-line options, as needed. This will be invoked just before Nucleus is started as a final chance to adjust any command-line options.



Copyright © 2009. All Rights Reserved.