Archived

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

IceGrid registry

Hello:
Could I register a node in a server program with API,not
using "icegridnode" on command line?If I could not, then how to register a node with API,as I want to catch the exception when I register a node.
Thank you very much!

Comments

  • matthew
    matthew NL, Canada
    Yes, you can call directly on the icegrid node using its slice interface. For information on the slice interface see slice/IceGrid, or look at how icegridnode is implemented.
  • Thank you for your replay!
  • matthew wrote: »
    Yes, you can call directly on the icegrid node using its slice interface. For information on the slice interface see slice/IceGrid, or look at how icegridnode is implemented.

    Thanks for your hint.I want to use "addobject" to register a object.Here is my code
    server
    Ice::PropertiesPtr properties = Ice::createProperties();
    properties->load("config.server");
    Ice::CommunicatorPtr ic;
    ic = Ice::initializeWithProperties(dummy,0,properties);

    Ice::ObjectPtr object = new HelloI("SimpleServer4");
    Ice::ObjectAdapterPtr adapter =
    ic->createObjectAdapterWithEndpoints("MyAdapter","tcp");
    adapter->activate();
    Ice::ObjectPrx proxy = adapter->add(object, ic->stringToIdentity("hello4"));
    IceGrid::AdminPrx admin = IceGrid::AdminPrx::checkedCast(ic->stringToProxy("IceGrid/Admin"));
    admin->addObjectWithType(proxy,proxy->ice_id());
    ic->waitForShutdown();


    But when I start server I obtain "no object with id `IceGrid/Admin' is registered".I can't find "IceGrid/Admin'" using icegridadmin.
    My question is :Should I register "IceGrid/Admin"?Or this object has been registered by ICE?
    Thank you very much!!!
  • benoit
    benoit Rennes, France
    Hi,

    See my reply on this [thread=3409]thread[/thread]. The "IceGrid/Admin" well-known object doesn't exist anymore -- you now need to establish an administrative session to get a hold on the IceGrid admin interface.

    Cheers,
    Benoit.
  • benoit wrote: »
    Hi,

    See my reply on this [thread=3409]thread[/thread]. The "IceGrid/Admin" well-known object doesn't exist anymore -- you now need to establish an administrative session to get a hold on the IceGrid admin interface.

    Cheers,
    Benoit.
    Thank you very much for your help!
    I got it working now, your help is greatly appreciated.