public ClientQueryCacheEventService(ClientContext clientContext) { AbstractClientListenerService listenerService = (AbstractClientListenerService) clientContext.getListenerService(); this.listenerService = listenerService; this.serializationService = clientContext.getSerializationService(); this.executor = listenerService.getEventExecutor(); this.registrations = new ConcurrentHashMap<String, QueryCacheToListenerMapper>(); }
public ClientQueryCacheEventService(ClientContext clientContext) { AbstractClientListenerService listenerService = (AbstractClientListenerService) clientContext.getListenerService(); this.listenerService = listenerService; this.serializationService = clientContext.getSerializationService(); this.executor = listenerService.getEventExecutor(); this.registrations = new ConcurrentHashMap<String, QueryCacheToListenerMapper>(); }
private void unregisterClientChannel(@Nonnull String uuid) { ClientContext context = getContext(); context.getListenerService().deregisterListener(uuid); }
private void deregisterAllCacheEntryListener(Collection<String> listenerRegistrations) { ClientListenerService listenerService = getContext().getListenerService(); for (String regId : listenerRegistrations) { listenerService.deregisterListener(regId); } }
private void deregisterAllCacheEntryListener(Collection<String> listenerRegistrations) { ClientListenerService listenerService = getContext().getListenerService(); for (String regId : listenerRegistrations) { listenerService.deregisterListener(regId); } }
protected final String registerListener(ListenerMessageCodec codec, EventHandler handler) { return getContext().getListenerService().registerListener(codec, handler); }
private void removeNearCacheInvalidationListener() { if (nearCache != null && invalidationListenerId != null) { getContext().getListenerService().deregisterListener(invalidationListenerId); } }
private void removeNearCacheInvalidationListener() { if (nearCache != null && invalidationListenerId != null) { getContext().getListenerService().deregisterListener(invalidationListenerId); } }
@Override public boolean removePartitionLostListener(String id) { return getContext().getListenerService().deregisterListener(id); }
@Override public boolean removePartitionLostListener(String id) { return getContext().getListenerService().deregisterListener(id); }
protected final boolean deregisterListener(String registrationId) { return getContext().getListenerService().deregisterListener(registrationId); }
protected final boolean deregisterListener(String registrationId) { return getContext().getListenerService().deregisterListener(registrationId); }
protected final String registerListener(ListenerMessageCodec codec, EventHandler handler) { return getContext().getListenerService().registerListener(codec, handler); }
@Override public void deregisterCacheEntryListener(CacheEntryListenerConfiguration<K, V> cacheEntryListenerConfiguration) { if (cacheEntryListenerConfiguration == null) { throw new NullPointerException("CacheEntryListenerConfiguration can't be null"); } String regId = getListenerIdLocal(cacheEntryListenerConfiguration); if (regId == null) { return; } boolean isDeregistered = getContext().getListenerService().deregisterListener(regId); if (isDeregistered) { removeListenerLocally(cacheEntryListenerConfiguration); cacheConfig.removeCacheEntryListenerConfiguration(cacheEntryListenerConfiguration); updateCacheListenerConfigOnOtherNodes(cacheEntryListenerConfiguration, false); } }
@Override public String addPartitionLostListener(CachePartitionLostListener listener) { EventHandler<ClientMessage> handler = new ClientCachePartitionLostEventHandler(listener); injectDependencies(listener); return getContext().getListenerService().registerListener(createPartitionLostListenerCodec(), handler); }
@Override public String addPartitionLostListener(CachePartitionLostListener listener) { EventHandler<ClientMessage> handler = new ClientCachePartitionLostEventHandler(listener); injectDependencies(listener); return getContext().getListenerService().registerListener(createPartitionLostListenerCodec(), handler); }
@Override public void deregisterCacheEntryListener(CacheEntryListenerConfiguration<K, V> cacheEntryListenerConfiguration) { if (cacheEntryListenerConfiguration == null) { throw new NullPointerException("CacheEntryListenerConfiguration can't be null"); } String regId = getListenerIdLocal(cacheEntryListenerConfiguration); if (regId == null) { return; } boolean isDeregistered = getContext().getListenerService().deregisterListener(regId); if (isDeregistered) { removeListenerLocally(cacheEntryListenerConfiguration); cacheConfig.removeCacheEntryListenerConfiguration(cacheEntryListenerConfiguration); updateCacheListenerConfigOnOtherNodes(cacheEntryListenerConfiguration, false); } }
private void removeInvalidationListener() { if (!invalidateOnChange) { return; } String registrationId = nearCacheMembershipRegistrationId; if (registrationId != null) { getContext().getRepairingTask(getServiceName()).deregisterHandler(nameWithPrefix); getContext().getListenerService().deregisterListener(registrationId); } }
private void removeInvalidationListener() { if (!invalidateOnChange) { return; } String registrationId = nearCacheMembershipRegistrationId; if (registrationId != null) { getContext().getRepairingTask(getServiceName()).deregisterHandler(nameWithPrefix); getContext().getListenerService().deregisterListener(registrationId); } }
@Override public void registerCacheEntryListener(CacheEntryListenerConfiguration<K, V> cacheEntryListenerConfiguration, boolean addToConfig) { ensureOpen(); if (cacheEntryListenerConfiguration == null) { throw new NullPointerException("CacheEntryListenerConfiguration can't be null"); } CacheEventListenerAdaptor<K, V> adaptor = new CacheEventListenerAdaptor<K, V>(this, cacheEntryListenerConfiguration, getSerializationService()); EventHandler handler = createHandler(adaptor); String regId = getContext().getListenerService().registerListener(createCacheEntryListenerCodec(), handler); if (regId != null) { if (addToConfig) { cacheConfig.addCacheEntryListenerConfiguration(cacheEntryListenerConfiguration); } addListenerLocally(regId, cacheEntryListenerConfiguration, adaptor); if (addToConfig) { updateCacheListenerConfigOnOtherNodes(cacheEntryListenerConfiguration, true); } } }