diff --git a/com.avaloq.tools.ddk.xtext.builder/src/com/avaloq/tools/ddk/xtext/builder/MonitoredClusteringBuilderState.java b/com.avaloq.tools.ddk.xtext.builder/src/com/avaloq/tools/ddk/xtext/builder/MonitoredClusteringBuilderState.java index 776db1723f..7ef4655aa2 100644 --- a/com.avaloq.tools.ddk.xtext.builder/src/com/avaloq/tools/ddk/xtext/builder/MonitoredClusteringBuilderState.java +++ b/com.avaloq.tools.ddk.xtext.builder/src/com/avaloq/tools/ddk/xtext/builder/MonitoredClusteringBuilderState.java @@ -778,6 +778,16 @@ protected void deleteBinaryResources(final Set toBeDeleted) { } } + /** + * Invalidate cached binary models. + * @param uris collection of URIs to invalidate cached binary models for. + */ + protected void invalidateBinaryResoureCache(final Collection uris) { + if (isBinaryModelStorageAvailable) { + targetPlatformManager.getPlatform().getBinaryModelStore().invalidateCache(uris); + } + } + /** * Waits until binary models are stored. * Uses default parameters for timeout and retries, kept for backward compatibility. @@ -845,7 +855,7 @@ protected void awaitBinaryStorageExecutorTermination(final int timeout, final Ti terminateBinaryStorageExecutor(); } } catch (InterruptedException e) { - LOGGER.warn("Interrupted waiting for binaryStorageExecutor shutdown, terminating. Had {} queued / {} active before interrupd; now have {} / {}", prevQueuedTaskCount, prevActiveTaskCount, binaryStorageExecutor.getQueue().size(), binaryStorageExecutor.getActiveCount()); + LOGGER.warn("Interrupted waiting for binaryStorageExecutor shutdown, terminating. Had {} queued / {} active before interrupt; now have {} / {}", prevQueuedTaskCount, prevActiveTaskCount, binaryStorageExecutor.getQueue().size(), binaryStorageExecutor.getActiveCount()); terminateBinaryStorageExecutor(); } diff --git a/com.avaloq.tools.ddk.xtext/src/com/avaloq/tools/ddk/xtext/build/IBinaryModelStore.java b/com.avaloq.tools.ddk.xtext/src/com/avaloq/tools/ddk/xtext/build/IBinaryModelStore.java index a8ffe53ac3..e3864df3e6 100644 --- a/com.avaloq.tools.ddk.xtext/src/com/avaloq/tools/ddk/xtext/build/IBinaryModelStore.java +++ b/com.avaloq.tools.ddk.xtext/src/com/avaloq/tools/ddk/xtext/build/IBinaryModelStore.java @@ -13,6 +13,7 @@ import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; +import java.util.Collection; import java.util.Map; import org.eclipse.emf.common.util.URI; @@ -76,6 +77,16 @@ public interface IBinaryModelStore { */ void delete(URI uri) throws IOException; + /** + * Invalidate cached data for the given collection of URIs. + * + * @param uris + * the URIs to invalidate cached data for. + */ + default void invalidateCache(final Collection uris) { + // do nothing by default + } + /** * Default no-op implementation throwing runtime exceptions when calling {@link #createInputStream(URI)} or {@link #createOutputStream(URI)} as that means * the application has not been configured correctly.