Home Help Center

Can I remove a adapter from a communicator?

lkwlkw Member David LeeOrganization: Allfast software companyProject: Vehicle Monitor With GPS
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

  • benoitbenoit Rennes, FranceAdministrators, ZeroC Staff Benoit FoucherOrganization: ZeroC, Inc.Project: Ice ZeroC Staff
    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.
  • lkwlkw Member David LeeOrganization: Allfast software companyProject: Vehicle Monitor With GPS
    Thanks!

    I will try it! :)
Sign In or Register to comment.