Search in sources :

Example 1 with BuildSchedulerFactory

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);
}
Also used : BuildQueue(org.jboss.pnc.coordinator.builder.BuildQueue) BuildCoordinator(org.jboss.pnc.spi.coordinator.BuildCoordinator) DefaultBuildCoordinator(org.jboss.pnc.coordinator.builder.DefaultBuildCoordinator) SystemConfig(org.jboss.pnc.common.json.moduleconfig.SystemConfig) BuildSchedulerFactory(org.jboss.pnc.coordinator.builder.BuildSchedulerFactory) DatastoreAdapter(org.jboss.pnc.coordinator.builder.datastore.DatastoreAdapter) DefaultBuildCoordinator(org.jboss.pnc.coordinator.builder.DefaultBuildCoordinator)

Aggregations

SystemConfig (org.jboss.pnc.common.json.moduleconfig.SystemConfig)1 BuildQueue (org.jboss.pnc.coordinator.builder.BuildQueue)1 BuildSchedulerFactory (org.jboss.pnc.coordinator.builder.BuildSchedulerFactory)1 DefaultBuildCoordinator (org.jboss.pnc.coordinator.builder.DefaultBuildCoordinator)1 DatastoreAdapter (org.jboss.pnc.coordinator.builder.datastore.DatastoreAdapter)1 BuildCoordinator (org.jboss.pnc.spi.coordinator.BuildCoordinator)1