public void init() { add(intitule); add(texte); add(bouton); bouton.addActionListener(this); try { ORB orb = ORB.init(this, null); FileReader file = new FileReader(iorfile.value); BufferedReader in = new BufferedReader(file); String ior = in.readLine(); file.close(); org.omg.CORBA.Object obj = orb.string_to_object(ior); annuaire = AnnuaireHelper.narrow(obj); } catch (org.omg.CORBA.SystemException ex) { System.err.println("Error"); ex.printStackTrace(); } catch (FileNotFoundException fnfe) { System.err.println(fnfe.getMessage()); } catch (IOException io) { System.err.println(io.getMessage()); } catch (Exception e) { System.err.println(e.getMessage()); } }
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; }
public ClientGui(ORB o) throws Exception { ShutdownFrame sf; BufferedReader reader; boolean modulePresent; File file; CryoThread update; orb = o; obj = null; cryoBay = null; // System.out.println("running test client."); // 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) { throw new Exception("string_to_object is null: cryoBay.CORBAref"); } // System.out.println("Got object."); cryoBay = CryoBayHelper.narrow(obj); if (cryoBay == null) { throw new Exception("cryoBay is null"); } if (cryoBay._non_existent()) { throw new Exception("cryoBay is not running"); } sf = new ShutdownFrame(cryoBay); update = new CryoThread(cryoBay, sf, this); sf.show(); update.start(); } /*end of constructor*/