package org.bench4q.master.domain.valueobject.transaction;

import org.bench4q.master.domain.RunningScriptInterface;
import org.bench4q.master.domain.valueobject.transaction.impl.ScriptLoadApplication;
import org.bench4q.master.domain.valueobject.transaction.impl.TestPlanDistribute;
import org.bench4q.master.infrastructure.highavailable.HighAvailablePool;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class TransactionFactory {

	@Autowired
	private HighAvailablePool highAvailablePool;

	public Transaction buildScriptTransaction(
			RunningScriptInterface runningScript, int requiredLoad) {
		ScriptLoadApplication result = new ScriptLoadApplication(runningScript,
				requiredLoad, this.highAvailablePool);
		return result;
	}

	public Transaction buildTestPlanTransaction() {
		return new TestPlanDistribute();
	}
}
