// Path: architecture-integration/src/main/java/com/ea/core/integration/IntegrationContext.java
// public class IntegrationContext {
// 	private Logger logger = LoggerFactory.getLogger(IntegrationContext.class);
// 	
// 	public Object connect(String connectMode, Map<String, String> conf, String connectorId, String facadeId, Object... models) throws Exception {
// 		// TODO Auto-generated method stub
// 		long startTime = Calendar.getInstance().getTimeInMillis();
// 		IConnector connector = null;
// 		if(connectMode.equals(IntegrationConstant.CONNECTOR_MODE.MQ.getCode())){
// 			IClient client = new MqSendClient(conf.get(IntegrationConstant.CONF.HOST.getCode()), 
// 								conf.get(IntegrationConstant.CONF.USERNAME.getCode()),
// 								conf.get(IntegrationConstant.CONF.PASSWORD.getCode()));
// 			connector = new MqConnector();
// 			((AbstractConnector)connector).setClient(client);
// 		}
// 		else if(connectMode.equals(IntegrationConstant.CONNECTOR_MODE.STORM.getCode())){
// 			IClient client = new RemoteClient(conf.get(IntegrationConstant.CONF.HOST.getCode()), 
// 									new Integer(conf.get(IntegrationConstant.CONF.PORT.getCode())),
// 									new Integer(conf.get(IntegrationConstant.CONF.TIMEOUT.getCode())));
// 			connector = new StormConnector();
// 			((AbstractConnector)connector).setClient(client);
// 		}
// 		else if(connectMode.equals(IntegrationConstant.CONNECTOR_MODE.SOAP.getCode())){
// 			IWSClient client = new SoapClient(new URL(conf.get(IntegrationConstant.CONF.HOST.getCode())));
// 			connector = new SoapConnector();
// 			((AbstractWSConnector)connector).setClient(client);
// 		}
// 		else {
// 			IWSClient client = null;
// 			if(HttpMethod.GET.equals(conf.get(IntegrationConstant.CONF.HTTP_METHOD.getCode()))){
// 				client = new GetClient(new URL(conf.get(IntegrationConstant.CONF.HOST.getCode())));
// 			} else if(HttpMethod.POST.equals(conf.get(IntegrationConstant.CONF.HTTP_METHOD.getCode()))){
// 				client = new PostClient(new URL(conf.get(IntegrationConstant.CONF.HOST.getCode())));
// 			} else if(HttpMethod.PUT.equals(conf.get(IntegrationConstant.CONF.HTTP_METHOD.getCode()))){
// 				client = new PutClient(new URL(conf.get(IntegrationConstant.CONF.HOST.getCode())));
// 			} else if(HttpMethod.DELETE.equals(conf.get(IntegrationConstant.CONF.HTTP_METHOD.getCode()))){
// 				client = new DeleteClient(new URL(conf.get(IntegrationConstant.CONF.HOST.getCode())));
// 			} else {
// 				throw new RuntimeException("提供的HttpMethod方法有误，请检查！");
// 			}
// 			connector = new RestConnector();
// 			((AbstractWSConnector)connector).setClient(client);
// 		}
// 		long endTime1 = Calendar.getInstance().getTimeInMillis();
// 		logger.info("初始化连接共耗时" + (endTime1 - startTime) + "毫秒"); 
// 		Object result = connector.connect(connectorId, facadeId, models);
// 		long endTime2 = Calendar.getInstance().getTimeInMillis();
// 		logger.info("本次执行共耗时" + (endTime2 - startTime) + "毫秒，排除初始化连接后的耗时" + (endTime2 - endTime1) + "毫秒，连接方式：" + connectMode + "，调用Facade：" + facadeId); 
// 		return result;
// 	}
// 
// }


import java.util.HashMap;
import java.util.Map;
import com.ea.core.integration.IntegrationConstant;
import com.ea.core.integration.IntegrationContext;
package com.ea.core.integration.bridge;



public class RestIntegration {

