All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.codearte.accurest.stubrunner.BatchStubRunnerFactory.groovy Maven / Gradle / Ivy

There is a newer version: 1.1.1
Show newest version
package io.codearte.accurest.stubrunner

import groovy.transform.CompileStatic
import io.codearte.accurest.messaging.AccurestMessaging
import io.codearte.accurest.messaging.noop.NoOpAccurestMessaging

/**
 * Manages lifecycle of multiple {@link StubRunner} instances.
 *
 * @see StubRunner
 * @see BatchStubRunner
 */
@CompileStatic
class BatchStubRunnerFactory {

	private final StubRunnerOptions stubRunnerOptions
	private final StubDownloader stubDownloader
	private final AccurestMessaging accurestMessaging

	BatchStubRunnerFactory(StubRunnerOptions stubRunnerOptions) {
		this(stubRunnerOptions, new AetherStubDownloader(stubRunnerOptions), new NoOpAccurestMessaging())
	}

	BatchStubRunnerFactory(StubRunnerOptions stubRunnerOptions, AccurestMessaging accurestMessaging) {
		this(stubRunnerOptions, new AetherStubDownloader(stubRunnerOptions), accurestMessaging)
	}

	BatchStubRunnerFactory(StubRunnerOptions stubRunnerOptions, StubDownloader stubDownloader) {
		this(stubRunnerOptions, stubDownloader, new NoOpAccurestMessaging())
	}

	BatchStubRunnerFactory(StubRunnerOptions stubRunnerOptions, StubDownloader stubDownloader, AccurestMessaging accurestMessaging) {
		this.stubRunnerOptions = stubRunnerOptions
		this.stubDownloader = stubDownloader
		this.accurestMessaging = accurestMessaging
	}

	BatchStubRunner buildBatchStubRunner() {
		StubRunnerFactory stubRunnerFactory = new StubRunnerFactory(stubRunnerOptions, stubDownloader, accurestMessaging)
		return new BatchStubRunner(stubRunnerFactory.createStubsFromServiceConfiguration())
	}

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy