@Override
	public void actionPerformed(ActionEvent action_event)
	{
		String action = action_event.getActionCommand();

		// for log4j configuration
//		RollingFileAppender appender = new RoleSpecificRollingFileAppender();

		if (action.equals(ConsProApp.START_BTN_ACTION))
		{
			String role = this.role_grp.getSelection().getActionCommand();

			// act as a replica
			if (role.equals(ConsProApp.REPLICA_BTN_ACTION))
			{
				// for log4j configuration
//				appender.setFile(Configuration.REPLICA_LOG_FILE);
//				BasicConfigurator.configure(appender);

				/**
				 * Write the chosen replica address (and its id) into the Configuration.CONFIG_REPLICA_FILE file
				 */
				String replica_addr_rid = ((AddressPlusRid) this.replica_combo_box.getSelectedItem()).toString();
				FileUtil.write2File(Configuration.CONFIG_REPLICA_FILE, replica_addr_rid);


				Replica.INSTANCE.start();
				this.broadcast_btn.setEnabled(true);

			}
			// act as a client
			else // role.equals(ConsProApp.CLIENT_BTN_ACTION)
			{
				/**
				 * Write the user-input client address and the chosen default replica address into
				 * the Configuration.CONFIG_CLIENT_FILE file.
				 */

				String client_addr = this.client_addr_txt.getText().trim();
				String default_replica_addr = ((Address) this.default_replica_combo_box.getSelectedItem()).toString();

				StringBuilder client_config = new StringBuilder();
				client_config.append(client_addr).append("\n").append(default_replica_addr);
				FileUtil.write2File(Configuration.CONFIG_CLIENT_FILE, client_config.toString());

				int total_request = Integer.parseInt(this.total_request_txt.getText().trim());
				int rate = Integer.parseInt(this.rate_txt.getText().trim());
				int write_ratio = Integer.parseInt(this.write_ratio_txt.getText().trim());
				
				// run the benchmark
				new ConsProBenchmarkRunner(total_request, rate, write_ratio).start();
			}

			this.replica_radio_btn.setEnabled(false);
			this.client_radio_btn.setEnabled(false);
			this.replica_combo_box.setEnabled(false);
			this.client_addr_txt.setEnabled(false);
			this.default_replica_combo_box.setEnabled(false);
			this.start_btn.setEnabled(false);
		}
		else if (action.equals(ConsProApp.BROADCAST_BTN_ACTION))
		{
			Replica.INSTANCE.startBroadcastService();
			this.broadcast_btn.setEnabled(false);
		}
	}