// Path: src/main/java/com/dogeops/cantilever/utils/Util.java
// public class Util {
// 	public static void cease(Logger logger, String message) {
// 		logger.error(message);
// 		System.exit(1);
// 	}
// }


import org.apache.log4j.Logger;
import com.dogeops.cantilever.utils.Util;
package com.dogeops.cantilever.messagequeue;



public class MessageQueueFactory {
	private static final Logger logger = Logger.getLogger(MessageQueueFactory.class
			.getName());

	public enum QueueTypes {
		AMQ, SQS, NAN;
		public static QueueTypes toQueue(String str) {
			try {
				return valueOf(str);
			} catch (Exception ex) {
				return NAN;
			}
		}
	}

	public MessageQueueInterface getQueue(String type) {
		
		switch (QueueTypes.toQueue(type))
		{
		    case AMQ:
		    	return new ActiveMQ();
		    case SQS:
		    	return new AmazonSQS();
		    default:
// Path: src/main/java/com/dogeops/cantilever/utils/Util.java
// public class Util {
// 	public static void cease(Logger logger, String message) {
// 		logger.error(message);
// 		System.exit(1);
// 	}
// }


// Path: src/main/java/com/dogeops/cantilever/messagequeue/MessageQueueFactory.java
import org.apache.log4j.Logger;
import com.dogeops.cantilever.utils.Util;

package com.dogeops.cantilever.messagequeue;



public class MessageQueueFactory {
	private static final Logger logger = Logger.getLogger(MessageQueueFactory.class
			.getName());

	public enum QueueTypes {
		AMQ, SQS, NAN;
		public static QueueTypes toQueue(String str) {
			try {
				return valueOf(str);
			} catch (Exception ex) {
				return NAN;
			}
		}
	}

	public MessageQueueInterface getQueue(String type) {
		
		switch (QueueTypes.toQueue(type))
		{
		    case AMQ:
		    	return new ActiveMQ();
		    case SQS:
		    	return new AmazonSQS();
		    default:
		    	Util.cease(logger, "Invalid Message Queue. Quitting.");