Archived

This forum has been archived. Please start a new discussion on GitHub.

Shutdown a service

Here is my problem:
I have a service with an associated adapter. When i try to shutdown the service without shutting or destroying the communicator by doing this : adapter.destroy(), nothing happened. So i need a way to shutdown a service without destroying is communicator.
Thanks

Comments

  • matthew
    matthew NL, Canada
    Sorry, but its very hard to answer your question without knowing what you want to achieve. What do you mean by "shutdown" in this case and why do you want to shutdown your service without destroying the communicator?
  • Thanks a lot. In fact i want to destroy the adapter of a particular service without destroying the communicator, to keep other services alive, because i use one communicator for all the services. So destroying it, will shutdown all the services.
  • matthew
    matthew NL, Canada
    What you want then is to stop servicing requests through that object adapter? Are you trying to call ObjectAdapter::destroy() in a method invocation on an object hosted by that OA? If so that will block indefinitely since destroy calls ObjectAdapter::waitForDeactivate which cannot possibly complete while the invocation is in process. What you should do instead is to call deactivate(). If you want to ensure that all resources are released in a timely manner (ie: not when the communicator is eventually destroyed) then you need to call ObjectAdapter::destroy() in another thread.