public class Cache extends Object
| Modifier and Type | Field and Description |
|---|---|
protected Map |
cache
map
|
protected long |
cacheUsed |
protected long |
totalCall |
| Constructor and Description |
|---|
Cache() |
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
remove all values in cache
|
void |
clear(TimeStep step)
remove all values in cache for the specied TimeStep
|
protected TimeStep |
computeKey(StringBuilder sbKey,
Method method,
Object[] args) |
Object |
get(Method method,
Object[] args,
Object defaultValue)
Recupere pour un pas de temps donnes une valeur calcule pour une cle
|
protected Object |
get(TimeStep step,
Object key) |
protected Map |
getCacheTimeStep(TimeStep step) |
long |
getCacheUsed() |
long |
getTotalCall() |
protected Trace |
getTrace()
Return trace object from context.
|
String |
printStatistiqueAndClear()
Affiche les statistiques
|
protected void |
put(TimeStep step,
Object key,
Object value) |
protected Object |
realCall(Object defaultValue)
On fait l'appel reel dans une autre methode pour pouvoir le savoir
dans les traces
|
protected long totalCall
protected long cacheUsed
protected Map cache
protected Trace getTrace()
public Object get(Method method, Object[] args, Object defaultValue) throws Throwable
step - le pas de temps pour lequel on souhaite ajouter (ou null)key - la cle de storagedefaultValue - la valeur par defaut a retourner si elle n'est pas en cache
si defaultValue est une JoinPoint alors un proceed est appele dessus et le
resultat de l'appel est utiliser comme valeur par defautThrowableprotected TimeStep computeKey(StringBuilder sbKey, Method method, Object[] args)
protected Object realCall(Object defaultValue) throws Throwable
jp - Throwablepublic void clear()
public void clear(TimeStep step)
public long getCacheUsed()
public long getTotalCall()
public String printStatistiqueAndClear()
Copyright © 1999-2013 CodeLutin. All Rights Reserved.