|
JAC project AOPSYS CEDRIC & LIP6 labs |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.objectweb.jac.core.Wrapper | +--org.objectweb.jac.aspects.tracing.SimpleCountingWrapper | +--org.objectweb.jac.aspects.tracing.OptimizedCountingWrapper
This counter must wrap the methods of which calls have to be
counted. It extends the simple counting wrapper to provide 2
optimization methods when client methods call several times the
method wrapped by incr
. In these cases, the counter is
direcly incremented by the number of times the incr
method has to be called.
In order to avoid redundancy, incr
must not be
called if incrWithArg
or incrWithField
have already been called. To perform this contextual test, use the
before and after running wrapper methods of the aspect
component.
Field Summary |
Fields inherited from class org.objectweb.jac.core.Wrapper |
ac |
Constructor Summary | |
OptimizedCountingWrapper(AspectComponent ac,
Counter c,
int arg)
Create the counter and parametrize it regarding the base program shape. |
|
OptimizedCountingWrapper(AspectComponent ac,
Counter c,
String field)
Create the counter and parametrize it regarding the base program shape. |
Method Summary | |
Object |
incrWithArg(Interaction interaction)
This wrapping method increments the counter with the argument value when the wrapped method is called. |
Object |
incrWithField(Interaction interaction)
This wrapping method increments the counter with the field when the wrapped method is called. |
Methods inherited from class org.objectweb.jac.aspects.tracing.SimpleCountingWrapper |
getCounter, incr, printCounter, setCounter |
Methods inherited from class org.objectweb.jac.core.Wrapper |
attr, attrdef, defines, getAspectComponent, getAspectComponentName, getExceptionHandlers, proceed, setAspectComponent, toString |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public OptimizedCountingWrapper(AspectComponent ac, Counter c, String field)
c
- the used counterfield
- the field that is used to optimize the countingpublic OptimizedCountingWrapper(AspectComponent ac, Counter c, int arg)
c
- the used counterarg
- the argument number that used to optimize the
countingMethod Detail |
public Object incrWithField(Interaction interaction)
SimpleCountingWrapper.incr(Interaction)
public Object incrWithArg(Interaction interaction)
incr
method.
SimpleCountingWrapper.incr(Interaction)
|
Contact JAC development team: Renaud Pawlak Lionel Seinturier Laurent Martelli |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |