public ServerImpl(String ip, String inputfile) throws RemoteException {
		System.setSecurityManager(new LiberalSecurityManager());
		registryAddress = ip;
		servers = new Hashtable();
		transactionCounter = nofAborts = 0;
		activeTransaction = null;
		readGlobalParameters(inputfile);
		createResources();

		try {
			// Find the registry proxy object used to bind non-local objects to the registry:
			registryProxy = (RegistryProxy)Naming.lookup("rmi://" + registryAddress + "/RegistryProxy");
		} catch(NotBoundException nbe) {
			System.out.println("Couldn't find RegistryProxy object in registry. Be sure to use the StartRegistry class to start up your registry.");
			System.exit(1);
		} catch(java.net.MalformedURLException mue) {
			System.err.println("Error: Malformed URL; "+mue.getMessage());
			System.exit(1);
		} catch (ConnectException ce) {
			System.err.println("Couldn't connect to the RMI registry. Make sure that a RMI registry is running on the address you specified.");
			System.exit(1);
		}
		// Meet the other servers
		println("Connecting to rmi registry at "+registryAddress);
		// Get the list of all servers registered at the registry
		String[] serverNames = registryProxy.list();
		int maxId = 0;
		// Look them up
		for(int i = 0; i < serverNames.length; i++) {
			maxId = Math.max(maxId, lookUpServer(serverNames[i]));
		}
		// Bind as the next available id
		bindToRegistry(maxId+1);
		// Notify other servers of our arrival
		for(Enumeration e = servers.elements(); e.hasMoreElements(); ) {
			((Server)e.nextElement()).newServerConnected(this);
		}
		// Add ourselves to our server list
		servers.put(new Integer(serverId), this);
		// Open the output file using the append mode
		try	{
			startupTime = System.currentTimeMillis();
			output = new PrintWriter(new FileWriter(Globals.OUTPUT_FILE_PREFIX+"_server_"+serverId+".txt", true));
			output.println("==================================================================");
		} catch (IOException ioe)	{}
		if(testCase != null)
			println("Test case "+testCase+" started.");
		// Start up the GUI
		gui = new Gui("Server "+serverId, resources, servers, this, (serverId-1) % 4);
		println("Server "+serverId+" started.");
		if(input != null)
			runTransactions(input);
		else
			runTransactions();
	}