@Override
	public void handle(Event event) {
		logger.info("Processing an event: " + event.toString());

		ServiceChangeEvent scEvent = (ServiceChangeEvent) event;
		// SyncEvent syncEvent = (SyncEvent) event;
		DynasoarService service = scEvent.getService();
		String WARchecksum = null;
		String Configchecksum = null;
		String WARPath = null;
		String ConfigPath = null;
		byte[] WARArray = null;

		try {
			// Update local service registry and take necessary actions
			switch (scEvent.getType()) {
			case ADDED:
				this.addOrUpdateService(service);
				break;
			case CHANGED:
				this.addOrUpdateService(service);
				break;
			case REMOVED:
				this.removeService(service.getShortName());
				break;
			case DEPLOYED:
			case REDEPLOYED:
				this.deploy(service.getShortName());
				break;
			case UNDEPLOYED:
				this.undeploy(service.getShortName());
				NodeCommunicator.newEvent(new ServiceChangeEvent(service,
						ServiceEventType.UNDEPLOYED));
				break;
			}
		} catch (ServiceDeployException e) {
			logger.error("An error occurred while deploying service.", e);
		} catch (IOException e) {
			logger.error("An error occurred while copying WAR package.", e);
		}

		// Calculating the MD5 hash of the WAR file and Config file of the
		// modified service

		try {
			WARPath = Paths.get(Configuration.getConfig("deployDir"),
					service.getShortName() + ".war").toString();
			ConfigPath = Paths.get(Configuration.getConfig("serviceConfigDir"),
					service.getShortName() + ".json").toString();

			Configchecksum = getMD5Checksum(ConfigPath);
			WARchecksum = getMD5Checksum(WARPath);
			WARArray = WARtoArray(WARPath);

			logger.info("WARfile MD5 hash checksum =" + WARchecksum);
			logger.info("Configfile MD5 hash checksum =" + Configchecksum);

		} catch (Exception ex) {
			logger.error("Cannot find the modified WAR file/Config file." + ex);
		}

		// Calculating the MD5 Hash of the config file and WAR file of the
		// modified service

		// syncEvent.setConfigMD5Hash(ConfigfilePath);
		// syncEvent.setWARMD5Hash(WARfilePath);
		// syncEvent.setWARfile(WARArray);

		// Emit a SyncEvent to synchronize the changes to other nodes
		NodeCommunicator.newEvent(new SyncEvent(scEvent.getService(), scEvent
				.getType()));
	}