// Path: cat-client/src/main/java/com/site/helper/JsonBuilder.java
// public class JsonBuilder {
// 
// 	private FieldNamingStrategy m_fieldNamingStrategy = new FieldNamingStrategy() {
// 
// 		@Override
// 		public String translateName(Field f) {
// 			String name = f.getName();
// 
// 			if (name.startsWith("m_")) {
// 				return name.substring(2);
// 			} else {
// 				return name;
// 			}
// 		}
// 	};
// 
// 	private Gson m_gson = new GsonBuilder().registerTypeAdapter(Timestamp.class, new TimestampTypeAdapter())
// 	      .setDateFormat("yyyy-MM-dd HH:mm:ss").setFieldNamingStrategy(m_fieldNamingStrategy).create();
// 
// 	@SuppressWarnings({ "unchecked", "rawtypes" })
// 	public Object parse(String json, Class clz) {
// 		return m_gson.fromJson(json, clz);
// 	}
// 
// 	public String toJson(Object o) {
// 		return m_gson.toJson(o);
// 	}
// 
// 	public String toJsonWithEnter(Object o) {
// 		return m_gson.toJson(o) + "\n";
// 	}
// 
// 	public class TimestampTypeAdapter implements JsonSerializer<Timestamp>, JsonDeserializer<Timestamp> {
// 		private final DateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
// 
// 		public Timestamp deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context)
// 		      throws JsonParseException {
// 			if (!(json instanceof JsonPrimitive)) {
// 				throw new JsonParseException("The date should be a string value");
// 			}
// 
// 			try {
// 				Date date = format.parse(json.getAsString());
// 				return new Timestamp(date.getTime());
// 			} catch (ParseException e) {
// 				throw new JsonParseException(e);
// 			}
// 		}
// 
// 		public JsonElement serialize(Timestamp src, Type arg1, JsonSerializationContext arg2) {
// 			String dateFormatAsString = format.format(new Date(src.getTime()));
// 			return new JsonPrimitive(dateFormatAsString);
// 		}
// 	}
// 
// }


import java.io.InputStream;
import java.net.InetSocketAddress;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import org.codehaus.plexus.logging.LogEnabled;
import org.codehaus.plexus.logging.Logger;
import org.unidal.cat.config.ClientConfigurationManager;
import org.unidal.helper.Files;
import org.unidal.helper.Splitters;
import org.unidal.helper.Urls;
import org.unidal.lookup.annotation.Inject;
import org.unidal.lookup.annotation.Named;
import org.unidal.net.SocketAddressProvider;
import com.dianping.cat.configuration.KVConfig;
import com.site.helper.JsonBuilder;
package org.unidal.cat.transport;




@Named(type = SocketAddressProvider.class)
public class DefaultSocketAddressProvider implements SocketAddressProvider, LogEnabled {
   @Inject
   private ClientConfigurationManager m_configManager;

// Path: cat-client/src/main/java/com/site/helper/JsonBuilder.java
// public class JsonBuilder {
// 
// 	private FieldNamingStrategy m_fieldNamingStrategy = new FieldNamingStrategy() {
// 
// 		@Override
// 		public String translateName(Field f) {
// 			String name = f.getName();
// 
// 			if (name.startsWith("m_")) {
// 				return name.substring(2);
// 			} else {
// 				return name;
// 			}
// 		}
// 	};
// 
// 	private Gson m_gson = new GsonBuilder().registerTypeAdapter(Timestamp.class, new TimestampTypeAdapter())
// 	      .setDateFormat("yyyy-MM-dd HH:mm:ss").setFieldNamingStrategy(m_fieldNamingStrategy).create();
// 
// 	@SuppressWarnings({ "unchecked", "rawtypes" })
// 	public Object parse(String json, Class clz) {
// 		return m_gson.fromJson(json, clz);
// 	}
// 
// 	public String toJson(Object o) {
// 		return m_gson.toJson(o);
// 	}
// 
// 	public String toJsonWithEnter(Object o) {
// 		return m_gson.toJson(o) + "\n";
// 	}
// 
// 	public class TimestampTypeAdapter implements JsonSerializer<Timestamp>, JsonDeserializer<Timestamp> {
// 		private final DateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
// 
// 		public Timestamp deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context)
// 		      throws JsonParseException {
// 			if (!(json instanceof JsonPrimitive)) {
// 				throw new JsonParseException("The date should be a string value");
// 			}
// 
// 			try {
// 				Date date = format.parse(json.getAsString());
// 				return new Timestamp(date.getTime());
// 			} catch (ParseException e) {
// 				throw new JsonParseException(e);
// 			}
// 		}
// 
// 		public JsonElement serialize(Timestamp src, Type arg1, JsonSerializationContext arg2) {
// 			String dateFormatAsString = format.format(new Date(src.getTime()));
// 			return new JsonPrimitive(dateFormatAsString);
// 		}
// 	}
// 
// }


// Path: cat-client/src/main/java/org/unidal/cat/transport/DefaultSocketAddressProvider.java
import java.io.InputStream;
import java.net.InetSocketAddress;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import org.codehaus.plexus.logging.LogEnabled;
import org.codehaus.plexus.logging.Logger;
import org.unidal.cat.config.ClientConfigurationManager;
import org.unidal.helper.Files;
import org.unidal.helper.Splitters;
import org.unidal.helper.Urls;
import org.unidal.lookup.annotation.Inject;
import org.unidal.lookup.annotation.Named;
import org.unidal.net.SocketAddressProvider;
import com.dianping.cat.configuration.KVConfig;
import com.site.helper.JsonBuilder;

package org.unidal.cat.transport;




@Named(type = SocketAddressProvider.class)
public class DefaultSocketAddressProvider implements SocketAddressProvider, LogEnabled {
   @Inject
   private ClientConfigurationManager m_configManager;

   private JsonBuilder m_jsonBuilder = new JsonBuilder();