
// Wird der JAVAMeister benutzt, muss man vorher
// setenv THREADS_FLAG native
// setzen.

package ServerAufg1;

import org.omg.CORBA.*;
import VierGewinnt.*;

/**
 * Startet den PartieManager und den JAVAMeister.<br>
 * Initialisiert den ORB und den BOA, instanziert die beiden Objekte und 
 * aktiviert sie mit Hilfe des BOAs und wartet dann auf eingehende Anfragen.
 * @author Michael Dom, Wolfgang Westje
 */
public class Server {

  public static void main(String[] args) {

      // HIER BEGINNT IHRE AUFGABE
      System.out.print("Starten den Server (Anneliese)");
      try{
	  //Init the ORB
	  ORB orb = ORB.init(args,null);
	  
	  //Init the BOA
	  BOA boa = orb.BOA_init();
	  System.out.print(".");
	  //Create the remote objects
	  PartieManagerImpl manager = new PartieManagerImpl("Else"); 
	  System.out.print(".");
	  MeisterImpl meister = new MeisterImpl("Gunther");
	  System.out.print(".");
	  //Export the remote objects to the ORB
	  boa.obj_is_ready(manager);
	  System.out.print(".");
	  boa.obj_is_ready(meister);
	  System.out.print(".");
	  //ready to requests
	  boa.impl_is_ready();
	  System.out.print("fertig\n");
      }
      catch(SystemException e){
	  System.out.println("Nichts tut!\ngenauer:\n");
	  System.out.println(e);
      }
      // HIER ENDET IHRE AUFGABE
    
  }
}

