ID variables that refer to configuration files

The Liberty run time occasionally needs to refer to a configuration element from the server.xml file. This action can occur in several ways, such as in the text of a message or in a file name.

The Liberty run time uses an xpath-style syntax to refer to configuration elements. The element type is printed first, followed by brackets that contain the ID of the configuration element. If the configuration element is nested inside another configuration element, the inner configuration element is preceded with a forward slash separating the inner and outer elements.

  • For example, the following databaseStore configuration element is referred to as databaseStore[DBTaskStore] because the databaseStore is not nested and has an ID value of DBTaskStore.
    
    <server>
      <databaseStore id="DBTaskStore">
         ...
      </databaseStore>
    </server>
    
  • The following data source configuration element is referred to as databaseStore[DBTaskStore]/dataSource[DataSource0] because the data source is nested underneath databaseStore, databaseStore has an ID value of DBTaskStore, and data source has an ID value of DataSource0.
    <server>
      <databaseStore id="DBTaskStore">
        <dataSource id="DataSource0">
          ...
        </dataSource>
      </databaseStore>
    </server>
    
  • In some cases, a configuration element does not have an ID. In this case, an ID is generated. For example, the following data source configuration element might be referred to as databaseStore[default-0]/dataSource[DataSource0] because the databaseStore does not define an ID.
    <server>
      <databaseStore>
        <dataSource id="DataSource0">
          ...
        </dataSource>
      </databaseStore>
    </server>