Class ExoCacheFactoryImpl
java.lang.Object
org.exoplatform.services.cache.impl.infinispan.ExoCacheFactoryImpl
- All Implemented Interfaces:
org.exoplatform.services.cache.ExoCacheFactory,org.picocontainer.Startable
public class ExoCacheFactoryImpl
extends Object
implements org.exoplatform.services.cache.ExoCacheFactory, org.picocontainer.Startable
This class is the Infinispan implementation of the
ExoCacheFactory- Version:
- $Id$
- Author:
- Nicolas Filotto
-
Constructor Summary
ConstructorsConstructorDescriptionExoCacheFactoryImpl(org.exoplatform.container.ExoContainerContext ctx, String cacheConfigTemplate, String cacheAsyncConfigTemplate, org.exoplatform.container.configuration.ConfigurationManager configManager, DistributedCacheManager dcm) ExoCacheFactoryImpl(org.exoplatform.container.ExoContainerContext ctx, org.exoplatform.container.xml.InitParams params, org.exoplatform.container.configuration.ConfigurationManager configManager) ExoCacheFactoryImpl(org.exoplatform.container.ExoContainerContext ctx, org.exoplatform.container.xml.InitParams params, org.exoplatform.container.configuration.ConfigurationManager configManager, DistributedCacheManager dcm) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddConfig(ExoCacheFactoryConfigPlugin plugin) Add a list of custom configuration to registervoidaddCreator(ExoCacheCreatorPlugin plugin) Add a list of creators to registerorg.exoplatform.services.cache.ExoCache<Serializable, Object> createCache(org.exoplatform.services.cache.ExoCacheConfig config) To create a new cache instance according to the given configuration, we follow the steps below: We first try to find if a specific location of the cache configuration has been defined thanks to an external component plugin of type ExoCacheFactoryConfigPlugin.protected ExoCacheCreatorgetExoCacheCreator(org.exoplatform.services.cache.ExoCacheConfig config) Returns the most relevant ExoCacheCreator according to the give configurationprotected voidresetConfiguration(org.infinispan.configuration.cache.ConfigurationBuilder confBuilder) Clean the configuration template to prevent conflictsvoidstart()voidstop()
-
Constructor Details
-
ExoCacheFactoryImpl
public ExoCacheFactoryImpl(org.exoplatform.container.ExoContainerContext ctx, org.exoplatform.container.xml.InitParams params, org.exoplatform.container.configuration.ConfigurationManager configManager) throws org.exoplatform.services.cache.ExoCacheInitException - Throws:
org.exoplatform.services.cache.ExoCacheInitException
-
ExoCacheFactoryImpl
public ExoCacheFactoryImpl(org.exoplatform.container.ExoContainerContext ctx, org.exoplatform.container.xml.InitParams params, org.exoplatform.container.configuration.ConfigurationManager configManager, DistributedCacheManager dcm) throws org.exoplatform.services.cache.ExoCacheInitException - Throws:
org.exoplatform.services.cache.ExoCacheInitException
-
ExoCacheFactoryImpl
public ExoCacheFactoryImpl(org.exoplatform.container.ExoContainerContext ctx, String cacheConfigTemplate, String cacheAsyncConfigTemplate, org.exoplatform.container.configuration.ConfigurationManager configManager, DistributedCacheManager dcm) throws org.exoplatform.services.cache.ExoCacheInitException - Throws:
org.exoplatform.services.cache.ExoCacheInitException
-
-
Method Details
-
createCache
public org.exoplatform.services.cache.ExoCache<Serializable,Object> createCache(org.exoplatform.services.cache.ExoCacheConfig config) throws org.exoplatform.services.cache.ExoCacheInitException To create a new cache instance according to the given configuration, we follow the steps below: We first try to find if a specific location of the cache configuration has been defined thanks to an external component plugin of type ExoCacheFactoryConfigPlugin. If so we use the default cache configuration defined in this file otherwise we use the default cache configuration defined in "${CACHE_CONFIG_TEMPLATE_KEY}"- Specified by:
createCachein interfaceorg.exoplatform.services.cache.ExoCacheFactory- Throws:
org.exoplatform.services.cache.ExoCacheInitException
-
addCreator
Add a list of creators to register- Parameters:
plugin- the plugin that contains the creators
-
addConfig
Add a list of custom configuration to register- Parameters:
plugin- the plugin that contains the configs
-
start
public void start()- Specified by:
startin interfaceorg.picocontainer.Startable
-
stop
public void stop()- Specified by:
stopin interfaceorg.picocontainer.Startable
-
getExoCacheCreator
Returns the most relevant ExoCacheCreator according to the give configuration -
resetConfiguration
protected void resetConfiguration(org.infinispan.configuration.cache.ConfigurationBuilder confBuilder) Clean the configuration template to prevent conflicts
-