package com.a.eye.skywalking.plugin.interceptor;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

/**
 * 被增强的类实例，需扩展的context属性，用于在不同的方法，或者构造函数间保存实例
 * 
 * @author wusheng
 *
 */
public class EnhancedClassInstanceContext {
	public static final String FIELD_NAME = "_$EnhancedClassInstanceContext";
	
	private Map<Object, Object> context = new ConcurrentHashMap<Object, Object>();
	
	public void set(Object key, Object value){
		context.put(key, value);
	}
	
	public Object get(Object key){
		return context.get(key);
	}
	
	public boolean isContain(Object key){
		return context.containsKey(key);
	}
	
	@SuppressWarnings("unchecked")
	public <T> T get(Object key, Class<T> type){
		return (T)this.get(key);
	}
}

@@ -241,85 +241,8 @@
 t %7B%0A
-%09public static final String FIELD_NAME = %22_$EnhancedClassInstanceContext%22;%0A%09%0A
 %09pri
@@ -453,25 +453,24 @@
 et(key);%0A%09%7D%0A
-%09
 %0A%09public boo
@@ -541,40 +541,8 @@
 %7D%0A%09%0A
-%09@SuppressWarnings(%22unchecked%22)%0A
 %09pub

remove useless attr of EnhancedClassInstanceContext