Object Adapter Activation and Deactivation
Activation
An object adapter that was just created is in the Holding state. In this state, transport connections are accepted (the object adapter “listens” on the network), however, connections are not validated at the Ice level and incoming requests are not read off the network. UDP requests are silently discarded in the Holding state.
This should be a very temporary state for your object adapter, during which you typically add a few servants to the Active Servant Map.
You transition your object adapter from the Holding state to the Active state by calling activate. For example:
adapter->activate();
activate is a blocking call: it returns only once the object adapter is activated.
Once activated, the object adapter accepts incoming connections, and reads and dispatches incoming requests received over these connections.
The distinction Holding vs Active applies only to requests dispatched through endpoints configured on the object adapter. It does not apply to requests received from bidirectional connections, nor does it apply to collocated dispatches.
As a result, it’s optional to call activate on an object adapter that does not have any endpoint.
Deactivation
While you need to activate an object adapter that listens on one or more endpoints, you usually don’t need to deactivate or destroy this object adapter explicitly: the shutdown and destruction of the communicator you used to create this object adapter will deactivate and destroy this object adapter for you.
Nevertheless, in some cases, you may want to deactivate and destroy an object adapter explicitly using the following methods:
deactivate
Thedeactivatemethod initiates deactivation of the adapter: requests that arrive after callingdeactivateare rejected, but currently executing requests are allowed to complete. Once all requests have completed, the adapter enters theInactivestate. Note thatdeactivatereturns immediately without waiting for the currently executing requests to complete. A deactivated adapter cannot be reactivated; you can create a new adapter with the same name, but only after callingdestroyon the existing adapter. Any attempt to use a deactivated object adapter results in anObjectAdapterDeactivatedException. During deactivation, the association with bidirectional connections (if any) is cleared. Deactivation also makes the adapter ineligible for collocated dispatches.waitForDeactivate
ThewaitForDeactivatemethod suspends the calling thread until the adapter has completed its transition to theInactivestate, that is, until all currently executing requests have completed.destroy
Thedestroymethod deactivates the adapter and releases all of its resources. Internally,destroyinvokesdeactivatefollowed bywaitForDeactivate, therefore the method blocks until all currently executing requests have completed. Furthermore, any servants associated with the adapter are destroyed, all transport endpoints are closed, and the adapter's name becomes available for reuse.