Class LoomCachingProvider
- All Implemented Interfaces:
Closeable, AutoCloseable, javax.cache.spi.CachingProvider
CachingProvider implementation and SPI entry point for
LoomCache JCache managers.
Provides discovery and lifecycle management for LoomJCacheManager instances.
Each unique URI + ClassLoader pair identifies a separate cache manager; the default URI
is loomcache://default.
Registered via META-INF/services/javax.cache.spi.CachingProvider
(JSR-107 discovery) and META-INF/services/com.loomcache.server.jcache.LoomCachingProvider
(legacy/native discovery).
Thread Safety
All operations are thread-safe viaConcurrentHashMap.- Since:
- 2.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final URIDefault URI for the cache manager when none is specified. -
Constructor Summary
ConstructorsConstructorDescriptionPublic no-arg constructor required by theServiceLoadercontract.LoomCachingProvider(@Nullable DataStructureRegistry registry) Construct a provider that hands out distributed (Raft-replicated) caches.LoomCachingProvider(@Nullable DataStructureRegistry registry, String host, int port) Construct a provider whose distributed caches route through the cluster protocol exposed by the given node endpoint. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()voidclose(@Nullable ClassLoader classLoader) voidclose(@Nullable URI uri, @Nullable ClassLoader classLoader) javax.cache.CacheManagergetCacheManager(@Nullable URI uri, @Nullable ClassLoader classLoader) javax.cache.CacheManagergetCacheManager(@Nullable URI uri, @Nullable ClassLoader classLoader, @Nullable Properties properties) getCacheManager(URI uri) Get or create a cache manager for the specified URI (native API).booleanhasCacheManager(URI uri) Check if a cache manager exists for the given URI.booleanisSupported(javax.cache.configuration.OptionalFeature feature) voidreleaseCacheManager(URI uri) Close and remove the cache manager for the given URI.
-
Field Details
-
DEFAULT_URI
Default URI for the cache manager when none is specified.
-
-
Constructor Details
-
LoomCachingProvider
public LoomCachingProvider()Public no-arg constructor required by theServiceLoadercontract. Equivalent tonew LoomCachingProvider(null). Caches created through this instance run in legacy local-mode, which is rejected whenloomcache.profile=production. -
LoomCachingProvider
Construct a provider that hands out distributed (Raft-replicated) caches.When
registryis non-null, any cache created through the returned provider defaults to distributed mode: its state is stored in aDistributedMapowned by the registry, which is Raft-replicated and snapshot-persisted together with every other distributed structure on the node. Passingnullis equivalent to the no-arg constructor and yields local-mode caches. Local-mode caches are rejected in the production profile because standard JSR-107 usage would otherwise create non-distributed caches.- Parameters:
registry- the registry used to resolve backing DistributedMap instances (may be null to keep legacy in-process semantics)
-
LoomCachingProvider
Construct a provider whose distributed caches route through the cluster protocol exposed by the given node endpoint.This legacy/test path opens a raw
Socketfrom inside the server process and is rejected underloomcache.profile=production; the node-owned production provider must use the in-process registry constructor.
-
-
Method Details
-
getCacheManager
Get or create a cache manager for the specified URI (native API). -
hasCacheManager
Check if a cache manager exists for the given URI. -
releaseCacheManager
Close and remove the cache manager for the given URI. -
getCacheManager
public javax.cache.CacheManager getCacheManager(@Nullable URI uri, @Nullable ClassLoader classLoader, @Nullable Properties properties) - Specified by:
getCacheManagerin interfacejavax.cache.spi.CachingProvider
-
getCacheManager
public javax.cache.CacheManager getCacheManager(@Nullable URI uri, @Nullable ClassLoader classLoader) - Specified by:
getCacheManagerin interfacejavax.cache.spi.CachingProvider
-
getCacheManager
- Specified by:
getCacheManagerin interfacejavax.cache.spi.CachingProvider
-
getDefaultClassLoader
- Specified by:
getDefaultClassLoaderin interfacejavax.cache.spi.CachingProvider
-
getDefaultURI
- Specified by:
getDefaultURIin interfacejavax.cache.spi.CachingProvider
-
getDefaultProperties
- Specified by:
getDefaultPropertiesin interfacejavax.cache.spi.CachingProvider
-
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfacejavax.cache.spi.CachingProvider- Specified by:
closein interfaceCloseable
-
close
- Specified by:
closein interfacejavax.cache.spi.CachingProvider
-
close
- Specified by:
closein interfacejavax.cache.spi.CachingProvider
-
isSupported
public boolean isSupported(javax.cache.configuration.OptionalFeature feature) - Specified by:
isSupportedin interfacejavax.cache.spi.CachingProvider
-