|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
@ThreadSafe public interface CacheFactory<K,V>
This factory constructs a cache from a given or default configuration set.
Typical usage would be:CacheFactory factory = DefaultCacheFactory.getInstance(); Cache cache = factory.createCache("replSync-service.xml"); // expects this file to be in classpath cache.stop();Factory methods provide options for creating a cache using
Configuration
object
Cache
,
DefaultCacheFactory
,
PojoCacheFactory
Method Summary | |
---|---|
Cache<K,V> |
createCache()
Creates and starts a Cache instance using default configuration settings. |
Cache<K,V> |
createCache(boolean start)
Creates and optionally starts a Cache instance using default configuration settings. |
Cache<K,V> |
createCache(Configuration configuration)
Creates a Cache instance based on a Configuration passed in. |
Cache<K,V> |
createCache(Configuration configuration,
boolean start)
Creates Cache instance, and optionally starts it, based on a Configuration passed in. |
Cache<K,V> |
createCache(java.lang.String configFileName)
Creates and starts a Cache instance. |
Cache<K,V> |
createCache(java.lang.String configFileName,
boolean start)
Creates Cache instance, and optionally starts it. |
Method Detail |
---|
Cache<K,V> createCache() throws ConfigurationException
Cache
instance using default configuration settings. See Configuration
for default values.
ConfigurationException
- if there are problems with the default configurationCache<K,V> createCache(boolean start) throws ConfigurationException
Cache
instance using default configuration settings. See Configuration
for default values.
start
- if true, starts the cache
ConfigurationException
- if there are problems with the default configurationCache<K,V> createCache(java.lang.String configFileName) throws ConfigurationException
Cache
instance. The following are all valid calls:
factory.createCache("myCacheService.xml"); // file is in class path factory.createCache("etc/myCacheService.xml"); // file is in etc/ relative to the directory you started the JVM factory.createCache("/home/jbosscache/myCacheService.xml"); // file is in the /home/jbosscache directory
configFileName
- the named XML file should exist in the classpath or should be a fully qualified or relative (to your JVM working directory) path to a file on the local file system. Note that the classpath is checked first for the existence of this file.
Cache
instance
ConfigurationException
- if there are problems with the configurationCache<K,V> createCache(java.lang.String configFileName, boolean start) throws ConfigurationException
Cache
instance, and optionally starts it.
configFileName
- the named XML file should exist in the classpath or should be a fully qualified or relative (to your JVM working directory) path to a file on the local file system. Note that the classpath is checked first for the existence of this file.start
- if true, the cache is started before returning.
Cache
instance
ConfigurationException
- if there are problems with the configurationfor examples on valid config file names.
Cache<K,V> createCache(Configuration configuration) throws ConfigurationException
Cache
instance based on a Configuration
passed in.
Ensure that the Configuration you pass in is not used by another cache instance in the same JVM,
as it may be concurrently modified. Clone the configuration, if shared, using
Configuration.clone()
.
configuration
- the Configuration
object that is passed in to setCache the Cache
.
Cache
instance
ConfigurationException
- if there are problems with the configurationCache<K,V> createCache(Configuration configuration, boolean start) throws ConfigurationException
Cache
instance, and optionally starts it, based on a Configuration
passed in.
Ensure that the Configuration you pass in is not used by another cache instance in the same JVM,
as it may be concurrently modified. Clone the configuration, if shared, using
Configuration.clone()
.
configuration
- the Configuration
object that is passed in to setCache the Cache
.start
- if true, the cache is started before returning.
Cache
instance
ConfigurationException
- if there are problems with the configuration
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |