public final class HazelcastCachingProvider extends Object implements javax.cache.spi.CachingProvider
CachingProvider
.
This provider class acts as the commonly used entry point for the JCache SPI to register Hazelcast JCache as an eligible JCache implementation.
The main purpose of this provider implementation is to delegate to the
user-selected internal CachingProvider
implementation.
Hazelcast uses two internal CachingProvider
s,
depending on the environment:
HazelcastServerCachingProvider
com.hazelcast.client.cache.impl.HazelcastClientCachingProvider
hazelcast.jcache.provider.type
with values of
client
or server
.
If no selection exists, then the default behavior for selecting the internal
provider type is based on which dependency is found on the classpath. Client
and server provider classes are searched on the classpath. If both
CachingProvider
implementations are found, the client
provider has precedence. To select the server provider, use the above
mentioned property.
Modifier and Type | Field and Description |
---|---|
static String |
HAZELCAST_CONFIG_LOCATION
Hazelcast config location property
|
static String |
HAZELCAST_INSTANCE_ITSELF
Hazelcast instance itself property
|
static String |
HAZELCAST_INSTANCE_NAME
Hazelcast instance name property
|
Constructor and Description |
---|
HazelcastCachingProvider() |
Modifier and Type | Method and Description |
---|---|
void |
close() |
void |
close(ClassLoader classLoader) |
void |
close(URI uri,
ClassLoader classLoader) |
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() |
boolean |
isSupported(javax.cache.configuration.OptionalFeature optionalFeature) |
static Properties |
propertiesByInstanceItself(HazelcastInstance instance)
Create the
Properties with the provided instance itself. |
static Properties |
propertiesByInstanceName(String instanceName)
Create the
Properties with the provided instance name. |
static Properties |
propertiesByLocation(String configFileLocation)
Create the
Properties with the provided config file location. |
String |
toString() |
public static final String HAZELCAST_CONFIG_LOCATION
public static final String HAZELCAST_INSTANCE_NAME
public static final String HAZELCAST_INSTANCE_ITSELF
public static Properties propertiesByLocation(String configFileLocation)
Properties
with the provided config file location.configFileLocation
- the location of the config file to configurepublic static Properties propertiesByInstanceName(String instanceName)
Properties
with the provided instance name.instanceName
- the instance name to configurepublic static Properties propertiesByInstanceItself(HazelcastInstance instance)
Properties
with the provided instance itself.instance
- the instance itself to be usedpublic 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
Copyright © 2021 Hazelcast, Inc.. All Rights Reserved.