Home Help Center

IceGrid registry

rhjunrhjun Member ren huajunOrganization: Huazhong Univercity of Science and TechnologyProject: RealTime Database project
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

  • matthewmatthew NL, CanadaMember Matthew NewhookOrganization: ZeroC, Inc.Project: Internet Communications Engine ✭✭✭
    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.
  • rhjunrhjun Member ren huajunOrganization: Huazhong Univercity of Science and TechnologyProject: RealTime Database project
    Thank you for your replay!
  • rhjunrhjun Member ren huajunOrganization: Huazhong Univercity of Science and TechnologyProject: RealTime Database project
    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!!!
  • benoitbenoit Rennes, FranceAdministrators, ZeroC Staff Benoit FoucherOrganization: ZeroC, Inc.Project: Ice ZeroC Staff
    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.
  • rhjunrhjun Member ren huajunOrganization: Huazhong Univercity of Science and TechnologyProject: RealTime Database project
    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.
Sign In or Register to comment.