Archived

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

Passing a context to locator

Hello everybody,

I have written a custom locator (extends Ice::Locator). I need to make its behavoiur dependent on some factors which are known to clients. The simplest (or: the only reasonable) way is to use context. On client side I call:
HelloPrx hello = null;
Dictionary ctx = ....
String astring = .... //something not known to local configuration
hello = HelloPrxHelper.checkedCast(communicator().stringToProxy(astring), ctx);
In the result my locator is being called correctly but the context it receives is empty (if I sniff the connection I always see the empty context). Why is client side dropping the context? If I am doing something wrong - how to pass it?

Thanks in advance,
Łukasz

Comments

  • benoit
    benoit Rennes, France
    Hi,

    The operation context isn't passed to Ice locator invocations. Also note that a call on a proxy might not necessarily result in a call to the Ice locator, it depends on the locator cache (see here for more information).

    To pass a context to Ice locator calls, either you setup the context on the Ice default locator which you can set on the Ice communicator with the setDefaultLocator method or you can associate a locator proxy on a per proxy basis with the proxy ice_locator method.

    Let us know if you need more information on this!

    Cheers,
    Benoit.