Home Help Center

Section 38.5.3 of the manual (Addiing objects in a program)

stephanstephan Member Stephan StapelOrganization: Stephan StapelProject: BristolNG
Hi!

While stepping up to Ice 3.2.0, I discovered that the admin interface is no longer available per default in the IceGrid Registry (unfortunately).

I was wondering if the section 38.5.3 which describes the programmatic registration of objects in the registry was forgotten or if you left it like it was by means.
Could you provide a little demo on how to best (easily) register objects now?

Regards,

Stephan

Comments

  • benoitbenoit Rennes, FranceAdministrators, ZeroC Staff Benoit FoucherOrganization: ZeroC, Inc.Project: Ice ZeroC Staff
    Hi Stephen,

    You need to create a session with the IceGrid::Registry interface to get a hold on an IceGrid::Admin object. For example:
        IceGrid::RegistryPrx registry = com->stringToProxy("DemoIceGrid/Registry");
        try
        {
            IceGrid::AdminSessionPrx session = registry->createAdminSession("testuser", "testpassword");
            IceGrid::AdminPrx admin = session->getAdmin();
    
            // Use admin proxy to add object.
        }
        catch(const PermissionDeniedException& ex)
        {
            // Handle exception
        }
    

    The next version of the manual will be fixed to not mention anymore IceGrid/Admin.

    Cheers,
    Benoit.
Sign In or Register to comment.