Class CacheManagerImpl

java.lang.Object
io.vertigo.datastore.impl.cache.CacheManagerImpl
All Implemented Interfaces:
io.vertigo.core.node.component.Component, io.vertigo.core.node.component.CoreComponent, io.vertigo.core.node.component.Manager, io.vertigo.core.node.definition.DefinitionProvider, io.vertigo.core.node.definition.SimpleDefinitionProvider, CacheManager

public final class CacheManagerImpl extends Object implements CacheManager, io.vertigo.core.node.definition.SimpleDefinitionProvider
Manager de gestion du cache.
Author:
pchretien
  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    clear(String context)
    Effacement du contenu d'un contexte.
    void
    Effacement du contenu de TOUS les Contextes de cache.
    get(String context, Serializable key)
    Cette methode rend l'objet désigne par le contexte et le handle donnée en entrée.
    List<? extends io.vertigo.core.node.definition.Definition>
    provideDefinitions(io.vertigo.core.node.definition.DefinitionSpace definitionSpace)
     
    void
    put(String context, Serializable key, Object value)
    Ajoute Objet dans le cache.
    boolean
    remove(String context, Serializable key)
    Suppression du cache de l'objet référencé par sa clé.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface io.vertigo.core.node.definition.DefinitionProvider

    addDefinitionResourceConfig

    Methods inherited from interface io.vertigo.core.node.definition.SimpleDefinitionProvider

    get
  • Constructor Details

    • CacheManagerImpl

      @Inject public CacheManagerImpl(CachePlugin cachePlugin)
      Constructor.
      Parameters:
      cachePlugin - Plugin de gestion du cache
  • Method Details

    • provideDefinitions

      public List<? extends io.vertigo.core.node.definition.Definition> provideDefinitions(io.vertigo.core.node.definition.DefinitionSpace definitionSpace)
      Specified by:
      provideDefinitions in interface io.vertigo.core.node.definition.SimpleDefinitionProvider
    • put

      public void put(String context, Serializable key, Object value)
      Ajoute Objet dans le cache. Si le context n'existe pas, il est crée. Si la clé existe déjà, l'objet précédent est remplacé.
      Specified by:
      put in interface CacheManager
      Parameters:
      context - Contexte de cache
      key - Clé de l'objet à insérer
      value - Objet à insérer
    • get

      public Object get(String context, Serializable key)
      Cette methode rend l'objet désigne par le contexte et le handle donnée en entrée. Si le contexte n'existe pas, une exception IllegalArgumentException. Si le handle n'existe pas, ou l'objet n'a pas ou plus de reference en cache, l'objet renvoyé et un null.
      Specified by:
      get in interface CacheManager
      Parameters:
      context - Contexte de cache
      key - Clé de l'objet à récupérer
      Returns:
      Objet demandé ou null si non trouvé
    • remove

      public boolean remove(String context, Serializable key)
      Suppression du cache de l'objet référencé par sa clé.
      Specified by:
      remove in interface CacheManager
      Parameters:
      context - Contexte de cache
      key - Clé de l'objet à supprimer
      Returns:
      Si objet supprimé
    • clear

      public void clear(String context)
      Effacement du contenu d'un contexte. Supprime tous les items du cache.
      Specified by:
      clear in interface CacheManager
      Parameters:
      context - Contexte de cache
    • clearAll

      public void clearAll()
      Effacement du contenu de TOUS les Contextes de cache.
      Specified by:
      clearAll in interface CacheManager