Archived

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

Question about IceGrid Administrative Sessions

Hi,

I am trying to use the IceGrid Administrative Sessions. I initialize the session by following codes:

try
{
final RegistryPrx registry = RegistryPrxHelper.checkedCast(ic.stringToProxy("EclipseGrid/Registry"));
final AdminSessionPrx session = registry.createAdminSession("Dan", "");
session.setObservers(regObs, nodeObs, appObs, adptObs, objObs);
Thread thread = new Thread(new Runnable()
{
@Override
public void run()
{
// TODO Auto-generated method stub
int timeout = registry.getSessionTimeout();
for (;;)
{
session.keepAlive();
try
{
Thread.sleep(timeout * 1000);
}
catch (InterruptedException e)
{
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
});
thread.start();
}
catch (PermissionDeniedException e)
{
// TODO Auto-generated catch block
e.printStackTrace();
System.exit(-1);
}

I have already started some server processes with adapters and well-known objects registered in IceGrid. However, from the AdapterInit, it returns 0. And, from ObjectInit, i can only get those well-known objects created by IceGrid (i.e. InternalRegistry-Master, InternalRegistry-Replica1, Locator, Query, Registry, Registry-Replica1). Any well-known objects created by my server processes or IceStorms cannot be retrieved. Is there any problem in my usage? I know that I can retrieve the active adapters from nodeInit. So, what is the usage the AdapterInit then?

Comments

  • Another question is:

    At NodeObserver, we can get the server state from updateServer method. There is a field "state' of ServerDynamicInfo to indicate the state. But from updateAdapter method, I cannot find any field of AdapterDynamicInfo to indicate the state. How could we get that then?
  • benoit
    benoit Rennes, France
    Hi,

    I would ping a little more often than every "timeout" (timeout / 2 for example) to make sure the keepAlive request is received before the session might timeout.

    The adapter and object observers only received updates for well-known object and adapters that are registered independently from an IceGrid application. If you deployed your servers with an IceGrid application, you should use the application descriptor to figure out the adapters and well-known objects provided by your application.

    The state of an object adapter is either active or inactive, you can check for this state with the proxy attribute of the AdapterDynamicInfo structure. If the proxy is null, the adapter is inactive, it's active otherwise.

    Cheers,
    Benoit.
  • Hi benoit,

    Thanks for the reply. I have already registered those well-known object and adapters in icegrid. So, the live deployment tab of the icegridGUI, I can see that the adapter is active. For example, I configure a iceStorm by using icegridGUI. There is a well-known object "TopicManager" added in the registry. But in objectInit, I still cannot get that well-know objects.

    Also, I can retrieve those active adapters from nodeInit. Then what is the purpose of AdapterInit then?
  • benoit
    benoit Rennes, France
    Hi,

    How do you register the adapters and well-known objects? Are they registered as the result of adding an application (with an application descriptor) to the registry or do you register them programmatically using the IceGrid Admin interface (with the addObject method or using adapter dynamic registration)? If it is the former, then it is expected to not get these adapters or objects with the object or adapter observers: objects and adapters registered with IceGrid application descriptors are accessible through the application observer instead.

    The purpose of the adapter and object observers is to provide access to the objects and adapters which are not registered with an application descriptor (instead these objects or adapters are accessible through the application descriptors provided by the application observer).

    The purpose of the node observer is to provide dynamic state updates of IceGrid deployed adapters and servers.

    Cheers,
    Benoit.
  • Hi Beonit,

    Thank you for the quick reply. I am using application descriptor to add those adapters and well-known objects so I should use application observer to retrieve those information.

    Regards,
    Dan