The <registry> element
The <registry> element in file config.xml has
the following syntax.
<registry roles="role1, role2, …" >
<server env="environment1, environment2, …" roles="role1, role2, …" serverid="serverID" />
<systemproperty name="name" value="value" default="default" />
</registry>
File config.xml contains exactly one required
<registry> element. The <registry>
element can contain zero to many <server> and
<systemproperty> elements.
The attributes on the various elements have the following meanings.
|
Element |
Attribute |
Required |
Description |
|---|---|---|---|
|
|
|
Yes |
List of valid cluster roles. |
|
|
|
No |
The
<server> attribute entries are legacy and
not required. These attributes have the following meanings:
It is a better practice to set these server attributes using JVM
options during server startup. For example, the following JVM option
sets both the server ID and server roles:
Use the # syntax to indicate the following text is a server role and not a server ID. |
|
|
|
Yes |
Specifies the name of the Java
If you run multiple server instances on the same host machine, define
a |
|
|
Yes |
New name of the system property. |
|
|
|
Yes |
Default property value to use if you do not specify a value at the command prompt. |
The following code shows an example <registry> element.
<registry roles="batch, scheduler, workqueue, messaging, startable, ui, custom1">
<systemproperty name="env" value="my.env" default="production"/>
<systemproperty name="serverid" value="my.id" default="myDefault"/>
</registry>
Notice that:
- The set of valid server roles includes a custom role
(
custom1). - There are two system property redefinitions, one for
envand one forserverid.
Default server roles
If you run the PolicyCenter application as a single server (not in a clustered environment), Guidewire assigns all of the defined server roles to that server by default.
Property serverid.noroles
In standard usage, the value of property serverid includes also the
list of server roles defined for that server. If you want to use this property in
code, without the list of server roles, use serverid.noroles
instead. For example, instead of using gw.pc.serverid, use
gw.pc.serverid.noroles to suppress the list of server
roles associated with this server ID.
Logging environment
The env property has special significance for logging behavior. If
the env value is non-null, PolicyCenter tries to obtain the logging configuration from a
config/logging/env-log4j2.xml file.
If this file does not exist or if env is null,
then the logging configuration is taken from the default
log4j2.xml file.
Creating special server roles
It is possible to define new server roles by adding the role to the list of roles
specified by the roles attribute on the
<registry> element.
Accessing system properties in code
Gosu class gw.api.system.server.ServerUtil contains methods for working with system properties associated with servers.
