<server> Element
4 min read
4 min read
4 min read
4 min read
4 min read
4 min read
4 min read
4 min read
4 min read
A server element defines a server to be deployed on a node. It typically contains at least one adapter element, and may supply additional information such as command-line options, environment variables, and configuration properties.
This element may only appear as a child of a node element or a server-template element.
The following attributes are supported:
| Attribute | Description | Required |
|---|---|---|
activation | Specifies whether the server's activation mode. Legal values are manual, on-demand, always and session. If not specified, manual activation is used by default. | No |
activation-timeout | Defines the number of seconds a node will wait for the server to activate. If the timeout expires, a client waiting to receive the endpoints of an object adapter in this server will receive an empty set of endpoints. If not defined, the default timeout is the value of the IceGrid.Node.WaitTime property configured for the server's node. | No |
allocatable | Specifies whether the server can be allocated. A server is allocated implicitly when one of its allocatable objects is allocated. The value of this attribute is ignored if the server activation mode is session; a server with this activation mode is always allocatable. Otherwise, if not specified and the server activation mode is not session, the server is not allocatable. | No |
deactivation-timeout | Defines the number of seconds a node will wait for the server to deactivate. If the timeout expires, the node terminates the server process. If not defined, the default timeout is the value of the node's configuration property IceGrid.Node.WaitTime. | No |
exe | The pathname of the server executable. The node resolves a relative path that contains /, such as bin/server, against the server's working directory: pwd when set, otherwise the node's working directory. For a name without /, such as server, the node searches the PATH of the server's environment on Linux and macOS, and the standard Windows search path on Windows. On Windows, the node appends .exe to a name without extension, but not to a path: write bin/server.exe, not bin/server. | Yes |
ice-version | Specifies the Ice version in use by this server. If not defined, IceGrid assumes the server uses the same version that IceGrid itself uses. | No |
id | Specifies the identifier for this server. The identifier must be unique among all servers in the registry. Within the server, child elements can refer to its identifier using the reserved variable ${server}. | Yes |
pwd | The default working directory for the server. If not defined, the server is started in the node's current working directory. | No |
user | Specifies the user string from which the node determines the operating system account that runs the server. Activating Servers with Specific User IDs describes how the node maps this value to an account, the user string the node uses when this attribute is not specified, and when the node runs a server as root. | No |
An optional nested description element provides free-form descriptive text.
Here is an example to demonstrate the use of this element:
XML
<server id="MyServer" activation="on-demand" activation-timeout="60" deactivation-timeout="60" exe="/opt/app/bin/myserver" pwd="/"> <option>--Ice.Trace.Network=1</option> <env>PATH=/opt/Ice/bin:$PATH</env> <property name="ServerId" value="${server}"/> <adapter name="Adapter1" .../></server>