private synchronized void copyIfStale(SimpleModuleDefinition remoteDefinition) {
		ModuleDefinition currentTargetDefinition = currentLocalDefinition(remoteDefinition);
		SimpleModuleDefinition targetDefinition = (SimpleModuleDefinition) currentTargetDefinition;
		if (staleness.isStale(targetDefinition, remoteDefinition)) {
			InputStream is = null;
			try {
				is = resolver.getResource(remoteDefinition.getLocation()).getInputStream();
			}
			catch (IOException e) {
				throw new RuntimeIOException("Error while copying module", e);
			}
			localRegistry.delete(remoteDefinition);
			UploadedModuleDefinition definitionToInstall = new UploadedModuleDefinition(remoteDefinition.getName(), remoteDefinition.getType(), is);
			localRegistry.registerNew(definitionToInstall);
		}
	}
Checks whether the target version of the definition is stale, and if it is, triggers an update (as a deletion then
new registration).
spring-xd-dirt/src/main/java/org/springframework/xd/dirt/module/SynchronizingModuleRegistry.java