package schedframe.scheduling.policy.global; import java.util.ArrayList; import java.util.HashSet; import java.util.List; import java.util.Set; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import schedframe.scheduling.GridResourceDiscovery; import schedframe.scheduling.Scheduler; import schedframe.scheduling.manager.resources.ManagedResources; import schedframe.scheduling.plugin.SchedulingPlugin; import schedframe.scheduling.plugin.estimation.ExecutionTimeEstimationPlugin; import schedframe.scheduling.plugin.grid.ModuleListImpl; import schedframe.scheduling.queue.TaskQueueList; public class GridBroker extends GlobalManagementSystem { private static Log log = LogFactory.getLog(GridBroker.class); protected Set otherGridSchedulersIds; public GridBroker(String name, SchedulingPlugin schedulingPlugin, ExecutionTimeEstimationPlugin execTimeEstimationPlugin, TaskQueueList queues) throws Exception { super(name, "BROKER", schedulingPlugin, execTimeEstimationPlugin, queues); otherGridSchedulersIds = new HashSet(); moduleList = new ModuleListImpl(2); } public void init(Scheduler scheduler, ManagedResources managedResources) { super.init(scheduler, managedResources); this.moduleList.add((GridResourceDiscovery)resourceManager); } public List getMyGridResources() { List providerIds = new ArrayList(); for(Scheduler sched: scheduler.getChildren()){ providerIds.add(sched.get_id()); } return providerIds; } public void addOtherGridSchedulerId(int id){ otherGridSchedulersIds.add(id); } }