Class JCacheDistributedMapAdapter<K,V>
java.lang.Object
com.loomcache.server.jcache.JCacheDistributedMapAdapter<K,V>
Adapter that exposes either a local
DistributedMap or the real cluster protocol
path as a typed <K, V> store for JCache.-
Constructor Summary
ConstructorsConstructorDescriptionJCacheDistributedMapAdapter(DistributedMap<String, String> backingMap, KryoSerializer serializer, Class<K> keyType, Class<V> valueType) Create a new adapter backed by the given DistributedMap. -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()booleancontainsKey(K key) static <K,V> JCacheDistributedMapAdapter <K, V> create(DataStructureRegistry registry, KryoSerializer serializer, String cacheName, Class<K> keyType, Class<V> valueType) Convenience factory that looks up (or creates) the underlyingDistributedMapvia the given registry.static <K,V> JCacheDistributedMapAdapter <K, V> create(DataStructureRegistry registry, KryoSerializer serializer, String cacheName, Class<K> keyType, Class<V> valueType, Collection<Class<?>> allowedEmbeddedTypes) Create an adapter with additional embedded payload types allowed forObject-typed caches.static <K,V> JCacheDistributedMapAdapter <K, V> createProtocolBacked(com.loomcache.server.jcache.LoomJCacheClusterClient clusterClient, KryoSerializer serializer, String cacheName, Class<K> keyType, Class<V> valueType) Factory for the protocol-backed path used by node-owned providers.entries()@Nullable V@Nullable V@Nullable VgetAndRemove(K key) booleanstatic StringjcacheMapName(String cacheName) Qualified backing-map name so JCache caches do not collide with plain DistributedMap instances that happen to share the cache name.keySet()voidbooleanputIfAbsent(K key, V value) booleanboolean@Nullable Vbooleanintsize()wrapTypedMapStore(MapStore<K, V> typedStore) Wrap a typedMapStoreso it can be installed on the encoded backing map.
-
Constructor Details
-
JCacheDistributedMapAdapter
public JCacheDistributedMapAdapter(DistributedMap<String, String> backingMap, KryoSerializer serializer, Class<K> keyType, Class<V> valueType) Create a new adapter backed by the given DistributedMap.
-
-
Method Details
-
create
public static <K,V> JCacheDistributedMapAdapter<K,V> create(DataStructureRegistry registry, KryoSerializer serializer, String cacheName, Class<K> keyType, Class<V> valueType) Convenience factory that looks up (or creates) the underlyingDistributedMapvia the given registry. -
create
public static <K,V> JCacheDistributedMapAdapter<K,V> create(DataStructureRegistry registry, KryoSerializer serializer, String cacheName, Class<K> keyType, Class<V> valueType, Collection<Class<?>> allowedEmbeddedTypes) Create an adapter with additional embedded payload types allowed forObject-typed caches. The adapter never resolves type names from storage; only classes supplied here, configured key/value types, and a small stable JDK set may appear in the encoded header. -
createProtocolBacked
public static <K,V> JCacheDistributedMapAdapter<K,V> createProtocolBacked(com.loomcache.server.jcache.LoomJCacheClusterClient clusterClient, KryoSerializer serializer, String cacheName, Class<K> keyType, Class<V> valueType) Factory for the protocol-backed path used by node-owned providers. -
jcacheMapName
-
hasBackingMap
public boolean hasBackingMap() -
getBackingMap
- Returns:
- the underlying DistributedMap — primarily for diagnostics/tests
-
put
-
get
-
remove
-
remove
-
containsKey
-
clear
public void clear() -
size
public int size() -
keySet
-
entries
-
putIfAbsent
-
replace
-
replace
-
getAndPut
-
getAndRemove
-
wrapTypedMapStore
-