package com.javahonk;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import com.javahonk.messaging.TibcoPublisher;
import com.javahonk.messaging.TibcoPublisherConsumer;

/**
 * @author Java Honk
 *
 */
public class MainApplication {
	
	private static final Logger logger = LogManager.getLogger(MainApplication.class.getName());
	
	public static void main(String[] args) {
		
		logger.info("Tibco EMS started.");
		
		ApplicationContext context = new ClassPathXmlApplicationContext("spring-context.xml");
		
		TibcoPublisher tibcoPublisher = (TibcoPublisher)context.getBean(TibcoPublisher.class);
		tibcoPublisher.sendStockOrderToSPI("Test");
		
		TibcoPublisherConsumer tibcoTradePublisher = (TibcoPublisherConsumer)context.getBean(TibcoPublisherConsumer.class);
		tibcoTradePublisher.sendTrade("Test");		
		
		System.out.println(context);
			
		
	}
}
