@Test public void testActivateListenerClearsModelRegistryUponEvent() throws Exception { activate(); withChangeOn("/apps/testapp/components/test"); sleep(); verifyModelRegistryCacheIsCleared(); }
@Activate protected void activate() { executorService.execute(() -> { while (!isShutDown) { try { Object path = invalidationRequests.poll(5, SECONDS); if (path != null) { if (logger.isTraceEnabled()) { logger.trace("Invalidating the resource model registry lookup cache due to changes to {}.", path); } modelRegistry.clearLookupCaches(); } } catch (InterruptedException e) { if (!isShutDown) { logger.debug("The type hierarchy change listener got interrupted, but was not shut down.", e); } } } }); }
MappableTypeHierarchyChangeListener implements EventHandler { @Activate protected void activate() { executorService.execute(() -> { while (!isShutDown) { try { Object path = invalidationRequests.poll(5, SECONDS); if (path != null) { if (logger.isTraceEnabled()) { logger.trace("Invalidating the resource model registry lookup cache due to changes to {}.", path); } modelRegistry.clearLookupCaches(); } } catch (InterruptedException e) { if (!isShutDown) { logger.debug("The type hierarchy change listener got interrupted, but was not shut down.", e); } } } }); } }
MappableTypeHierarchyChangeListener implements EventHandler { @Activate protected void activate() { executorService.execute(() -> { while (!isShutDown) { try { Object path = invalidationRequests.poll(5, SECONDS); if (path != null) { if (logger.isTraceEnabled()) { logger.trace("Invalidating the resource model registry lookup cache due to changes to {}.", path); } modelRegistry.clearLookupCaches(); } } catch (InterruptedException e) { if (!isShutDown) { logger.debug("The type hierarchy change listener got interrupted, but was not shut down.", e); } } } }); }  }
MappableTypeHierarchyChangeListener implements EventHandler { @Activate protected void activate() { executorService.execute(() -> { while (!isShutDown) { try { Object path = invalidationRequests.poll(5, SECONDS); if (path != null) { if (logger.isTraceEnabled()) { logger.trace("Invalidating the resource model registry lookup cache due to changes to {}.", path); } modelRegistry.clearLookupCaches(); } } catch (InterruptedException e) { if (!isShutDown) { logger.debug("The type hierarchy change listener got interrupted, but was not shut down.", e); } } } }); }  @Override void handleEvent(Event event); }
MappableTypeHierarchyChangeListener implements EventHandler { @Activate protected void activate() { executorService.execute(() -> { while (!isShutDown) { try { Object path = invalidationRequests.poll(5, SECONDS); if (path != null) { if (logger.isTraceEnabled()) { logger.trace("Invalidating the resource model registry lookup cache due to changes to {}.", path); } modelRegistry.clearLookupCaches(); } } catch (InterruptedException e) { if (!isShutDown) { logger.debug("The type hierarchy change listener got interrupted, but was not shut down.", e); } } } }); }  @Override void handleEvent(Event event);  }