	public void connect(String host, String httpMethod, String method, Object... obj) throws Exception{
// Path: architecture-integration/src/main/java/com/ea/core/integration/IntegrationContext.java
// public class IntegrationContext {
// 	private Logger logger = LoggerFactory.getLogger(IntegrationContext.class);
// 	
// 	public Object connect(String connectMode, Map<String, String> conf, String connectorId, String facadeId, Object... models) throws Exception {
// 		// TODO Auto-generated method stub
// 		long startTime = Calendar.getInstance().getTimeInMillis();
// 		IConnector connector = null;
// 		if(connectMode.equals(IntegrationConstant.CONNECTOR_MODE.MQ.getCode())){
// 			IClient client = new MqSendClient(conf.get(IntegrationConstant.CONF.HOST.getCode()), 
// 								conf.get(IntegrationConstant.CONF.USERNAME.getCode()),
// 								conf.get(IntegrationConstant.CONF.PASSWORD.getCode()));
// 			connector = new MqConnector();
// 			((AbstractConnector)connector).setClient(client);
// 		}
// 		else if(connectMode.equals(IntegrationConstant.CONNECTOR_MODE.STORM.getCode())){
// 			IClient client = new RemoteClient(conf.get(IntegrationConstant.CONF.HOST.getCode()), 
// 									new Integer(conf.get(IntegrationConstant.CONF.PORT.getCode())),
// 									new Integer(conf.get(IntegrationConstant.CONF.TIMEOUT.getCode())));
// 			connector = new StormConnector();
// 			((AbstractConnector)connector).setClient(client);
// 		}
// 		else if(connectMode.equals(IntegrationConstant.CONNECTOR_MODE.SOAP.getCode())){
// 			IWSClient client = new SoapClient(new URL(conf.get(IntegrationConstant.CONF.HOST.getCode())));
// 			connector = new SoapConnector();
// 			((AbstractWSConnector)connector).setClient(client);
// 		}
// 		else {
// 			IWSClient client = null;
// 			if(HttpMethod.GET.equals(conf.get(IntegrationConstant.CONF.HTTP_METHOD.getCode()))){
// 				client = new GetClient(new URL(conf.get(IntegrationConstant.CONF.HOST.getCode())));
// 			} else if(HttpMethod.POST.equals(conf.get(IntegrationConstant.CONF.HTTP_METHOD.getCode()))){
// 				client = new PostClient(new URL(conf.get(IntegrationConstant.CONF.HOST.getCode())));
// 			} else if(HttpMethod.PUT.equals(conf.get(IntegrationConstant.CONF.HTTP_METHOD.getCode()))){
// 				client = new PutClient(new URL(conf.get(IntegrationConstant.CONF.HOST.getCode())));
// 			} else if(HttpMethod.DELETE.equals(conf.get(IntegrationConstant.CONF.HTTP_METHOD.getCode()))){
// 				client = new DeleteClient(new URL(conf.get(IntegrationConstant.CONF.HOST.getCode())));
// 			} else {
// 				throw new RuntimeException("提供的HttpMethod方法有误，请检查！");
// 			}
// 			connector = new RestConnector();
// 			((AbstractWSConnector)connector).setClient(client);
// 		}
// 		long endTime1 = Calendar.getInstance().getTimeInMillis();
// 		logger.info("初始化连接共耗时" + (endTime1 - startTime) + "毫秒"); 
// 		Object result = connector.connect(connectorId, facadeId, models);
// 		long endTime2 = Calendar.getInstance().getTimeInMillis();
// 		logger.info("本次执行共耗时" + (endTime2 - startTime) + "毫秒，排除初始化连接后的耗时" + (endTime2 - endTime1) + "毫秒，连接方式：" + connectMode + "，调用Facade：" + facadeId); 
// 		return result;
// 	}
// 
// }


// Path: architecture-integration/src/main/java/com/ea/core/integration/bridge/RestIntegration.java
import java.util.HashMap;
import java.util.Map;
import com.ea.core.integration.IntegrationConstant;
import com.ea.core.integration.IntegrationContext;

package com.ea.core.integration.bridge;



public class RestIntegration {

	public void connect(String host, String httpMethod, String method, Object... obj) throws Exception{
		IntegrationContext context = new IntegrationContext();