Home Help Center

Can Ice dynamically check and update its registry infomation when a Ice server dies?

rc_hzrc_hz Member Eric RCOrganization: www.genband.comProject: No project yet ✭✭✭
I start my Ice server and register my Ice object to IcePack Registry by addObject() function:
//...
IcePack::AdminPrx admin = IcePack::AdminPrx::checkedCast(communicator->stringToProxy("IcePack/Admin"));

Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapter("Hello");
Ice::ObjectPtr object = new HelloI;
Ice::ObjectPrx objPrx = adapter->add(object, Ice::stringToIdentity("hello"));
adapter->activate();

admin->addObject(objPrx);
//...

I killed my server crudely by "kill -9 myserver " command! and when i start my server again, it throws a "IcePack::ObjectExistsException" exception!

My question: why Ice registry can not dynamically check and update its registry infomation ? In my experience, some other CORBA products can do it!(Such as VisiBroker's osagent).

Comments

  • rc_hzrc_hz Member Eric RCOrganization: www.genband.comProject: No project yet ✭✭✭
    I know we have two ways to update this registry information:
    1)call removeObject() function
    2)in icepackadmin window, issue a "remove object xxx" command.

    but all of above need human-intervening. If IcePack registry can do this for us, it will be very excellent.
  • moatasmoatas Member
    One solution we have used it to use the Ice/Query interface and unique names. Our services register themselves in the locator with a unique name, so if they die, they can come back up with no problems. Our clients, will query the locator and ask for all services with the type specified with our services. We have a utility class that handles this, and will ensure that the proxy that gets handed back is current. It will attempt an ice_ping on each proxy returned. If the proxy does not respond, it invokes the admin remove call.

    But I do agree it would be nice if it was handled more like Jini and Reggie do. The lookup locator registers a proxy, allow the concept of a lease. The proxy is only valid for a specific period of time and then it is discarded if it is not re-leased. But as long as you build a little logic into your clients, you can handle this gracefully.

    Birch
  • rc_hzrc_hz Member Eric RCOrganization: www.genband.comProject: No project yet ✭✭✭
    Thank you, moatas.

    Yes, your solution is OK! But it needs programmer's extra work! It's not so good!

    In my viewpoint, it's not so difficult to realize this functionality by using UDP broadcast such as VisiBroker's osagent.

    BTW, in Ice, if icepackregistry process dies and restart, all the other Ice servers have to restart too! This is too terrible! VisiBroker's osagent has no problem of this kind!
Sign In or Register to comment.