public abstract class AbstractHazelcastCachingProvider extends Object implements javax.cache.spi.CachingProvider
CachingProvider
implementation providing shared
functionality to server and client caching providers.
This class encapsulates following details:
CacheManager
by URI and classloaderCachingProvider
Modifier and Type | Field and Description |
---|---|
protected HazelcastInstance |
hazelcastInstance |
protected static ILogger |
LOGGER |
static String |
NAMED_JCACHE_HZ_INSTANCE
System property to control whether the default Hazelcast instance, which
may be started when obtaining the default
CachingProvider , will
have an instance name set or not. |
protected boolean |
namedDefaultHzInstance |
static String |
SHARED_JCACHE_INSTANCE_NAME
Name of default
HazelcastInstance which may be started when
obtaining the default CachingProvider . |
Modifier | Constructor and Description |
---|---|
protected |
AbstractHazelcastCachingProvider() |
Modifier and Type | Method and Description |
---|---|
void |
close() |
void |
close(ClassLoader classLoader) |
void |
close(URI uri,
ClassLoader classLoader) |
protected abstract <T extends AbstractHazelcastCacheManager> |
createCacheManager(HazelcastInstance instance,
URI uri,
ClassLoader classLoader,
Properties properties) |
javax.cache.CacheManager |
getCacheManager() |
javax.cache.CacheManager |
getCacheManager(URI uri,
ClassLoader classLoader) |
javax.cache.CacheManager |
getCacheManager(URI uri,
ClassLoader classLoader,
Properties properties) |
ClassLoader |
getDefaultClassLoader() |
Properties |
getDefaultProperties() |
URI |
getDefaultURI() |
protected abstract HazelcastInstance |
getOrCreateInstance(URI uri,
ClassLoader classLoader,
Properties properties) |
protected boolean |
isConfigLocation(URI location) |
boolean |
isSupported(javax.cache.configuration.OptionalFeature optionalFeature) |
public static final String SHARED_JCACHE_INSTANCE_NAME
HazelcastInstance
which may be started when
obtaining the default CachingProvider
.public static final String NAMED_JCACHE_HZ_INSTANCE
CachingProvider
, will
have an instance name set or not.
When not set or when system property hazelcast.named.jcache.instance
is true
, then a common instance name is used to get-or-create
the default HazelcastInstance
. When the system property
hazelcast.named.jcache.instance
is false
, then no
instance name is set on the default configuration.
protected static final ILogger LOGGER
protected final boolean namedDefaultHzInstance
protected volatile HazelcastInstance hazelcastInstance
public javax.cache.CacheManager getCacheManager(URI uri, ClassLoader classLoader, Properties properties)
getCacheManager
in interface javax.cache.spi.CachingProvider
public ClassLoader getDefaultClassLoader()
getDefaultClassLoader
in interface javax.cache.spi.CachingProvider
public URI getDefaultURI()
getDefaultURI
in interface javax.cache.spi.CachingProvider
public Properties getDefaultProperties()
getDefaultProperties
in interface javax.cache.spi.CachingProvider
public javax.cache.CacheManager getCacheManager(URI uri, ClassLoader classLoader)
getCacheManager
in interface javax.cache.spi.CachingProvider
public javax.cache.CacheManager getCacheManager()
getCacheManager
in interface javax.cache.spi.CachingProvider
public void close()
close
in interface Closeable
close
in interface AutoCloseable
close
in interface javax.cache.spi.CachingProvider
public void close(ClassLoader classLoader)
close
in interface javax.cache.spi.CachingProvider
public void close(URI uri, ClassLoader classLoader)
close
in interface javax.cache.spi.CachingProvider
public boolean isSupported(javax.cache.configuration.OptionalFeature optionalFeature)
isSupported
in interface javax.cache.spi.CachingProvider
protected abstract HazelcastInstance getOrCreateInstance(URI uri, ClassLoader classLoader, Properties properties) throws URISyntaxException, IOException
URISyntaxException
IOException
protected abstract <T extends AbstractHazelcastCacheManager> T createCacheManager(HazelcastInstance instance, URI uri, ClassLoader classLoader, Properties properties)
protected boolean isConfigLocation(URI location)
Copyright © 2018 Hazelcast, Inc.. All Rights Reserved.