@Override
	public void process(IMessage message) {
		if (message instanceof JobMetaData) {
			JobMetaData meta = (JobMetaData) message;
			meta.setId(this.jobcounter);
			this.jobcounter++;
			
			System.out.println("DEBUG: Received JobMetaData" + meta.getId() + " from " + meta.getSender());
			this.monitor.addjobWaiting(meta);
			this.scheduler.schedule(meta);
		} else if (message instanceof StatusUpdate) {
			StatusUpdate update = (StatusUpdate) message;
			System.out.println(update.getMessage());
			
			if(update.getState() == VMState.DONE){
				System.out.println(update.getVmId() + " saying he is done");
				this.scheduler.vmIsDone(update.getVmId());
			} else if(update.getState() == VMState.FAILED){
				System.out.println(update.getVmId() + " has failed");
				this.scheduler.vmFailed(update.getVmId());
			}
			
			this.scheduler.vmStatus(update.getVmId(), update.getJobType());
		}
	}