package com.eactive.eai.control;

import java.util.Properties;

import javax.jms.JMSException;

import com.eactive.eai.adapter.ElinkAdapter;
import com.eactive.eai.adapter.ElinkAdapterFactory;
import com.eactive.eai.adapter.Keys;
import com.eactive.eai.common.exception.ExceptionUtil;

public class AMQSender {

	public static Object callService(String adapterGroupName, Properties prop, Object inputData, Properties tempProp)
			throws Exception {
		ElinkAdapter adapter = ElinkAdapterFactory.newInstance().getElinkAdapter(Keys.TYPE_AMQ);

		try {
			return adapter.callService(adapterGroupName, prop, inputData, tempProp);
		} catch (JMSException jmse) {
			throw jmse;
		} catch (Exception e) {
			throw new Exception(ExceptionUtil.getErrorCode(e, "RECEAICUL001"));
		}
	}

}
