ch.elca.el4j.tests.aspects.util
Class InvocationMonitor

java.lang.Object
  extended by ch.elca.el4j.tests.aspects.util.InvocationMonitor

public final class InvocationMonitor
extends Object

Invocation monitor to count per class and see the invocation order.

Author:
Martin Zeltner (MZE)
File-location:
InvocationMonitor
Last check-in date:
2010-12-21 11:08:04 +0100 (Di, 21. Dez 2010) by swismer for revision 4253

Field Summary
private static Map<Class<?>,Integer> s_classCounterMap
          Private thread-save class-specific counter variables.
private static List<Class<?>> s_invocationList
          Private thread-save list of count invocations.
 
Constructor Summary
private InvocationMonitor()
          Hide default constructor.
 
Method Summary
static void clear()
          Clears the invocation monitor.
static int getCounter(Class<?> clazz)
           
static List<Class<?>> getInvocationList()
           
static void incrementCounter(Class<?> clazz)
          Increments the counter variable of the given class.
static void initCounter(Class<?> clazz)
          Initializes the static counter to zero for the given clazz.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

s_classCounterMap

private static Map<Class<?>,Integer> s_classCounterMap
Private thread-save class-specific counter variables.


s_invocationList

private static List<Class<?>> s_invocationList
Private thread-save list of count invocations.

Constructor Detail

InvocationMonitor

private InvocationMonitor()
Hide default constructor.

Method Detail

clear

public static void clear()
Clears the invocation monitor.


initCounter

public static void initCounter(Class<?> clazz)
Initializes the static counter to zero for the given clazz.

Parameters:
clazz - Is the counter class.

getCounter

public static int getCounter(Class<?> clazz)
Parameters:
clazz - Is the counter class.
Returns:
Returns the current counter value of the given class.

incrementCounter

public static void incrementCounter(Class<?> clazz)
Increments the counter variable of the given class.

Parameters:
clazz - Is the counter class.

getInvocationList

public static List<Class<?>> getInvocationList()
Returns:
Returns a copy of the invocation list.


Copyright © 2005-2011 ELCA. All Rights Reserved.