isac-java/src/java/isac/bridge/BridgeMain.java
changeset 5239 b4e3883d7b66
parent 5237 ee17f1b81a7f
     1.1 --- a/isac-java/src/java/isac/bridge/BridgeMain.java	Tue Sep 22 14:33:32 2020 +0200
     1.2 +++ b/isac-java/src/java/isac/bridge/BridgeMain.java	Fri Mar 26 10:45:05 2021 +0100
     1.3 @@ -13,9 +13,13 @@
     1.4   */
     1.5  import isac.util.BridgeMainPaths;
     1.6  import isac.util.FixedPortRMISocketFactory;
     1.7 -import info.hupel.isabelle.api.*;
     1.8 -import info.hupel.isabelle.japi.*;
     1.9 -import info.hupel.isabelle.setup.*;
    1.10 +import edu.tum.cs.isabelle.api.Configuration;
    1.11 +import edu.tum.cs.isabelle.api.Environment;
    1.12 +import edu.tum.cs.isabelle.api.Version;
    1.13 +import edu.tum.cs.isabelle.japi.JPlatform;
    1.14 +import edu.tum.cs.isabelle.japi.JSetup;
    1.15 +import edu.tum.cs.isabelle.japi.JSystem;
    1.16 +import edu.tum.cs.isabelle.setup.Setup;
    1.17  
    1.18  import java.awt.BorderLayout;
    1.19  import java.awt.Color;
    1.20 @@ -26,11 +30,9 @@
    1.21  import java.io.BufferedReader;
    1.22  import java.io.IOException;
    1.23  import java.io.Serializable;
    1.24 -import java.nio.file.Path;
    1.25  import java.nio.file.Paths;
    1.26  import java.rmi.RemoteException;
    1.27  import java.rmi.server.RMISocketFactory;
    1.28 -import java.util.Arrays;
    1.29  
    1.30  import javax.swing.JFrame;
    1.31  import javax.swing.JPanel;
    1.32 @@ -80,52 +82,11 @@
    1.33          new ClientList();
    1.34          setUpBridgeLog();
    1.35          //*TTY*/startThreadsFirstTime();
    1.36 -/* cp from last working version:
    1.37 - *  https://hg.risc.uni-linz.ac.at/wneuper/isac/file/84f1ca6a6dd9/isac-java/src/java/isac/bridge/BridgeMain.java#l85
    1.38 -    85         log(1, "-->ISA: try connection with ISABELLE_HOME=\"" + isabelle_home + "\"...");
    1.39 -    86         Setup setup = new Setup(Paths.get(isabelle_home), JPlatform.guess(),
    1.40 -    87           new Version("2015"), Setup.defaultPackageName());
    1.41 -    88         Environment env = JSetup.makeEnvironment(setup); // without Duration
    1.42 -    89         Configuration config = Configuration.fromBuiltin("libisabelle_Isac");
    1.43 -    90         JSystem sys = JSystem.create(env, config);
    1.44 -    92         
    1.45 -    93         connection_to_kernel_ = sys;
    1.46 -    94         log(1, "<--ISA: connection established");
    1.47 - */
    1.48 -/* cp from downloaded libisabelle, current version:
    1.49 -package info.hupel.isabelle.examples.java;
    1.50 -
    1.51 -import java.nio.file.Path;
    1.52 -import java.nio.file.Paths;
    1.53 -import java.util.Arrays;
    1.54 -import info.hupel.isabelle.api.*;
    1.55 -import info.hupel.isabelle.japi.*;
    1.56 -import info.hupel.isabelle.setup.*;
    1.57 -
    1.58 -public class Hello_PIDE {
    1.59 -
    1.60 -  public static void main(String args[]) {
    1.61 -    JResources res = JResources.dumpIsabelleResources();
    1.62 -    Configuration config = Configuration.simple("Protocol");
    1.63 -    Environment env = JSetup.makeEnvironment(JSetup.defaultSetup(new Version.Stable("2017")), res);
    1.64 -    JSystem sys = JSystem.create(env, config);
    1.65 -    String response = sys.invoke(Operations.HELLO, "world");
    1.66 -    System.out.println(response);
    1.67 -    sys.dispose();
    1.68 -  }
    1.69 -}
    1.70 - */
    1.71          /*PIDE*/log(1, "-->ISA: try connection with ISABELLE_HOME=\"" + isabelle_home + "\"...");
    1.72 -
    1.73 -        //these two values shall come from BridgeMail.properties
    1.74 -        Path path = java.nio.file.Paths.get   //
    1.75 -          ("/home/wneuper/.isabelle/isabisac/heaps/polyml-5.7.1_x86-linux/libisabelle_Isac");
    1.76 -        String vers = "2018";
    1.77 -        
    1.78 -        JResources res = JResources.dumpIsabelleResources();
    1.79 -        Setup setup = new Setup(path, JPlatform.guess(), new Version.Stable(vers));
    1.80 -        Environment env = JSetup.makeEnvironment(setup, res);
    1.81 -        //Configuration config = Configuration.fromBuiltin("libisabelle_Isac"); //fromBuiltin is undefined
    1.82 +        Setup setup = new Setup(Paths.get(isabelle_home), JPlatform.guess(),
    1.83 +          new Version("2015"), Setup.defaultPackageName());
    1.84 +        Environment env = JSetup.makeEnvironment(setup); // ohne Duration
    1.85 +        Configuration config = Configuration.fromBuiltin("libisabelle_Isac");
    1.86          JSystem sys = JSystem.create(env, config);
    1.87  
    1.88          /*PIDE*/connection_to_kernel_ = sys;
    1.89 @@ -259,4 +220,4 @@
    1.90              e.printStackTrace();
    1.91          }
    1.92      }
    1.93 -}
    1.94 \ No newline at end of file
    1.95 +}