eXo Kernel :: Cache Extension :: Infinispan Implementation 2.5.0-Alpha3

org.exoplatform.services.cache.impl.infinispan
Class ExoCacheFactoryImpl

java.lang.Object
  extended by org.exoplatform.services.cache.impl.infinispan.ExoCacheFactoryImpl
All Implemented Interfaces:
ExoCacheFactory

public class ExoCacheFactoryImpl
extends Object
implements ExoCacheFactory

This class is the Infinispan implementation of the ExoCacheFactory

Version:
$Id$
Author:
Nicolas Filotto

Constructor Summary
ExoCacheFactoryImpl(ExoContainerContext ctx, InitParams params, ConfigurationManager configManager)
           
ExoCacheFactoryImpl(ExoContainerContext ctx, InitParams params, ConfigurationManager configManager, DistributedCacheManager dcm)
           
ExoCacheFactoryImpl(ExoContainerContext ctx, String cacheConfigTemplate, ConfigurationManager configManager, DistributedCacheManager dcm)
           
 
Method Summary
 void addConfig(ExoCacheFactoryConfigPlugin plugin)
          Add a list of custom configuration to register
 void addCreator(ExoCacheCreatorPlugin plugin)
          Add a list of creators to register
 ExoCache<Serializable,Object> createCache(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(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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExoCacheFactoryImpl

public ExoCacheFactoryImpl(ExoContainerContext ctx,
                           InitParams params,
                           ConfigurationManager configManager)
                    throws ExoCacheInitException
Throws:
ExoCacheInitException

ExoCacheFactoryImpl

public ExoCacheFactoryImpl(ExoContainerContext ctx,
                           InitParams params,
                           ConfigurationManager configManager,
                           DistributedCacheManager dcm)
                    throws ExoCacheInitException
Throws:
ExoCacheInitException

ExoCacheFactoryImpl

public ExoCacheFactoryImpl(ExoContainerContext ctx,
                           String cacheConfigTemplate,
                           ConfigurationManager configManager,
                           DistributedCacheManager dcm)
                    throws ExoCacheInitException
Throws:
ExoCacheInitException
Method Detail

createCache

public ExoCache<Serializable,Object> createCache(ExoCacheConfig config)
                                          throws 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 ExoCacheFactory
Throws:
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

getExoCacheCreator

protected ExoCacheCreator getExoCacheCreator(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


eXo Kernel :: Cache Extension :: Infinispan Implementation 2.5.0-Alpha3

Copyright © 2013 eXo Platform SAS. All Rights Reserved.