Archived

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

Can I remove a adapter from a communicator?

Hello,

sample code:


...
ObjectAdapter oa= communicator.createObjectAdapter("somename");
...

and later, I want to remove "oa" from communicator, because I hope "oa"

be created dynamic when I need it. when I invoke the above code again,ice says: the oa with the name "somename" aleady exist :).

but I can't find the way to remove it from communicator.

Thanks!

Comments

  • benoit
    benoit Rennes, France
    Hi,

    Yes (assuming you're using Ice >= 3.1.0), the object adapter will be removed from the communicator once it's completely deactivated. So you need to call "deactivate()" on the object adapter to initiate the deactivation and wait for the deactivation to complete by calling "waitForDeactivate()". Once "waitForDeactivate()" returns, you should be able to create the object adapter again with the communicator.

    Cheers,
    Benoit.
  • Thanks!

    I will try it! :)