fr.ifremer.isisfish.aspect
Class Cache

java.lang.Object
  extended by fr.ifremer.isisfish.aspect.Cache

public class Cache
extends Object

Cache aspect. Created: 25 août 06 22:42:47

Version:
$Revision: 3460 $ Last update: $Date: 2011-10-06 22:08:09 +0200 (Thu, 06 Oct 2011) $ by : $Author: chatellier $
Author:
poussin

Field Summary
protected  Map cache
           
protected  long cacheUsed
           
protected  long totalCall
           
 
Constructor Summary
Cache()
           
 
Method Summary
 Object call(org.codehaus.aspectwerkz.joinpoint.JoinPoint jp)
           
protected  Object computeKey(org.codehaus.aspectwerkz.joinpoint.JoinPoint jp)
          Attention pour avoir une chaine en sortie on prend la reprensentation toString des arguments.
static long getCacheUsed()
           
static long getTotalCall()
           
protected  Trace getTrace()
          Return trace object from context.
static String printStatistiqueAndClear()
          Affiche les statistiques
protected  Object realCall(org.codehaus.aspectwerkz.joinpoint.JoinPoint jp)
          On fait l'appel reel dans une autre methode pour pouvoir le savoir dans les traces
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

totalCall

protected long totalCall

cacheUsed

protected long cacheUsed

cache

protected Map cache
Constructor Detail

Cache

public Cache()
Method Detail

getTrace

protected Trace getTrace()
Return trace object from context.

Returns:
trace object from context

call

public Object call(org.codehaus.aspectwerkz.joinpoint.JoinPoint jp)
            throws Throwable
Throws:
Throwable

realCall

protected Object realCall(org.codehaus.aspectwerkz.joinpoint.JoinPoint jp)
                   throws Throwable
On fait l'appel reel dans une autre methode pour pouvoir le savoir dans les traces

Parameters:
jp -
Returns:
?
Throws:
Throwable

computeKey

protected Object computeKey(org.codehaus.aspectwerkz.joinpoint.JoinPoint jp)
Attention pour avoir une chaine en sortie on prend la reprensentation toString des arguments. Mais en utilisant la methode toString implanté dans Object.

Pour les objets de style Number ou String, il faut prendre le vrai toString, pour que 2 soit bien egal a 2.

Parameters:
jp -
Returns:
?

getCacheUsed

public static long getCacheUsed()
Returns:
Returns the cacheUsed.

getTotalCall

public static long getTotalCall()
Returns:
Returns the totalCall.

printStatistiqueAndClear

public static String printStatistiqueAndClear()
Affiche les statistiques



Copyright © 1999-2012 CodeLutin. All Rights Reserved.