|
|||||||||||
| 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
This simple counter must wrap the methods of which calls have to be counted.
In some cases, optimizations can be achieved by grouping
counts. See OptimizedCountingWrapper.
OptimizedCountingWrapper,
Serialized Form| Field Summary |
| Fields inherited from class org.objectweb.jac.core.Wrapper |
ac, cr |
| Constructor Summary | |
SimpleCountingWrapper(AspectComponent ac,
Counter counter)
Creates a new wrapper that uses the given counter. |
|
| Method Summary | |
Object |
construct(ConstructorInvocation invocation)
|
int |
getCounter()
Role method: get the counter value. |
Object |
incr(Interaction interaction)
This wrapping method increments the counter when the wrapped method is called. |
Object |
invoke(MethodInvocation invocation)
|
void |
printCounter()
Prints the counter in System.out. |
void |
setCounter(int value)
Role method: set the counter value. |
| Methods inherited from class org.objectweb.jac.core.Wrapper |
attr, attrdef, defines, getAspectComponent, getAspectComponentName, getExceptionHandlers, proceed, toString |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public SimpleCountingWrapper(AspectComponent ac,
Counter counter)
counter - the counter| Method Detail |
public Object incr(Interaction interaction)
public void setCounter(int value)
value - the new counter valuegetCounter(),
incr(Interaction)public int getCounter()
setCounter(int),
incr(Interaction)public void printCounter()
System.out.
public Object invoke(MethodInvocation invocation)
throws Throwable
invoke in interface MethodInterceptorinvoke in class WrapperThrowable
public Object construct(ConstructorInvocation invocation)
throws Throwable
construct in interface ConstructorInterceptorconstruct in class WrapperThrowable
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||