Archived

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

Another way to use icegrid

Hi, I find a way to use IceGrid within a container, for example, we deploy our adapter at a tomcat web server(we do not use icegridadmin to to deploy our application via XML). Before adapter startup by themself, these adapter auto create and save the information of ApplicationDescriptor, ReplicaGroupDescriptor, NodeUpdateDescriptor, ServerDescriptor, AdapterDescriptor into icegrid, so you can see everything is the same to the application deployed by icegridadmin via XML.

When the adapters are startup, we can invoke the methods from any ice client.

But there is another problem, how to make the server to be activated, or how can I see the 'server_active.png‘ to be displayed in IceGridGUI?

I read the the source code of IceGridGUI, and find the following code:
  public void updateServer(final String node, final ServerDynamicInfo updatedInfo, Ice.Current current)
    {
        if(_trace)
        {
            _coordinator.traceObserver("updateServer for server " + updatedInfo.id
                                       + " on node " + node + "; new state is "
                                       + updatedInfo.state.toString());
        }

        SwingUtilities.invokeLater(new Runnable()
            {
                public void run()
                {
                    _coordinator.updateServer(node, updatedInfo);
                }
            });
    }

Now I know that, when the server state changed, IceGrid will call this method to send ServerDynamicInfo to IceGridGUI. But how to modify the ServerDynamicInfo when I need? Can I use AdminSessionPrx to modify ServerDynamicInfo?

Comments

  • benoit
    benoit Rennes, France
    Hi,

    The information from the ServerDynamicInfo class is updated when a server is started or stopped for example. You can use the IceGrid::Admin interface to start or stop servers (the startServer/stopServer methods).

    Cheers,
    Benoit.
  • The Path to Executabe is 'ls', so these servers can't start from IceGridGUI. I try to start it from IceGridGUI, it can't work, and the error message is:
    Server xxx dit not start: The server terminated unexpectedly with exit code 2.
    
  • Hi,
    do you interested in OSGi and distributed OSGi?

    Here is osgi alliance website:
    OSGi Alliance | Main / OSGi Alliance

    And here is a distributed osgi implement:
    Apache CXF -- Distributed OSGi

    This osgi implement use apache's CXF to expose/wrap the OSGi service to WebService for client to access. Although CXF is supported by many program language, but it's based on HTTP protocol, so we need a load balance to dispatch the request to OSGi cluster.

    So I think ICE will be the best middle-ware framework for distributed osgi implement. By using ICE, we can expose OSGi service to ICE service for any language that support ICE to access. We can deploy many OSGi containers, and then use IceGrid to make a cluster.