Archived

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

Servant object can't be found in IceGrid GUI.

hi
I deploy servant object to ice grid node in folowing style:
String prefix="SslService";
String object="sslService";
String serverId="38";
Properties props = Ice.Util.createProperties();
props.setProperty("Ice.Default.Locator", defaultLocator);
props.setProperty("Ice.ImplicitContext", "PerThread");
props.setProperty("Ice.ProgramName", prefix + serverId);

props.setProperty(prefix + "Adapter.ReplicaGroupId", prefix
		+ "RepGroup");
props.setProperty(prefix + "Adapter.RegisterProcess", "0");
props.setProperty(prefix + "Adapter.AdapterId", prefix
		+ serverId + "." + prefix + "Adapter");
props.setProperty(prefix + "Adapter.Endpoints", endPoints);
InitializationData id = new InitializationData();
id.properties = props;
communicator = Ice.Util.initialize(id);
Ice.Identity objectIdentity = communicator.stringToIdentity(objectId);
adapter.add(new SslServiceI(),objectIdentity);
adapter.activate();

At client site:
Properties props = Ice.Util.createProperties();
InitializationData id = new InitializationData();
id.properties = props;
props.setProperty(
	"Ice.Default.Locator",
	"OkoooGrid/Locator:default -p 4061 -h 192.168.8.36:default -p 4061 -h 192.168.8.38:default -p 4061 -h 192.168.8.41");
Communicator communicator = Ice.Util.initialize(id);
String objectId = "sslService@SslServiceRepGroup";
SslServicePrx sslServiceI = SslServicePrxHelper
		.checkedCast(communicator.stringToProxy(objectId));

And everything is OK, I can locator servant object at client site and invoke it's method, but I can't find the object at IceGrid GUI.

Comments

  • And there is another problems:

    I deploy the servant object to OSGi container, so the life cycle of servant object is managed by OSGi container. So I can't use command line tool(IceGridAdmin) to deploy my applications to IceGrid. And although I can deploy servant to a Replica Group, but I don't know how to change the load balancing policy of the Replica Group.

    will anybody tell me how to resolve this problem?

    thanks.
  • matthew
    matthew NL, Canada
    Jiangyubao wrote: »
    ...
    And everything is OK, I can locator servant object at client site and invoke it's method, but I can't find the object at IceGrid GUI.

    That is expected. IceGrid doesn't track individual objects, that would never scale. If you want to have individual objects in the registry, then you should register a well known object. See the Ice manual, or Michi's articles on IceGrid in Connections (http://www.zeroc.com/newsletter/index.html).
    I deploy the servant object to OSGi container, so the life cycle of servant object is managed by OSGi container. So I can't use command line tool(IceGridAdmin) to deploy my applications to IceGrid.

    I'm not sure what you mean here. Do you mean you cannot have on-demand activation of servers?
    And although I can deploy servant to a Replica Group, but I don't know how to change the load balancing policy of the Replica Group.

    You change the load balancing policy with the load-balancing attribute of the replica-group tag. For example,
    <replica-group id="EncoderAdapters"> 
    <load-balancingtype="adaptive"/> 
    

    You can find more details in the Ice manual.
  • Thanks a lot for your reply.
    I deploy the servant object to OSGi container, so the life cycle of servant object is managed by OSGi container. So I can't use command line tool(IceGridAdmin) to deploy my applications to IceGrid.

    I'm not sure what you mean here. Do you mean you cannot have on-demand activation of servers?

    I mean that the servant services are self-started and self-register to IceGrid, so I don't need to use IceGridAdmin tool to deploy a XML file to IceGrid, and so I don't know how to change the load balancing policy of the Replica Group.
  • bernard
    bernard Jupiter, FL
    You can register your servers and well-known objects programmatically: you don't need to use XML files.

    For well-known objects, the simplest is to use IceGrid::Admin addObject or IceGrid::Admin addObjectWithType.

    Best regards,
    Bernard
  • Thanks for your reply!

    But now I don't think it's necessary for us to change our Java code since our service is stable, and I also now how to reslove this problem.

    Thanks