ATG
component:
In ATG any Public Class/JavaBean Associated with a
properties file is called as an ATG component. Ideally speaking the
properties file of a component stores the configuration values like, class name
it is associated with, Scope, Dependency injections, some other Default values
that are used in the java classes. It
must be under the ATG configPath.
Properties File Format:
The properties files read by Nucleus must follow a format
that is recognized by the class java.util.Properties. The rules for the
format are as follows:
- 1. Entries are generally expected to be a single line of the form:
propertyName=propertyValue
propertyName:propertyValue
- 2. White space that appears between the property name and property value is ignored.
- 3. Lines that start with the comment characters !or# are ignored. Blank lines are also ignored.
- 4. The property value is generally terminated by the end of the line. White space following the property value is not ignored, and is treated as part of the property value
- 5. A property value can span several lines if each line is terminated by a backslash (‘\’) character.
Example:
targetCities=\
Detroit,\
Chicago,\
Los Angeles
Detroit,\
Chicago,\
Los Angeles
- 6. The characters newline, carriage return, and tab can be inserted with characters \n, \r, and \t, respectively
- 7. The backslash character must be escaped as a double backslash.
- 8. UNICODE characters can be entered as they are in a Java program, using the \u prefix
ATG
Nucleus:
A container that holds all these ATG components is nothing
but ATG Nucleus. It is the core of the entire ATG system. By reading the
.properties files associated with each component, Nucleus figures out which
components are to be used in an application,initializes them to their default values,and
decides how they connect to each other. This model makes it easier for the
developers to build ATG applications by configuring and using the in-built
components instead of writing Java code from scratch.
Basic ATG Nucleus
Operations (In Detail) / How ATG Nucleus Works :
Nucleus performs one basic operation:
resolving component names. Given the name of a component, Nucleus does its best
to find or create that component and return it.
·
Within Nucleus, certain components can
contain other components, forming a component hierarchy. For example, given the
name /services/logs/FileLogger, Nucleus resolves it by looking for components
in the following locations:
1.
Looks in the root container for the services component.
2.
Looks in the services container for the logs component.
3.
Looks in the logs container for the FileLogger component.
·
Name resolution is not a difficult task. Nucleus
shows its real power by creating components and hooking them up to other
components automatically. This function is invoked when Nucleus is asked to
resolve a name of a component that does not yet exist.
For example:
On startup, Nucleus is given a configuration path—a list
of configuration directories that contain the configuration files of various
components. Within the configuration directories, Nucleus expects to find a
configuration file that uses the component name.
For example, to create the component /services/custom/CustomFile, which does not exist in the nucleus components, and
say, the configuration root directory is <ATG10.1dir>/DAS/config, Nucleus looks for CustomFile’sconfiguration
in:
<ATG10.1dir>/DAS/config/services/custom/CustomFile.properties
In
Simple words: It creates and configures Nucleus components and organizes
them into a hierarchical namespace, essentially giving them a place to live so
they can be referenced by other components.