Newer
Older
democall3 / src / discovery / jms / ServiceLocator.java
GEOMA48p on 20 Jul 2015 574 bytes Nearly have StudentClient sending via JMS.
package discovery.jms;

import gui.Lab;
import gui.LabRegistry;
import java.util.ArrayList;
import java.util.Collection;
import server.jms.JmsConnection;

/**
 *
 * @author Mark
 */
public class ServiceLocator {

	public Collection<Lab> getActiveLabs() {
		Collection<String> labNames = new JmsConnection().peekAll("active_servers");
		
		Collection<Lab> activeLabs = new ArrayList<Lab>();
		
		LabRegistry registry = new LabRegistry();
		
		for (String labName : labNames) {
			Lab lab = registry.getLab(labName);
			activeLabs.add(lab);
		}
		
		return activeLabs;
	}
	
}