io.github.factoryfx.copperbridge.db.OracleDataSourceFactory Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of copperBridge Show documentation
Show all versions of copperBridge Show documentation
factoryfx dependency injection framework
package io.github.factoryfx.copperbridge.db;
import java.util.List;
import javax.sql.DataSource;
import io.github.factoryfx.factory.attribute.dependency.FactoryAttribute;
import io.github.factoryfx.factory.attribute.primitive.BooleanAttribute;
import io.github.factoryfx.factory.FactoryBase;
import org.copperengine.core.EngineIdProvider;
import org.copperengine.core.persistent.OracleDialect;
import org.copperengine.ext.wfrepo.classpath.ClasspathWorkflowRepository;
import io.github.factoryfx.copperbridge.DBDialect;
import io.github.factoryfx.copperbridge.EngineIdProviderFactory;
public abstract class OracleDataSourceFactory> extends FactoryBase {
public final BooleanAttribute multiEngineMode = new BooleanAttribute().labelText("MultiEngineMode");
public final FactoryAttribute> engineIdProviderFactory = new FactoryAttribute>().labelText("EngineId provider");
public abstract DataSource getDataSource();
public abstract List getWorkflowClassPaths();
public OracleDataSourceFactory() {
configLifeCycle().setCreator(() -> {
OracleDialect dOra = new OracleDialect();
ClasspathWorkflowRepository wfRepository = new ClasspathWorkflowRepository(getWorkflowClassPaths());
dOra.setWfRepository(wfRepository);
dOra.setEngineIdProvider(engineIdProviderFactory.instance());
dOra.setMultiEngineMode(multiEngineMode.get());
return new DBDialect(getDataSource(), wfRepository, dOra);
});
}
}