All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.mission.base.spring.beans.Config Maven / Gradle / Ivy

package com.mission.base.spring.beans;

import java.util.HashMap;
import java.util.Map;

import javax.jms.ConnectionFactory;
import javax.jms.JMSException;
import javax.ws.rs.client.Client;
import javax.ws.rs.client.WebTarget;
import javax.ws.rs.core.MultivaluedHashMap;
import javax.ws.rs.core.MultivaluedMap;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.jms.annotation.EnableJms;
import org.springframework.jms.listener.DefaultMessageListenerContainer;

import com.mission.base.activemq.BrokerConnector;
import com.mission.base.http.HttpConnector;
import com.mission.base.http.HttpConnectorSpec;
import com.mission.base.interfaces.IMessageHub;
import com.mission.base.jms.JmsConnector;
import com.mission.base.logger.Logger;
import com.mission.base.objecttweet.MessageHub;
import com.mission.base.scheduler.ScheduleConnector;
import com.mission.codegen.CodeGenerator;



@Configuration
@EnableJms
public class Config {


	public static ApplicationContext applicationContext() {
		return new AnnotationConfigApplicationContext(Config.class);
	}

	@Bean
	IMessageHub messageHub() {
		return new MessageHub();
	}

	@Bean
	Map> headerMap() {
		final Map> headerMap = new HashMap>();
		return headerMap;
	}

//	@Bean(name = "PayerPortalConnector")
//	public HttpConnector PayerPortalBatchHttpConnector(IMessageHub messageHub, HttpConnectorSpec httpConnectorSpec) {
//		return new HttpConnector("PayerPortalConnector", httpConnectorSpec, messageHub);
//	}
	
//	@Bean
//	ScheduleConnector scheduleConnector(IMessageHub messageHub) {
//		return new ScheduleConnector(messageHub);
//	}

//	@Bean
//	BrokerConnector brokerConnector(IMessageHub messageHub) {
//		return new BrokerConnector(messageHub);
//	}
//
//	@Bean
//	ConnectionFactory connectionFactory(BrokerConnector brokerConnector) {
//		return brokerConnector.getConnectionFactory();
//	}
//
//	@Bean
//	public JmsConnector jmsConnector(ConnectionFactory connectionFactory, IMessageHub messageHub) {
//		try {
//			return new JmsConnector(connectionFactory);
//		} catch (JMSException e) {
//			e.printStackTrace();
//		}
//		return null;
//	}

	// @Bean(name = "TestJmsTemplate")
	// public JmsTemplate testJmsTemplate() {
	// JmsTemplate template = new JmsTemplate();
	// template.setConnectionFactory(testConnectionFactory());
	// template.setDefaultDestination(testDestination());
	// return template;
	// }

//	@Bean
//	public DefaultMessageListenerContainer jmsContainer(JmsConnector jmsConnector) {
//		return jmsConnector.createListener("TestQueue", (msg) -> {
//				System.out.println("Queue - TestQueue, Object - " + msg);
//		});
//	}
	
//	@Bean
//	CodeGenerator application(IMessageHub messageHub) {
//		return new CodeGenerator(messageHub);
//	}
	
//	@Bean
//	Logger logger(IMessageHub messageHub, Application application) {
//		Logger logger = new Logger(messageHub);
//		logger.subscribe(application, (msg) -> System.out.println(msg));
//		return logger;
//	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy