Ice servers and clients are configured with properties. For servers deployed with IceGrid, these properties are automatically generated into a configuration file from the information contained in the application descriptor. The settings in that configuration file are passed to server via the
‑‑Ice.Config command-line option.
Named and unnamed property sets are defined with the same properties element. The context and the attributes of a
properties element distinguish named property sets from unnamed property sets. Here is an example that defines a named and an unnamed property set:
In this example, we define the named property set Debug and the unnamed property set of the server
TheServer. The server configuration will contain only the
Identity property because the server property set does not reference the
Debug named property set.
The properties element is used to reference a named property set: if a
properties element appears inside another
properties element, it is a reference to another property set and it must specify the
refid attribute. With the previous example, to reference the
Debug property set, we would write the following:
It is illegal to define a reference to a property set after setting a property value, so references to property sets must precede property definitions. For example, the following is illegal:
Just as the order of the property definitions is important, the order of property set references is also important. For example, the following two property sets are not equivalent:
Named property sets are evaluated at the point of definition. If you reference other property sets or use variables in a named property set definition, you must make sure that the referenced property sets or variables are defined in the same scope. For example, the following is correct:
However, the following example is wrong because the ${level} variable is not defined at the
application scope:
If both the application and the
node define the
${level} variable, the value of the
${level} variable in the
DebugApp property set will be the value of the variable defined in the application descriptor.
So far, we have seen the definition of an unnamed property set only in a server descriptor. However, it is also possible to define an unnamed property set for server or service instances. This is a good way to specify or override properties specific to a server or service instance. For example:
Here, the server instance overrides the Timeout property and defines an additional
Debug property.
The server or service instance unnamed property set and its parameters provide two different ways to customize the properties of a server or service template instance. It might not always be obvious which method to use: is it better to use a parameter to parameterize a given property or is it better to just specify it in the server or service instance property set?