com.googlecode.icegem.serialization.codegen
Class MethodFrameCounter

java.lang.Object
  extended by java.lang.ThreadLocal<java.util.concurrent.atomic.AtomicInteger>
      extended by com.googlecode.icegem.serialization.codegen.MethodFrameCounter

public class MethodFrameCounter
extends java.lang.ThreadLocal<java.util.concurrent.atomic.AtomicInteger>

This counter is a build-in mechanism for detecting circular references. By default it is disabled. It can be enabled by using java property. This property can be set via JVM parameters -Dicegem.serialization.trace.methodframes=true or from the code using the following command: System.setProperty(MethodFrameCounter.SYSTEM_PROPERTY_NAME, "true"); Analog of javassist.runtime.Cflow

Author:
igolovach, Andrey Stepanov

Field Summary
static boolean ENABLED
           
static int MAX_STACK_DEPTH
           
static java.lang.String STACK_OVERFLOW_MSG
           
static java.lang.String SYSTEM_PROPERTY_NAME
           
 
Constructor Summary
MethodFrameCounter()
           
 
Method Summary
static void enterFrame(java.lang.String className)
          Increment the counter.
static void exitFrame(java.lang.String className)
          Decrement the counter and remove class name from the list.
 
Methods inherited from class java.lang.ThreadLocal
get, initialValue, remove, set
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SYSTEM_PROPERTY_NAME

public static final java.lang.String SYSTEM_PROPERTY_NAME
See Also:
Constant Field Values

ENABLED

public static boolean ENABLED

MAX_STACK_DEPTH

public static final int MAX_STACK_DEPTH
See Also:
Constant Field Values

STACK_OVERFLOW_MSG

public static final java.lang.String STACK_OVERFLOW_MSG
See Also:
Constant Field Values
Constructor Detail

MethodFrameCounter

public MethodFrameCounter()
Method Detail

enterFrame

public static void enterFrame(java.lang.String className)
Increment the counter.

Parameters:
className - name of class to enter.

exitFrame

public static void exitFrame(java.lang.String className)
Decrement the counter and remove class name from the list.

Parameters:
className - name of class to exit from.


Copyright © 2011. All Rights Reserved.