use of org.jboss.pnc.coordinator.builder.BuildSchedulerFactory in project pnc by project-ncl.
the class BuildCoordinatorFactory method createBuildCoordinator.
public BuildCoordinatorBeans createBuildCoordinator(DatastoreMock datastore) {
DatastoreAdapter datastoreAdapter = new DatastoreAdapter(datastore);
SystemConfig systemConfig = createConfiguration();
BuildQueue queue = new BuildQueue(systemConfig);
LocalBuildSchedulerMock localBuildScheduler = new LocalBuildSchedulerMock();
BuildSchedulerFactory buildSchedulerFactory = new BuildSchedulerFactory() {
@Override
public BuildScheduler getBuildScheduler() {
return localBuildScheduler;
}
};
BuildCoordinator coordinator = new DefaultBuildCoordinator(datastoreAdapter, buildStatusChangedEventNotifier, buildSetStatusChangedEventNotifier, buildSchedulerFactory, queue, systemConfig, groupBuildMapper, buildMapper);
localBuildScheduler.setBuildCoordinator(coordinator);
coordinator.start();
queue.initSemaphore();
return new BuildCoordinatorBeans(queue, coordinator);
}
Aggregations