When a name is resolved in a properties file, it is resolved one element at a time. In the previous example, a component was specified as Weather. The name resolution begins at the context where the name was found. You can think of this as the directory containing the properties file, which in this case was /services. The name is then resolved one element at a time. Because this name consists of only one element, the result is /services/Weather.

The name Weather is a relative name, meaning that its resolution starts with the directory where it was found. Any name that does not begin with a / is considered a relative name. For example, Weather, ../service1, logger/FileLogger, and .. are all relative names.

On the other hand, any name that begins with a / is considered an absolute name. For example, the following are all treated as absolute names:

/services/Weather
/services/somedir/../Weather
/

Absolute names are resolved by starting from the root and resolving each element of the name in order.

Dot Names

In both absolute and relative names, dot names have special meanings. These dot names can be used anywhere in a name, relative and absolute:

Notation

Description

. (single)

Refers to the current component, and usually has no effect on the name resolution process. For example, Person and ./Person are equivalent, as are /services/log/FileLogger and /services/log/./FileLogger.

.. (double)

Refers to the parent of the current component. For example, /services/log/../tests/BigTest is equivalent to /services/tests/BigTest.

... (triple)

Initiates a search up the component hierarchy for the name specified after the triple dot. For example, the name .../Adder searches the current context for a component called Adder, then searches the current component’s parent. It continues its search up the hierarchy until the component is found, or the root is reached—that is, no more parents can be found.

The triple dot can also be used in more complex names. For example, given this name:

/services/logs/.../files/TestFile

these names are searched in the following order:

/services/logs/files/TestFile
/services/files/TestFile
/files/TestFile

In summary, Nucleus searches for everything after the triple dot by walking up the hierarchy defined by everything before the triple dot. If Nucleus cannot find the component and must try to create it, Nucleus uses the same search algorithm to find the component’s property configuration file.


Copyright © 1997, 2012 Oracle and/or its affiliates. All rights reserved. Legal Notices