@LifecycleHandlerType(LifecycleLevel.INIT_SERVICE) public void initialize() { tenantCacheInvalidation.initialize(); for (TenantKey cacheableKey : DefaultTenantUserApi.CACHED_TENANT_KEY) { tenantCacheInvalidation.registerCallback(cacheableKey, tenantCacheInvalidationCallback); } }
@LifecycleHandlerType(LifecycleLevel.START_SERVICE) public void start() { tenantCacheInvalidation.start(); }
@LifecycleHandlerType(LifecycleLevel.STOP_SERVICE) public void stop() { tenantCacheInvalidation.stop(); } }
final List<TenantBroadcastModelDao> entries = broadcastDao.getLatestEntriesFrom(parent.getLatestRecordIdProcessed().get()); for (TenantBroadcastModelDao cur : entries) { if (parent.isStopped()) { return; final TenantKeyAndCookie tenantKeyAndCookie = extractTenantKeyAndCookie(cur.getType()); if (tenantKeyAndCookie != null) { final Collection<CacheInvalidationCallback> callbacks = parent.getCacheInvalidations(tenantKeyAndCookie.getTenantKey()); if (!callbacks.isEmpty()) { final InternalTenantContext tenantContext = new InternalTenantContext(cur.getTenantRecordId()); parent.getEventBus().post(event); } catch (final EventBusException e) { logger.warn("Failed to post event {}", event, e); parent.setLatestRecordIdProcessed(cur.getRecordId());
@Override public void initializeCacheInvalidationCallback(final TenantKey key, final CacheInvalidationCallback cacheInvalidationCallback) { tenantCacheInvalidation.registerCallback(key, cacheInvalidationCallback); }
final List<TenantBroadcastModelDao> entries = broadcastDao.getLatestEntriesFrom(parent.getLatestRecordIdProcessed().get()); for (TenantBroadcastModelDao cur : entries) { if (parent.isStopped()) { return; final TenantKeyAndCookie tenantKeyAndCookie = extractTenantKeyAndCookie(cur.getType()); if (tenantKeyAndCookie != null) { final Collection<CacheInvalidationCallback> callbacks = parent.getCacheInvalidations(tenantKeyAndCookie.getTenantKey()); if (!callbacks.isEmpty()) { final InternalTenantContext tenantContext = new InternalTenantContext(cur.getTenantRecordId()); parent.getEventBus().post(event); } catch (final EventBusException e) { logger.warn("Failed to post event {}", event, e); parent.setLatestRecordIdProcessed(cur.getRecordId());
@Override public void initializeCacheInvalidationCallback(final TenantKey key, final CacheInvalidationCallback cacheInvalidationCallback) { tenantCacheInvalidation.registerCallback(key, cacheInvalidationCallback); }
@LifecycleHandlerType(LifecycleLevel.INIT_SERVICE) public void initialize() { tenantCacheInvalidation.initialize(); for (TenantKey cacheableKey : DefaultTenantUserApi.CACHED_TENANT_KEY) { tenantCacheInvalidation.registerCallback(cacheableKey, tenantCacheInvalidationCallback); } }
@LifecycleHandlerType(LifecycleLevel.STOP_SERVICE) public void stop() { tenantCacheInvalidation.stop(); } }
@LifecycleHandlerType(LifecycleLevel.START_SERVICE) public void start() { tenantCacheInvalidation.start(); }