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

io.vlingo.xoom.data.JdbcJournalProvider Maven / Gradle / Ivy

Go to download

The easiest way to jump start your data and storage use with vlingo/xoom and the greater vlingo/PLATFORM.

There is a newer version: 1.3.0
Show newest version
package io.vlingo.xoom.data;

import io.micronaut.context.annotation.Requires;
import io.vlingo.symbio.store.journal.Journal;
import io.vlingo.symbio.store.journal.jdbc.JDBCJournalActor;
import io.vlingo.xoom.server.VlingoScene;

import javax.inject.Singleton;
import javax.sql.DataSource;

@Singleton
@Requires(beans = DataSource.class)
public class JdbcJournalProvider {
    private Journal journal;
    private final VlingoScene scene;
    private final SymbioJdbcDatabaseProvider databaseProvider;

    public JdbcJournalProvider(VlingoScene scene, SymbioJdbcDatabaseProvider databaseProvider) {
        this.scene = scene;
        this.databaseProvider = databaseProvider;
        scene.start();
        journal = Journal.using(scene.getWorld().stage(), JDBCJournalActor.class, new BasicDispatcher(),
                databaseProvider.getJdbcStorageConfiguration());
    }

    public Journal getJournal() {
        return journal;
    }

    public VlingoScene getScene() {
        return scene;
    }

    public SymbioJdbcDatabaseProvider getDatabaseProvider() {
        return databaseProvider;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy