Java 类com.hazelcast.core.EntryListener 实例源码

项目:Openfire    文件:ClusterListener.java   
private void simulateCacheInserts(Cache cache) {
    EntryListener EntryListener = EntryListeners.get(cache);
    if (EntryListener != null) {
        if (cache instanceof CacheWrapper) {
            Cache wrapped = ((CacheWrapper) cache).getWrappedCache();
            if (wrapped instanceof ClusteredCache) {
                ClusteredCache clusteredCache = (ClusteredCache) wrapped;
                for (Map.Entry entry : (Set<Map.Entry>) cache.entrySet()) {
                    EntryEvent event = new EntryEvent(clusteredCache.map.getName(), cluster.getLocalMember(), 
                            EntryEventType.ADDED.getType(), entry.getKey(), null, entry.getValue());
                    EntryListener.entryAdded(event);
                }
            }
        }
    }
}
项目:hazelcast-archive    文件:EntryListenerManager.java   
public synchronized void removeListener(String name, Object key, EntryListener<?, ?> entryListener) {
    Map<Object, List<EntryListenerHolder>> m = entryListeners.get(name);
    if (m != null) {
        key = toKey(key);
        List<EntryListenerHolder> list = m.get(key);
        if (list != null) {
            for (final Iterator<EntryListenerHolder> it = list.iterator(); it.hasNext(); ) {
                final EntryListenerHolder entryListenerHolder = it.next();
                if (entryListenerHolder.listener.equals(entryListener)) {
                    list.remove(entryListenerHolder);
                }
            }
            if (m.get(key).isEmpty()) {
                m.remove(key);
            }
        }
        if (m.isEmpty()) {
            entryListeners.remove(name);
        }
    }
}
项目:openfire    文件:ClusterListener.java   
private void simulateCacheInserts(Cache cache) {
    EntryListener EntryListener = EntryListeners.get(cache);
    if (EntryListener != null) {
        if (cache instanceof CacheWrapper) {
            Cache wrapped = ((CacheWrapper) cache).getWrappedCache();
            if (wrapped instanceof ClusteredCache) {
                ClusteredCache clusteredCache = (ClusteredCache) wrapped;
                for (Map.Entry entry : (Set<Map.Entry>) cache.entrySet()) {
                    EntryEvent event = new EntryEvent(clusteredCache.map.getName(), cluster.getLocalMember(), 
                            EntryEventType.ADDED.getType(), entry.getKey(), null, entry.getValue());
                    EntryListener.entryAdded(event);
                }
            }
        }
    }
}
项目:health-and-care-developer-network    文件:EntryListenerManager.java   
public synchronized void removeListener(String name, Object key, EntryListener<?, ?> entryListener) {
    Map<Object, List<EntryListenerHolder>> m = entryListeners.get(name);
    if (m != null) {
        key = toKey(key);
        List<EntryListenerHolder> list = m.get(key);
        if (list != null) {
            for (final Iterator<EntryListenerHolder> it = list.iterator(); it.hasNext(); ) {
                final EntryListenerHolder entryListenerHolder = it.next();
                if (entryListenerHolder.listener.equals(entryListener)) {
                    list.remove(entryListenerHolder);
                }
            }
            if (m.get(key).isEmpty()) {
                m.remove(key);
            }
        }
        if (m.isEmpty()) {
            entryListeners.remove(name);
        }
    }
}
项目:openfire-bespoke    文件:ClusterListener.java   
private void simulateCacheInserts(Cache cache) {
    EntryListener EntryListener = EntryListeners.get(cache);
    if (EntryListener != null) {
        if (cache instanceof CacheWrapper) {
            Cache wrapped = ((CacheWrapper) cache).getWrappedCache();
            if (wrapped instanceof ClusteredCache) {
                ClusteredCache clusteredCache = (ClusteredCache) wrapped;
                for (Map.Entry entry : (Set<Map.Entry>) cache.entrySet()) {
                    EntryEvent event = new EntryEvent(clusteredCache.map.getName(), cluster.getLocalMember(), 
                            EntryEvent.TYPE_ADDED, entry.getKey(), null, entry.getValue());
                    EntryListener.entryAdded(event);
                }
            }
        }
    }
}
项目:Camel    文件:HazelcastReplicatedmapConsumerTest.java   
@Override
@SuppressWarnings("unchecked")
protected void trainHazelcastInstance(HazelcastInstance hazelcastInstance) {
    when(hazelcastInstance.getReplicatedMap("rm")).thenReturn(map);
    argument = ArgumentCaptor.forClass(EntryListener.class);
    when(map.addEntryListener(argument.capture(), eq(true))).thenReturn("foo");
}
项目:Camel    文件:HazelcastMultimapConsumerTest.java   
@Override
@SuppressWarnings("unchecked")
protected void trainHazelcastInstance(HazelcastInstance hazelcastInstance) {
    when(hazelcastInstance.getMultiMap("mm")).thenReturn(map);
    argument = ArgumentCaptor.forClass(EntryListener.class);
    when(map.addEntryListener(argument.capture(), eq(true))).thenReturn("foo");
}
项目:ravikumaran201504    文件:SMap.java   
/**
 * {@inheritDoc}
 *
 * @deprecated not implemented yet
 * @throws UnsupportedOperationException not implemented yet
 */
