Home Help Center

Ice 3.1: Communicator.setDefaultContext()

stephanstephan Member Stephan StapelOrganization: Stephan StapelProject: BristolNG
Hi!

I installed the latest Ice packages a couple of minutes ago and tried to recompile some of our code.

Unfortunately, the setDefaultContext() function seems to be missing in the communicator and I cannot find no info on why it is missing and how it was replaced.

Could you please post some info on this? This function is really useful so I hope that it wasn't removed in this release without new functionality for such things...

regs,

Stephan

Comments

  • mesmes CaliforniaAdministrators, ZeroC Staff Mark SpruiellOrganization: ZeroC, Inc.Project: Ice Developer ZeroC Staff
    Hi Stephan,

    Please see section 30.3 in the Ice 3.1.0 manual for information on how to configure a communicator with a default context. Briefly, you now need to create an instance of InitializationData, which contains the member defaultContext, and pass that structure to initialize.

    Take care,
    - Mark
  • stephanstephan Member Stephan StapelOrganization: Stephan StapelProject: BristolNG
    Hi Mark!

    Thanks for the hint. However, how can I modify the default context during runtime? We are frequently using contexts to pass login cookies from client to server because it's much simpler to use in some cases than Glacier2.

    I.e., I first use the communicator without a certain context and then have to modify it during runtime. Imho that's the normal usage of the default context.

    Stephan
  • michimichi Member Michi HenningOrganization: Triodia TechnologiesProject: I have a passing interest in Ice :-) ✭✭✭
    We will discuss this change internally to see what we can do.

    For the time being, the only suggestion I can make is to revert back to Ice 3.0.1.

    Cheers,

    Michi.
  • stephanstephan Member Stephan StapelOrganization: Stephan StapelProject: BristolNG
    Could you make it possible to modify the initialization structure after the communicator is initialized? This might not only make sense for the default contxt but for other structure items as well.

    To put it in other words: why is it called 'initialization data' structure and not 'configuration data' structure?

    Hope that you can make available a patch for 3.1.

    regs,

    Stephan
  • bernardbernard Jupiter, FLAdministrators, ZeroC Staff Bernard NormierOrganization: ZeroC, Inc.Project: Ice ZeroC Staff
    stephan wrote:
    Could you make it possible to modify the initialization structure after the communicator is initialized?

    No, that's not possible. The whole point of this InitializationData parameter is to provide one-off data to the communicator. After initialization, the communicator can read these members without synchronization since it knows they can't change.

    Cheers,
    Bernard
  • stephanstephan Member Stephan StapelOrganization: Stephan StapelProject: BristolNG
    hmm. ok, I understand.

    As you have left out the default locator and the router of the initialization structure because they might change during runtime (I'm not sure whether runtime changes happen with default locators but anyway), you should probably also remove the default context from the initialization structure and provide separate getters/ setters for it as it was before.

    Stephan
  • bernardbernard Jupiter, FLAdministrators, ZeroC Staff Bernard NormierOrganization: ZeroC, Inc.Project: Ice ZeroC Staff
    Hi Stephan,

    I've just posted a patch that restores setDefaultContext.

    Cheers,
    Bernard
  • stephanstephan Member Stephan StapelOrganization: Stephan StapelProject: BristolNG
    Hi Bernard,

    thanks a lot for this patch. I used a quick hack in the meantime, creating two communicators in a row (one for getting the session context, the other one for the real business) but that obviously sucked :) So it's really good that we can now use the old code again!

    regs,

    Stephan
Sign In or Register to comment.