---
title: "Object Adapter Activation and Deactivation"
url: https://docs.zeroc.com/ice/3.8/runtime/dispatch/object-adapter-activation-and-deactivation
language: cpp
docs_index: https://docs.zeroc.com/llms.txt
---

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

# Object Adapter Activation and Deactivation

Programming language: C++. Other languages: [C#](https://docs.zeroc.com/ice/3.8/runtime/dispatch/object-adapter-activation-and-deactivation/csharp.md), [Java](https://docs.zeroc.com/ice/3.8/runtime/dispatch/object-adapter-activation-and-deactivation/java.md), [Python](https://docs.zeroc.com/ice/3.8/runtime/dispatch/object-adapter-activation-and-deactivation/python.md), [Swift](https://docs.zeroc.com/ice/3.8/runtime/dispatch/object-adapter-activation-and-deactivation/swift.md).

## Activation

A newly created object adapter does not read requests from the connections that clients establish to its endpoints. You typically add servants to the [active servant map](https://docs.zeroc.com/ice/3.8/runtime/dispatch/active-servant-map/cpp.md) first, and then call [`activate`](https://code.zeroc.com/ice/3.8/api/cpp/classIce_1_1ObjectAdapter_a538b842c71355b1b2317a7c2375e0feb.html#a538b842c71355b1b2317a7c2375e0feb) to make the object adapter read and dispatch these requests.

Activation concerns only the connections that the object adapter accepts. An object adapter dispatches the requests it receives over [bidirectional connections](https://docs.zeroc.com/ice/3.8/runtime/connection-management/bidirectional-connections/cpp.md) and from [collocated invocations](https://docs.zeroc.com/ice/3.8/runtime/collocated-invocation-and-dispatch/cpp.md) whether or not you activate it, so an object adapter without endpoints needs no `activate` call.

## Deactivation

Shutting down a communicator deactivates its object adapters, and destroying the communicator destroys them. To deactivate or destroy an object adapter while its communicator keeps running, call:

- [`deactivate`](https://code.zeroc.com/ice/3.8/api/cpp/classIce_1_1ObjectAdapter_a784185a9c53e3437488f3b3fa59f7ee3.html#a784185a9c53e3437488f3b3fa59f7ee3) starts the deactivation of the object adapter and returns without waiting for the dispatches in progress. The object adapter stops accepting connections, and closes each connection it accepted once the dispatches in progress on this connection have completed and sent their replies. It doesn't dispatch the requests that arrive over these connections in the meantime. A deactivated object adapter cannot be reactivated, but it keeps dispatching the requests received over bidirectional connections and collocated invocations until you destroy it.
- [`destroy`](https://code.zeroc.com/ice/3.8/api/cpp/classIce_1_1ObjectAdapter_a858d028f9715eecc4cc7f185d3ee4ab9.html#a858d028f9715eecc4cc7f185d3ee4ab9) deactivates the object adapter and returns once its destruction is complete. The object adapter waits for the dispatches in progress to complete, removes its servants, and stops accepting requests from bidirectional connections. You can then create a new object adapter with the same name.

## See Also

- [Collocated Invocation and Dispatch](https://docs.zeroc.com/ice/3.8/runtime/collocated-invocation-and-dispatch/cpp.md)
- [Bidirectional Connections](https://docs.zeroc.com/ice/3.8/runtime/connection-management/bidirectional-connections/cpp.md)
