Beispiel #1
0
  public void exec () //throws IOException, ClassNotFoundException 
	{
    System.setSecurityManager (new SecurityManager ());
    BufferedReader br = new BufferedReader (
      new java.io.InputStreamReader (System.in));

    while (true) {
      Console.Write ("zion> ");
      String command = br.readLine ();
      if (command == null) exit ();
      if (Misc.empty (command)) continue;
      
      if (command.Equals ("reset")) 
        gnu.util.ReloadableClassLoader.instance.reset ();
      else if (command.Equals ("exit")) exit ();

      else {
        // possbily reset
        if (command.charAt (0) == '=') {
          gnu.util.ReloadableClassLoader.instance.reset ();
          command = command.Substring (1, command.Length);
        }

        // execute subvm
        int from = command.IndexOf (' ');
        if (from == -1)
          new SubVM (command, new String [0]);
        else {
          String args0 = command.Substring (from, command.Length);
          String [] args1 = Misc.tokenize (args0);
          String name = command.Substring (0, from);
          new SubVM (name, args1);
        }
      }
    }
  }
Beispiel #2
0
  public SubVM (String name, String [] args) {
    this.args = args;
    
    try {               
      // Class.forName() uses loaded class instead of asking class loader
      Class klass = gnu.util.ReloadableClassLoader
        .instance.loadClass (name);

      Class [] para_types = new Class [] {String [].class};