Class MemoryCachePlugin
- java.lang.Object
-
- io.vertigo.datastore.plugins.cache.memory.MemoryCachePlugin
-
- All Implemented Interfaces:
io.vertigo.core.node.component.Activeable
,io.vertigo.core.node.component.CoreComponent
,io.vertigo.core.node.component.Plugin
,CachePlugin
public final class MemoryCachePlugin extends Object implements io.vertigo.core.node.component.Activeable, CachePlugin
Implémentation MapCache du plugins.- Author:
- npiedeloup
-
-
Constructor Summary
Constructors Constructor Description MemoryCachePlugin(CodecManager codecManager)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clear(String context)
Effacement du contenu d'un contexte.void
clearAll()
Effacement du contenu de TOUS les Contextes de cache.Object
get(String context, Serializable key)
Cette methode rend l'objet désigne par le contexte et le handle donnée en entrée.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é.void
start()
void
stop()
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.vertigo.datastore.impl.cache.CachePlugin
checkIo
-
-
-
-
Constructor Detail
-
MemoryCachePlugin
@Inject public MemoryCachePlugin(CodecManager codecManager)
Constructor.- Parameters:
codecManager
- Manager des mécanismes de codage/décodage.
-
-
Method Detail
-
start
public void start()
- Specified by:
start
in interfaceio.vertigo.core.node.component.Activeable
-
stop
public void stop()
- Specified by:
stop
in interfaceio.vertigo.core.node.component.Activeable
-
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 interfaceCachePlugin
- Parameters:
context
- Contexte de cachekey
- Clé de l'objet à insérervalue
- 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 interfaceCachePlugin
- Parameters:
context
- Contexte de cachekey
- 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 interfaceCachePlugin
- Parameters:
context
- Contexte de cachekey
- Clé de l'objet à supprimer- Returns:
- Si objet supprimé
-
clearAll
public void clearAll()
Effacement du contenu de TOUS les Contextes de cache.- Specified by:
clearAll
in interfaceCachePlugin
-
clear
public void clear(String context)
Effacement du contenu d'un contexte. Supprime tous les items du cache.- Specified by:
clear
in interfaceCachePlugin
- Parameters:
context
- Contexte de cache
-
-