The previous examples in this chapter have shown how, when your application starts up, the Initial service is automatically started, because it is specified in Nucleus.properties. That service then refers to other services, thereby causing additional services to be created and started until the entire network of services is up and running.

Many applications require several components to be created when Nucleus is started, rather than a single component. For example, an application may be running three different server components. It is unlikely that these server components will refer to each other, so starting one of the servers will not necessarily start the other two.

The way to start multiple components is to define a single component that refers to all of the components that must be started, then start that single component. Nucleus includes a component called InitialService that exists specifically for this purpose. The Nucleus.properties file includes this line:

initialServiceName=/Initial

This refers to the Initial service, which is defined by the Initial.properties configuration file as follows:

$class=atg.nucleus.InitialService
initialServices=\
     /atg/Initial,\
     VMSystem,\
     /atg/dynamo/StartServers

The initialServices property specifies three services that must be started each time Nucleus is started. This technique can be used to initialize entire sections of an application. For example, an application might include a bunch of servers and a bunch of loggers. The servers might be started by one Initial component (perhaps called /servers/Initial), and the loggers might be started by another Initial component (perhaps called /loggers/Initial). Then, the “master” /Initial component can refer to /servers/Initial and /loggers/Initial. This allows each section to be managed separately but still be included in the overall startup process. Note that a component started through the initialServices property must be globally scoped.

The following diagram shows how starting a Nucleus-based application starts up a cascade of initial services, in the ATG default configuration:

You can configure the ATG platform to send logging info messages for each component that is started by setting the following property in the Nucleus component:

loggingInfo=true
 
loading table of contents...