@Deprecated
@Override
public String addLocalEntryListener(EntryListener<K, V> listener,
        Predicate<K, V> predicate, boolean includeValue) {
    throw new UnsupportedOperationException();
}
项目:ravikumaran201504    文件:SMap.java   
/**
 * {@inheritDoc}
 *
 * @deprecated not implemented yet
 * @throws UnsupportedOperationException not implemented yet
 */
@Deprecated
@Override
public String addLocalEntryListener(EntryListener<K, V> listener,
        Predicate<K, V> predicate, K key, boolean includeValue) {
    throw new UnsupportedOperationException();
}
项目:ravikumaran201504    文件:SMap.java   
/**
 * {@inheritDoc}
 *
 * @deprecated not implemented yet
 * @throws UnsupportedOperationException not implemented yet
 */
@Deprecated
@Override
public String addEntryListener(EntryListener<K, V> listener,
        Predicate<K, V> predicate, boolean includeValue) {
    throw new UnsupportedOperationException();
}
项目:ravikumaran201504    文件:SMap.java   
/**
 * {@inheritDoc}
 *
 * @deprecated not implemented yet
 * @throws UnsupportedOperationException not implemented yet
 */
@Deprecated
@Override
public String addEntryListener(EntryListener<K, V> listener,
        Predicate<K, V> predicate, K key, boolean includeValue) {
    throw new UnsupportedOperationException();
}
项目:Openfire    文件:ClusterListener.java   
private void addEntryListener(Cache cache, EntryListener listener) {
    if (cache instanceof CacheWrapper) {
        Cache wrapped = ((CacheWrapper)cache).getWrappedCache();
        if (wrapped instanceof ClusteredCache) {
            ((ClusteredCache)wrapped).addEntryListener(listener, false);
            // Keep track of the listener that we added to the cache
            EntryListeners.put(cache, listener);
        }
    }
}
项目:hazelcast-archive    文件:MultiMapClientProxy.java   
public void addEntryListener(EntryListener<K, V> listener, K key, boolean includeValue) {
    check(listener);
    Boolean noEntryListenerRegistered = entryListenerManager().noListenerRegistered(key, name, includeValue);
    if (noEntryListenerRegistered == null) {
        proxyHelper.doOp(ClusterOperation.REMOVE_LISTENER, key, null);
        noEntryListenerRegistered = Boolean.TRUE;
    }
    if (noEntryListenerRegistered.booleanValue()) {
        Call c = entryListenerManager().createNewAddListenerCall(proxyHelper, key, includeValue);
        proxyHelper.doCall(c);
    }
    entryListenerManager().registerListener(name, key, includeValue, listener);
}
项目:hazelcast-archive    文件:EntryListenerManager.java   
public synchronized void registerListener(String name, Object key, boolean includeValue, EntryListener<?, ?> entryListener) {
    ConcurrentHashMap<Object, List<EntryListenerHolder>> map = entryListeners.get(name);
    key = toKey(key);
    if (map == null) {
        map = new ConcurrentHashMap<Object, List<EntryListenerHolder>>();
        final ConcurrentHashMap<Object, List<EntryListenerHolder>> map2 = entryListeners.putIfAbsent(name, map);
        if (map2 != null) {
            map = map2;
        }
    }
    if (!map.contains(key)) {
        map.putIfAbsent(key, new CopyOnWriteArrayList<EntryListenerHolder>());
    }
    map.get(key).add(new EntryListenerHolder(entryListener, includeValue));
}
项目:hazelcast-archive    文件:MapClientProxy.java   
public void addEntryListener(EntryListener<K, V> listener, K key, boolean includeValue) {
    check(listener);
    Boolean noEntryListenerRegistered = listenerManager().noListenerRegistered(key, name, includeValue);
    if (noEntryListenerRegistered == null) {
        proxyHelper.doOp(ClusterOperation.REMOVE_LISTENER, key, null);
        noEntryListenerRegistered = Boolean.TRUE;
    }
    if (noEntryListenerRegistered) {
        Call c = listenerManager().createNewAddListenerCall(proxyHelper, key, includeValue);
        proxyHelper.doCall(c);
    }
    listenerManager().registerListener(name, key, includeValue, listener);
}
项目:openfire    文件:ClusterListener.java   
private void addEntryListener(Cache cache, EntryListener listener) {
    if (cache instanceof CacheWrapper) {
        Cache wrapped = ((CacheWrapper)cache).getWrappedCache();
        if (wrapped instanceof ClusteredCache) {
            ((ClusteredCache)wrapped).addEntryListener(listener, false);
            // Keep track of the listener that we added to the cache
            EntryListeners.put(cache, listener);
        }
    }
}
项目:health-and-care-developer-network    文件:MultiMapClientProxy.java   
public void addEntryListener(EntryListener<K, V> listener, K key, boolean includeValue) {
    check(listener);
    Boolean noEntryListenerRegistered = entryListenerManager().noListenerRegistered(key, name, includeValue);
    if (noEntryListenerRegistered == null) {
        proxyHelper.doOp(ClusterOperation.REMOVE_LISTENER, key, null);
        noEntryListenerRegistered = Boolean.TRUE;
    }
    if (noEntryListenerRegistered.booleanValue()) {
        Call c = entryListenerManager().createNewAddListenerCall(proxyHelper, key, includeValue);
        proxyHelper.doCall(c);
    }
    entryListenerManager().registerListener(name, key, includeValue, listener);
}
项目:health-and-care-developer-network    文件:EntryListenerManager.java   
public synchronized void registerListener(String name, Object key, boolean includeValue, EntryListener<?, ?> entryListener) {
    ConcurrentHashMap<Object, List<EntryListenerHolder>> map = entryListeners.get(name);
    key = toKey(key);
    if (map == null) {
        map = new ConcurrentHashMap<Object, List<EntryListenerHolder>>();
        final ConcurrentHashMap<Object, List<EntryListenerHolder>> map2 = entryListeners.putIfAbsent(name, map);
        if (map2 != null) {
            map = map2;
        }
    }
    if (!map.contains(key)) {
        map.putIfAbsent(key, new CopyOnWriteArrayList<EntryListenerHolder>());
    }
    map.get(key).add(new EntryListenerHolder(entryListener, includeValue));
}
项目:openfire-bespoke    文件:ClusterListener.java   
private void addEntryListener(Cache cache, EntryListener listener) {
    if (cache instanceof CacheWrapper) {
        Cache wrapped = ((CacheWrapper)cache).getWrappedCache();
        if (wrapped instanceof ClusteredCache) {
            ((ClusteredCache)wrapped).addEntryListener(listener, false);
            // Keep track of the listener that we added to the cache
            EntryListeners.put(cache, listener);
        }
    }
}
项目:Camel    文件:HazelcastReplicatedmapConsumerTest.java   
@Override
@SuppressWarnings("unchecked")
protected void verifyHazelcastInstance(HazelcastInstance hazelcastInstance) {
    verify(hazelcastInstance).getReplicatedMap("rm");
    verify(map).addEntryListener(any(EntryListener.class), eq(true));
}
项目:Camel    文件:HazelcastMultimapConsumerTest.java   
@Override
@SuppressWarnings("unchecked")
protected void verifyHazelcastInstance(HazelcastInstance hazelcastInstance) {
    verify(hazelcastInstance).getMultiMap("mm");
    verify(map).addEntryListener(any(EntryListener.class), eq(true));
}
项目:ravikumaran201504    文件:SMap.java   
@Override
public String addLocalEntryListener(EntryListener<K, V> listener) {
    return m.addLocalEntryListener(new BaseEntryListener(listener));
}
项目:ravikumaran201504    文件:SMap.java   
@Override
public String addEntryListener(EntryListener<K, V> listener,
        boolean includeValue) {
    return m.addEntryListener(new BaseEntryListener(listener), includeValue);
}
项目:ravikumaran201504    文件:SMap.java   
@Override
public String addEntryListener(EntryListener<K, V> listener, K key,
        boolean includeValue) {
    return m.addEntryListener(new BaseEntryListener(listener),
            serializeKey(key), includeValue);
}
项目:ravikumaran201504    文件:SMap.java   
public BaseEntryListener(EntryListener<K, V> listener) {
    this.listener = listener;
}
项目:hazelcast-jet    文件:MapDecorator.java   
@Override
public String addLocalEntryListener(EntryListener listener) {
    return map.addLocalEntryListener(listener);
}
项目:hazelcast-jet    文件:MapDecorator.java   
@Override
public String addLocalEntryListener(EntryListener listener, Predicate<K, V> predicate, boolean includeValue) {
    return map.addLocalEntryListener(listener, predicate, includeValue);
}
项目:hazelcast-jet    文件:MapDecorator.java   
@Override
public String addLocalEntryListener(EntryListener listener, Predicate<K, V> predicate, K key,
                                    boolean includeValue) {
    return map.addLocalEntryListener(listener, predicate, key, includeValue);
}
项目:hazelcast-jet    文件:MapDecorator.java   
@Override
public String addEntryListener(EntryListener listener, boolean includeValue) {
    return map.addEntryListener(listener, includeValue);
}
项目:hazelcast-jet    文件:MapDecorator.java   
@Override
public String addEntryListener(EntryListener listener, K key, boolean includeValue) {
    return map.addEntryListener(listener, key, includeValue);
}
项目:hazelcast-jet    文件:MapDecorator.java   
@Override
public String addEntryListener(EntryListener listener, Predicate<K, V> predicate, boolean includeValue) {
    return map.addEntryListener(listener, predicate, includeValue);
}
项目:hazelcast-jet    文件:MapDecorator.java   
@Override
public String addEntryListener(EntryListener listener, Predicate<K, V> predicate, K key, boolean includeValue) {
    return map.addEntryListener(listener, predicate, key, includeValue);
}
项目:hazel-local-cache    文件:LocalCacheProxy.java   
@Override
public String addLocalEntryListener(EntryListener listener) {
    return null;
}
项目:hazel-local-cache    文件:LocalCacheProxy.java   
@Override
public String addLocalEntryListener(EntryListener listener, Predicate predicate, boolean includeValue) {
    return null;
}
项目:hazel-local-cache    文件:LocalCacheProxy.java   
@Override
public String addLocalEntryListener(EntryListener listener, Predicate predicate, Object key, boolean includeValue) {
    return null;
}
项目:hazel-local-cache    文件:LocalCacheProxy.java   
@Override
public String addEntryListener(EntryListener listener, boolean includeValue) {
    return null;
}
项目:hazel-local-cache    文件:LocalCacheProxy.java   
@Override
public String addEntryListener(EntryListener listener, Object key, boolean includeValue) {
    return null;
}
项目:hazel-local-cache    文件:LocalCacheProxy.java   
@Override
public String addEntryListener(EntryListener listener, Predicate predicate, boolean includeValue) {
    return null;
}
项目:hazel-local-cache    文件:LocalCacheProxy.java   
@Override
public String addEntryListener(EntryListener listener, Predicate predicate, Object key, boolean includeValue) {
    return null;
}
项目:Openfire    文件:ClusteredCache.java   
public void addEntryListener(EntryListener listener, boolean includeValue) {
    registrations.put(listener, map.addEntryListener(listener, includeValue));
}