protected synchronized final void update()

in taverna-reference-impl/src/main/java/org/apache/taverna/reference/impl/ReferenceSetAugmentorImpl.java [158:182]


	protected synchronized final void update() {
		if (builders == null || translators == null || cacheValid)
			return;
		log.debug("# Refreshing shortest path cache");
		knownReferenceTypes.clear();
		solvers.clear();
		adjacencySets.clear();
		for (ExternalReferenceBuilderSPI erb : builders)
			knownReferenceTypes.add(erb.getReferenceType());
		for (ExternalReferenceTranslatorSPI ert : translators) {
			knownReferenceTypes.add(ert.getSourceReferenceType());
			knownReferenceTypes.add(ert.getTargetReferenceType());
			getNeighbours(ert.getTargetReferenceType()).add(ert);
		}
		for (Class<ExternalReferenceSPI> type : knownReferenceTypes)
			try {
				solvers.put(type, new ShortestPathSolver(type));
			} catch (Throwable t) {
				log.error(t);
				if (t instanceof RuntimeException)
					throw (RuntimeException) t;
			}
		log.debug("# Path cache refresh done");
		cacheValid = true;
	}