@Override protected Cache<Serializable, Session> createCache(String name) throws CacheException { return new MapCache<Serializable, Session>(name, new ConcurrentHashMap<Serializable, Session>()); } });
/** * Returns a {@link MapCache} instance representing the named Hazelcast-managed * {@link com.hazelcast.core.IMap IMap}. The Hazelcast Map is obtained by calling * {@link HazelcastInstance#getMap(String) hazelcastInstance.getMap(name)}. * * @param name the name of the cache to acquire. * @param <K> the type of map key * @param <V> the type of map value * @return a {@link MapCache} instance representing the named Hazelcast-managed {@link com.hazelcast.core.IMap IMap}. * @throws CacheException * @see HazelcastInstance#getMap(String) * @see #ensureHazelcastInstance() * */ public <K, V> Cache<K, V> getCache(String name) throws CacheException { Map<K, V> map = ensureHazelcastInstance().getMap(name); //returned map is a ConcurrentMap return new MapCache<K, V>(name, map); }
/** * Returns a new {@link MapCache MapCache} instance backed by a {@link SoftHashMap}. * * @param name the name of the cache * @return a new {@link MapCache MapCache} instance backed by a {@link SoftHashMap}. */ @Override protected Cache createCache(String name) { return new MapCache<Object, Object>(name, new SoftHashMap<Object, Object>()); } }
@Override protected Cache<Serializable, Session> createCache(String name) throws CacheException { return new MapCache<Serializable, Session>(name, new ConcurrentHashMap<Serializable, Session>()); } });
@Override protected Cache<Serializable, Session> createCache(String name) throws CacheException { return new MapCache<Serializable, Session>(name, new ConcurrentHashMap<Serializable, Session>()); } });
/** * Returns a new {@link MapCache MapCache} instance backed by a {@link SoftHashMap}. * * @param name the name of the cache * @return a new {@link MapCache MapCache} instance backed by a {@link SoftHashMap}. */ @Override protected Cache createCache(String name) { return new MapCache<Object, Object>(name, new SoftHashMap<Object, Object>()); } }