public boolean run(String configurationFileName, String localName, String clock) {
		this.configurationFileName = configurationFileName;
		this.localName = localName;
		this.sequenceNumber = 1;
		connectionPool = new ConcurrentHashMap<String, Connection>();

		// Initiate buffer
		sendBuffer = new ConcurrentLinkedQueue<TimeStampedMessage>();
		receiveBuffer = new ConcurrentLinkedQueue<TimeStampedMessage>();
		delayedMessageBuffer = new ConcurrentLinkedDeque<TimeStampedMessage>();

		// Parse configuration file
		configurationFileReader = new ConfigurationFileReader(textArea);
		configurationFileReader.parseFile(this.configurationFileName);

		// Initiate ruleChecker
		ruleChecker = new RuleChecker(configurationFileReader.getSendRules(),
				configurationFileReader.getReceiveRules(), textArea);

		// Initiate a connection to logger
		try {
			LoggerInfo loggerInfo = configurationFileReader.getLoggerInfo();
			loggerSocket = new Socket(loggerInfo.getIpAddress(), loggerInfo.getPort());
			loggerOut = new ObjectOutputStream(loggerSocket.getOutputStream());
			textArea.append("Connected to logger at " + loggerInfo.getIpAddress() + ":" + loggerInfo.getPort() + "\n");
		} catch (Exception e) {
			textArea.append("Cannot connect to logger\n");
		}

		ArrayList<Process> al = configurationFileReader.getProcesses();
		int local_id = 0;
		for (int i=0; i<al.size(); i++) {
			if (al.get(i).getName().equals(localName)) {
				local_id = i;
				break;
			}
		}
		// Initiate a clock
		if (clock.contains("logical")) {
			clockService = ClockFactory.useClock(ClockType.LOGICAL, 0, 0);
		} else if (clock.contains("vector")) {
			clockService = ClockFactory.useClock(ClockType.VECTOR, configurationFileReader.getProcesses().size(),
					local_id);
		}

		// Setup server socket
		localPortNumber = configurationFileReader.getProcessPortByName(localName);
		textArea.append("Local port number: " + localPortNumber + "\n");
		if (localPortNumber == -1) {
			textArea.append("Invalid local port number!\n");
			return false;
		}
		try {
			serverSocket = new ServerSocket(localPortNumber);
			textArea.append("Set up server socket success!\n");
		} catch (Exception e) {
			textArea.append("Set up server socket fail!\n");
			return false;
		}

		/* Run thread to receive connection */
		Runnable receiveConnectionJob = new ReceiveConnectionJob(serverSocket, connectionPool, receiveBuffer,
				configurationFileReader, textArea, clockService);
		Thread receiveConnectionThread = new Thread(receiveConnectionJob);
		receiveConnectionThread.start();

		return true;
	}