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

    Constructors
    Constructor
    Description
    ExoCacheFactoryImpl(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 Type
    Method
    Description
    void
    Add a list of custom configuration to register
    void
    Add a list of creators to register
    org.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 ExoCacheCreator
    getExoCacheCreator(org.exoplatform.services.cache.ExoCacheConfig config)
    Returns the most relevant ExoCacheCreator according to the give configuration
    protected void
    resetConfiguration(org.infinispan.configuration.cache.ConfigurationBuilder confBuilder)
    Clean the configuration template to prevent conflicts
    void
     
    void
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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:
      createCache in interface org.exoplatform.services.cache.ExoCacheFactory
      Throws:
      org.exoplatform.services.cache.ExoCacheInitException
    • addCreator

      public void addCreator(ExoCacheCreatorPlugin plugin)
      Add a list of creators to register
      Parameters:
      plugin - the plugin that contains the creators
    • addConfig

      public void addConfig(ExoCacheFactoryConfigPlugin plugin)
      Add a list of custom configuration to register
      Parameters:
      plugin - the plugin that contains the configs
    • start

      public void start()
      Specified by:
      start in interface org.picocontainer.Startable
    • stop

      public void stop()
      Specified by:
      stop in interface org.picocontainer.Startable
    • getExoCacheCreator

      protected ExoCacheCreator getExoCacheCreator(org.exoplatform.services.cache.ExoCacheConfig config)
      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