Ejemplo n.º 1
0
  public CryoBay reconnectServer(ORB o, ReconnectThread rct) {

    BufferedReader reader;
    File file;
    ORB orb;
    org.omg.CORBA.Object obj;

    orb = o;

    obj = null;
    cryoB = null;

    try {
      // instantiate ModuleAccessor
      file = new File("/vnmr/acqqueue/cryoBay.CORBAref");
      if (file.exists()) {
        reader = new BufferedReader(new FileReader(file));
        obj = orb.string_to_object(reader.readLine());
      }

      if (obj != null) {
        cryoB = CryoBayHelper.narrow(obj);
      }

      if (cryoB != null) {
        if (!(cryoB._non_existent())) {
          // System.out.println("reconnected!!!!");
          rct.reconnected = true;
        }
      }
    } catch (Exception e) {
      // System.out.println("Got error: " + e);
    }
    return cryoB;
  }
Ejemplo n.º 2
0
  public void run() {

    // System.out.println("running cryothread");

    while (!stop) {
      updateStates();
      try {
        sleep(1000);
      } catch (Exception e) {
        System.out.println("cannot sleep!");
      }
    }
    // System.out.println("reconnect thread starting...");
    reconnectThread = new ReconnectThread(cryo, frame, clientGui);
    reconnectThread.start();
  }