// Path: common/java/common/AMQPCommon.java
// public class AMQPCommon {
// 
// 	public static Channel connect() throws Exception {
// 		ConnectionFactory factory = new ConnectionFactory();
// 		factory.setHost("127.0.0.1");
// 		factory.setPort(32768);
// 		Connection conn = factory.newConnection();
// 		return conn.createChannel();
// 	}
// 	
// 	public static void close(Channel channel) throws Exception {
// 		channel.close();
// 		channel.getConnection().close();
// 	}
// 
// }


import java.util.ArrayList;
import java.util.List;
import com.rabbitmq.client.Channel;
import com.rabbitmq.client.Connection;
import common.AMQPCommon;
package supervisor;



public class AMQPSupervisor {
	
	private List<AMQPConsumer> consumers = new ArrayList<AMQPConsumer>();
	Connection connection;
	
	public void run(long keepAlive, boolean isSupervisor, long consumerCount) throws Exception {
		System.out.println("Starting service");
		if (isSupervisor) {
			System.out.println("Starting supervisor");			
		}
// Path: common/java/common/AMQPCommon.java
// public class AMQPCommon {
// 
// 	public static Channel connect() throws Exception {
// 		ConnectionFactory factory = new ConnectionFactory();
// 		factory.setHost("127.0.0.1");
// 		factory.setPort(32768);
// 		Connection conn = factory.newConnection();
// 		return conn.createChannel();
// 	}
// 	
// 	public static void close(Channel channel) throws Exception {
// 		channel.close();
// 		channel.getConnection().close();
// 	}
// 
// }


// Path: supervisor/java/supervisor/AMQPSupervisor.java
import java.util.ArrayList;
import java.util.List;
import com.rabbitmq.client.Channel;
import com.rabbitmq.client.Connection;
import common.AMQPCommon;

package supervisor;



public class AMQPSupervisor {
	
	private List<AMQPConsumer> consumers = new ArrayList<AMQPConsumer>();
	Connection connection;
	
	public void run(long keepAlive, boolean isSupervisor, long consumerCount) throws Exception {
		System.out.println("Starting service");
		if (isSupervisor) {
			System.out.println("Starting supervisor");			
		}
		Channel channel = AMQPCommon.connect();