---
title: "<adapter> Element"
url: https://docs.zeroc.com/ice/3.8/services/icegrid/icegrid-xml-reference/adapter-descriptor-element
docs_index: https://docs.zeroc.com/llms.txt
---

> For an index of every page, see [llms.txt](https://docs.zeroc.com/llms.txt).

# \<adapter> Element

An `adapter` element defines an indirect [object adapter](https://docs.zeroc.com/ice/3.8/runtime/dispatch.md).

This element may only appear as a child of a [server](https://docs.zeroc.com/ice/3.8/services/icegrid/icegrid-xml-reference/server-descriptor-element.md) or [service](https://docs.zeroc.com/ice/3.8/services/icegrid/icegrid-xml-reference/service-descriptor-element.md) element.

The following attributes are supported:

| **Attribute** | **Description** | **Required** |
| --- | --- | --- |
| `endpoints` | Specifies the [endpoints](https://docs.zeroc.com/ice/3.8/runtime/dispatch/object-adapter-endpoints.md) of this object adapter. Use a single endpoint, with an IP address rather than a DNS name if it specifies a host. When the endpoint does not specify a port, the operating system selects an ephemeral port when the server creates the adapter. IceGrid sets the adapter's [Endpoints](https://docs.zeroc.com/ice/3.8/property-reference/object-adapter-properties.md) property to this value, or to `default` if not defined. | No |
| `id` | Specifies the adapter ID. The adapter ID must be unique among all adapters and replica groups in the registry. IceGrid sets the adapter's [AdapterId](https://docs.zeroc.com/ice/3.8/property-reference/object-adapter-properties.md) property to this value. If not defined, IceGrid uses `${server}.<name>`, or `${server}.${service}.<name>` for an adapter defined in an IceBox [service](https://docs.zeroc.com/ice/3.8/services/icegrid/icegrid-xml-reference/service-descriptor-element.md), where `<name>` is the adapter's `name` attribute. | No |
| `name` | The name of the object adapter as used in the server that [creates](https://docs.zeroc.com/ice/3.8/runtime/dispatch/creating-an-object-adapter.md) it. | Yes |
| `priority` | Specifies the priority of the object adapter as an integer value. The object adapter priority is used by the `Ordered` replica group [load balancing](https://docs.zeroc.com/ice/3.8/services/icegrid/load-balancing.md) policy to determine the order of the endpoints returned by a locate request. Endpoints are ordered from the smallest priority value to the highest. If not defined, the value is `0`. | No |
| `proxy-options` | The proxy options to use when generating the adapter well-known or allocatable object proxies. IceGrid also sets the adapter's [ProxyOptions](https://docs.zeroc.com/ice/3.8/property-reference/object-adapter-properties.md) property to this value. | No |
| `replica-group` | Specifies a [replica group ID](https://docs.zeroc.com/ice/3.8/services/icegrid/object-adapter-replication.md). A non-empty value signals that this object adapter is a member of the indicated replica group. IceGrid sets the adapter's [ReplicaGroupId](https://docs.zeroc.com/ice/3.8/property-reference/object-adapter-properties.md) property to this value. If not defined, the default value is an empty string. | No |
| `server-lifetime` | A value of `true` indicates that the lifetime of this object adapter is the same as the lifetime of its server. The IceGrid node uses these object adapters to determine when the server is [activated](https://docs.zeroc.com/ice/3.8/services/icegrid/icegrid-server-activation.md) and when its deactivation begins. If not defined, the default value is `true`. | No |

An optional nested [description](https://docs.zeroc.com/ice/3.8/services/icegrid/icegrid-xml-reference/description-descriptor-element.md) element provides free-form descriptive text.

Here is an example to demonstrate the use of this element.

```xml
<adapter name="MyAdapter"
    endpoints="default"
    id="MyAdapterId"
    proxy-options="-t -e 1.0"
    replica-group="MyReplicaGroup">
    <description>A description of the adapter.</description>
    ...
</adapter>
```

## See Also

- [Object Adapters](https://docs.zeroc.com/ice/3.8/runtime/dispatch.md)
- [Server Descriptor Element](https://docs.zeroc.com/ice/3.8/services/icegrid/icegrid-xml-reference/server-descriptor-element.md)
- [Service Descriptor Element](https://docs.zeroc.com/ice/3.8/services/icegrid/icegrid-xml-reference/service-descriptor-element.md)
- [Object Adapter Endpoints](https://docs.zeroc.com/ice/3.8/runtime/dispatch/object-adapter-endpoints.md)
- [Object Adapter Replication](https://docs.zeroc.com/ice/3.8/services/icegrid/object-adapter-replication.md)
- [Creating an Object Adapter](https://docs.zeroc.com/ice/3.8/runtime/dispatch/creating-an-object-adapter.md)
- [Load Balancing](https://docs.zeroc.com/ice/3.8/services/icegrid/load-balancing.md)
- [IceGrid Server Activation](https://docs.zeroc.com/ice/3.8/services/icegrid/icegrid-server-activation.md)
- [Object Adapter Properties](https://docs.zeroc.com/ice/3.8/property-reference/object-adapter-properties.md)
