Results 1 to 5 of 5

Thread: Udpate an IceGrid configuration

  1. #1
    Matthieu is offline Registered User
    Name: Mat Rei
    Organization: 4sxs Consulting
    Project: communication
    Join Date
    Oct 2008
    Posts
    14

    Udpate an IceGrid configuration

    Hello !

    I am developping an application which use IceGrid. I would like to be able to update the IceGrid configuration, without change manually the XML file. I would like that my application do this automatically (throws command automatically) ? Is that possible ?
    For exemple to create a new replica-group, a new serveur template with an adaptor... just with icegridadmin commands.

    I read the "administration utilities" in the documentation but I didn't see commands for add objects, just for list and update them.

    I discover the IceGridGUI.jar tool, it is possible to do all what I want ! But it is not automatisable, it is a GUI.

    The third solution is to developp a tool which will update the XML file and than throw the command icegridadmin "application update file.xml", but it is not so practical.

    What solutions are feasible and the best ? Is there any other solution ?

    Thank you for your help !
    Cheers,
    Matthieu


    Here my initial XML file :

    <icegrid>
    <application name="Simple">

    <replica-group id="Rserv_point">
    <load-balancing type="adaptive"/>
    <object identity="affpoint" type=":emo::Caracteristique"/>
    </replica-group>

    <server-template id="templ_point">
    <parameter name="index"/>
    <parameter name="exepath" default="java"/>
    <server id="serv_point${index}" exe="${exepath}" activation="on-demand">
    <option>Serverpoint</option>
    <property name="Ice.MessageSizeMax" value="1000000000"/>
    <adapter name="Aserv_point" endpoints="tcp" register-process="true" replica-group="Rserv_point"/>
    </server>
    </server-template>

    <node name="node_serv_point_1">
    <server-instance template="templ_point" index="1" exepath="java"/>
    </node>

    <node name="node_serv_point_2">
    <server-instance template="templ_point" index="2" exepath="java"/>
    </node>

    </application>
    </icegrid>

  2. #2
    benoit's Avatar
    benoit is offline ZeroC Staff
    Name: Benoit Foucher
    Organization: ZeroC, Inc.
    Project: Ice
    Join Date
    Feb 2003
    Location
    Rennes, France
    Posts
    2,196
    Bonjour Matthieu,

    You can use the same API as the IceGridGUI: the IceGrid::Admin interface defined in slice/IceGrid/Admin.ice. To get a proxy on the IceGrid::Admin interface, you need to create an administrative session with IceGrid (see here for information on how to do this).

    You can add/update/delete your IceGrid application using the addApplication/updateApplication/removeApplication methods of the IceGrid::Admin interface. These methods use a number of Slice descriptors defined in slice/IceGrid/Descriptor.ice to describe the updates to apply to an application or to create a new application. You should be able to add/update/remove replica groups, well-known objects using these descriptors.

    Cheers,
    Benoit.

  3. #3
    Matthieu is offline Registered User
    Name: Mat Rei
    Organization: 4sxs Consulting
    Project: communication
    Join Date
    Oct 2008
    Posts
    14
    Oh, wonderful !!

    That's exactly what I was looking for !

    Thank you, Benoit !

    Cheers,
    Matthieu

  4. #4
    Matthieu is offline Registered User
    Name: Mat Rei
    Organization: 4sxs Consulting
    Project: communication
    Join Date
    Oct 2008
    Posts
    14
    Hello !!

    I tried to create an administration session...


    #include <IceUtil/IceUtil.h>
    #include <Ice/Ice.h>
    #include <IceGrid/IceGrid.h>
    #include <IceGrid/Admin.h>
    #include <IceGrid/Session.h>

    #include <string>

    int main()
    {

    Ice::ObjectPrx base =communicator->stringToProxy("DemoIceGrid:tcp -p 12000");
    IceGrid::RegistryPrx registry =IceGrid::RegistryPrx::checkedCast(base);
    string username = "foo";
    string password = "bar";
    IceGrid::AdminSessionPrx session;
    try {
    session = registry->createAdminSession(username, password);
    } catch (const IceGrid::PermissionDeniedException & ex) {
    cout << "permission denied:\n" << ex.reason << endl;
    }

    return 0;
    }


    That the source from the documentation... when I compiled I have an error because the compiler don't know the object "communicator", that's normal !

    I tried, as on the server to replace the line with : Ice::ObjectPrx base =communicator()->stringToProxy("DemoIceGrid:tcp -p 12000");

    Then I tried : Ice::ObjectPrx base = Ice::CommunicatorPtr()->stringToProxy("DemoIceGrid:tcp -p 12000");
    It compiled, but at the execution there is a IceUtil::NullHandleException error...
    Can you help me ?

    Cheers,
    Matthieu

  5. #5
    matthew's Avatar
    matthew is offline ZeroC Staff
    Name: Matthew Newhook
    Organization: ZeroC, Inc.
    Project: Internet Communications Engine
    Join Date
    Feb 2003
    Location
    NL, Canada
    Posts
    1,458
    You need to create the communicator, which can you do by calling Ice::initialize, or you can avoid that be using Ice::Application. In this case, I'm afraid there is no substitute for reading the manual, and studying the demos. Please look at demo/Ice/minimal, or demo/Ice/hello for some simple demo.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 1
    Last Post: 04-06-2010, 07:04 PM
  2. IceGrid configuration
    By Matthieu in forum Help Center
    Replies: 2
    Last Post: 11-20-2008, 10:24 AM
  3. PHP Configuration
    By sayotte in forum Help Center
    Replies: 1
    Last Post: 04-15-2007, 08:31 PM
  4. Plugin configuration
    By kwaclaw in forum Comments
    Replies: 9
    Last Post: 09-29-2005, 07:07 PM
  5. IceStorm example - configuration
    By Bruce in forum Help Center
    Replies: 1
    Last Post: 03-18-2004, 11:57 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •