Search in sources :

Example 1 with CopyOnWriteHashMap

use of org.apache.geode.internal.util.concurrent.CopyOnWriteHashMap in project geode by apache.

the class FilterProfile method registerFilterClassInMap.

private void registerFilterClassInMap(Object interest, Long clientID, Map<Object, Map> filts) {
    // get instance of the filter
    Class filterClass;
    InterestFilter filter;
    try {
        filterClass = ClassLoadUtil.classFromName((String) interest);
        filter = (InterestFilter) filterClass.newInstance();
    } catch (ClassNotFoundException cnfe) {
        throw new RuntimeException(LocalizedStrings.CacheClientProxy_CLASS_0_NOT_FOUND_IN_CLASSPATH.toLocalizedString(interest), cnfe);
    } catch (Exception e) {
        throw new RuntimeException(LocalizedStrings.CacheClientProxy_CLASS_0_COULD_NOT_BE_INSTANTIATED.toLocalizedString(interest), e);
    }
    Map interestMap = filts.get(clientID);
    if (interestMap == null) {
        interestMap = new CopyOnWriteHashMap();
        filts.put(clientID, interestMap);
    }
    interestMap.put(interest, filter);
}
Also used : CopyOnWriteHashMap(org.apache.geode.internal.util.concurrent.CopyOnWriteHashMap) CopyOnWriteHashMap(org.apache.geode.internal.util.concurrent.CopyOnWriteHashMap) Map(java.util.Map) ConcurrentHashMap(java.util.concurrent.ConcurrentHashMap) HashMap(java.util.HashMap) CancelException(org.apache.geode.CancelException) IOException(java.io.IOException)

Aggregations

IOException (java.io.IOException)1 HashMap (java.util.HashMap)1 Map (java.util.Map)1 ConcurrentHashMap (java.util.concurrent.ConcurrentHashMap)1 CancelException (org.apache.geode.CancelException)1 CopyOnWriteHashMap (org.apache.geode.internal.util.concurrent.CopyOnWriteHashMap)1