use of com.hazelcast.cache.impl.CacheEventListenerAdaptor in project hazelcast by hazelcast.
the class ClientCacheProxy method registerCacheEntryListener.
@Override
public void registerCacheEntryListener(CacheEntryListenerConfiguration 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, clientContext.getSerializationService(), clientContext.getHazelcastInstance());
EventHandler handler = createHandler(adaptor);
String regId = clientContext.getListenerService().registerListener(createCacheEntryListenerCodec(), handler);
if (regId != null) {
if (addToConfig) {
cacheConfig.addCacheEntryListenerConfiguration(cacheEntryListenerConfiguration);
}
addListenerLocally(regId, cacheEntryListenerConfiguration);
if (addToConfig) {
updateCacheListenerConfigOnOtherNodes(cacheEntryListenerConfiguration, true);
}
}
}
Aggregations