---
title: "The Active Servant Map"
url: https://docs.zeroc.com/ice/3.8/runtime/dispatch/active-servant-map
language: java
docs_index: https://docs.zeroc.com/llms.txt
---

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

# The Active Servant Map

Programming language: Java. Other languages: [C++](https://docs.zeroc.com/ice/3.8/runtime/dispatch/active-servant-map/cpp.md), [C#](https://docs.zeroc.com/ice/3.8/runtime/dispatch/active-servant-map/csharp.md), [JavaScript](https://docs.zeroc.com/ice/3.8/runtime/dispatch/active-servant-map/js.md), [Python](https://docs.zeroc.com/ice/3.8/runtime/dispatch/active-servant-map/python.md), [Swift](https://docs.zeroc.com/ice/3.8/runtime/dispatch/active-servant-map/swift.md).

Each object adapter maintains an *active servant map* (ASM): a table that associates each servant you add to it with an identity and a [facet](https://docs.zeroc.com/ice/3.8/runtime/facets/java.md). [The Dispatch Pipeline](https://docs.zeroc.com/ice/3.8/runtime/dispatch/dispatch-pipeline.md) describes how an object adapter uses its ASM to dispatch a request.

![The client proxy contains endpoint 212.8.7.33 and identity Joe. The request reaches the server object adapter, whose active servant map associates Fred, Joe, and Carl with servants. The highlighted Joe entry selects the matching servant.](https://docs.zeroc.com/images/ice/3.8/active-servant-map/binding-request-to-servant.svg)

*Dispatching a request to the correct servant.*

## Adding and Removing Servants

You add a servant to the ASM with [`add`](https://code.zeroc.com/ice/3.8/api/java/com.zeroc.ice/com/zeroc/Ice/ObjectAdapter.html#add(com.zeroc.Ice.Object,com.zeroc.Ice.Identity)) or [`addWithUUID`](https://code.zeroc.com/ice/3.8/api/java/com.zeroc.ice/com/zeroc/Ice/ObjectAdapter.html#addWithUUID(com.zeroc.Ice.Object)), and remove it with [`remove`](https://code.zeroc.com/ice/3.8/api/java/com.zeroc.ice/com/zeroc/Ice/ObjectAdapter.html#remove(com.zeroc.Ice.Identity)). [`addFacet`](https://code.zeroc.com/ice/3.8/api/java/com.zeroc.ice/com/zeroc/Ice/ObjectAdapter.html#addFacet(com.zeroc.Ice.Object,com.zeroc.Ice.Identity,java.lang.String)), [`addFacetWithUUID`](https://code.zeroc.com/ice/3.8/api/java/com.zeroc.ice/com/zeroc/Ice/ObjectAdapter.html#addFacetWithUUID(com.zeroc.Ice.Object,java.lang.String)) and [`removeFacet`](https://code.zeroc.com/ice/3.8/api/java/com.zeroc.ice/com/zeroc/Ice/ObjectAdapter.html#removeFacet(com.zeroc.Ice.Identity,java.lang.String)) do the same for a facet other than the default facet. See [ObjectAdapter](https://code.zeroc.com/ice/3.8/api/java/com.zeroc.ice/com/zeroc/Ice/ObjectAdapter.html) in the API reference for these methods.

Each identity and facet has at most one servant, but you can add the same servant with several identities. Removing a servant does not affect the dispatches in progress in this servant. Destroying the [object adapter](https://docs.zeroc.com/ice/3.8/runtime/dispatch/object-adapter-activation-and-deactivation/java.md) empties its ASM.

A servant in the ASM usually implements a skeleton generated by the Slice compiler, but it can be any [dispatcher](https://docs.zeroc.com/ice/3.8/runtime/dispatch/dispatcher-api/java.md).

## See Also

- [Default Servants](https://docs.zeroc.com/ice/3.8/runtime/dispatch/default-servants/java.md)
