private void buildUpdateResources(){
		updateResources = new Thread(new Runnable(){
			public void run(){
				while(true){
					Boolean deleted = false;
					for(int i = 0; i < clients.size() && !deleted; i++){
						ClientInterface c = clients.get(i).getReference();
						try{
							Vector<String> resources = c.getResourcesInfo();
							for(String s : resources){
								synchronized(resourcesOfClients){
									if(!resourcesOfClients.containsKey(s)){
										LinkedList<ClientInterface> clientsNew = new LinkedList<ClientInterface>();
										clientsNew.add(c);
										resourcesOfClients.put(s,clientsNew);
									}
									else{	
										if(!resourcesOfClients.get(s).contains(c)){
											resourcesOfClients.get(s).add(c);
										}
									}
								}
							}
						}catch(RemoteException e){
							removeClientFromResourceMap(c);
							String name = clients.get(i).getName();
							clients.remove(clients.get(i));
							gui.addLogArea("Client " + name + "non più presente nel sistema\n");
							repaintClientArea();
							deleted = true;
						}
					}
					try {
						Thread.sleep(5000);
					} catch (InterruptedException e) {}
				}
			}
		});
		updateResources.setDaemon(true);
		updateResources.start();
	}