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 class loader.CachingProvider
Modifier and Type | Field and Description |
---|---|
protected ClassLoader |
defaultClassLoader |
protected URI |
defaultURI |
protected HazelcastInstance |
hazelcastInstance |
protected static String |
INVALID_HZ_INSTANCE_SPECIFICATION_MESSAGE |
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 . |
protected static Set<String> |
SUPPORTED_SCHEMES |
Constructor and Description |
---|
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) |
protected <T extends AbstractHazelcastCacheManager> |
createHazelcastCacheManager(URI uri,
ClassLoader classLoader,
Properties managerProperties) |
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 ClassLoader |
getManagerClassLoader(ClassLoader classLoader) |
protected URI |
getManagerUri(URI uri) |
protected abstract HazelcastInstance |
getOrCreateInstance(URI uri,
ClassLoader classLoader,
Properties properties) |
protected boolean |
isConfigLocation(URI location) |
boolean |
isSupported(javax.cache.configuration.OptionalFeature optionalFeature) |
protected void |
shutdownHazelcastInstance() |
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 system property hazelcast.named.jcache.instance
is "false"
, then
no instance name is set on the default configuration.protected static final ILogger LOGGER
protected static final String INVALID_HZ_INSTANCE_SPECIFICATION_MESSAGE
protected volatile HazelcastInstance hazelcastInstance
protected final ClassLoader defaultClassLoader
protected final URI defaultURI
protected final boolean namedDefaultHzInstance
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
protected void shutdownHazelcastInstance()
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 ClassLoader getManagerClassLoader(ClassLoader classLoader)
protected <T extends AbstractHazelcastCacheManager> T createHazelcastCacheManager(URI uri, ClassLoader classLoader, Properties managerProperties)
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.