FileDocCategorySizeDatePackage
ServerClient.javaAPI DocExample1421Wed Apr 05 11:25:42 BST 2000None

ServerClient

public class ServerClient extends Object

Fields Summary
Constructors Summary
Methods Summary
public static voidmain(java.lang.String[] argv)

    ORB orb = ORB.init(argv, null);
    org.omg.CORBA.Object ref = null;
    try {
      ref = orb.resolve_initial_references("NameService");
    }
    catch (InvalidName invN) {
      System.out.println("No primary NameService available.");
      System.exit(1);
    }
    NamingContext nameContext = NamingContextHelper.narrow(ref);
    NameComponent comp = new NameComponent("ThisOrThatServer", "");
    NameComponent path[] = {comp};
    try {
      org.omg.CORBA.Object ref2 = nameContext.resolve(path);
      ThisOrThatServer server = ThisOrThatServerHelper.narrow(ref2);
      System.out.println("Got server, calling methods...");
      server.doThis("something");
      server.doThat("something else");
    }
    catch (Exception e) {
      System.out.println("Failed to access server.");
      e.printStackTrace();
    }