com.peterphi.std.guice.hibernatetest.DbunitGuiceRole Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of stdlib-guice-hibernate-testing Show documentation
Show all versions of stdlib-guice-hibernate-testing Show documentation
module to support testing of hibernate databases
package com.peterphi.std.guice.hibernatetest;
import com.codahale.metrics.MetricRegistry;
import com.google.inject.Injector;
import com.google.inject.Module;
import com.google.inject.Stage;
import com.peterphi.std.guice.apploader.GuiceProperties;
import com.peterphi.std.guice.apploader.GuiceRole;
import com.peterphi.std.guice.apploader.GuiceSetup;
import com.peterphi.std.guice.common.ClassScannerFactory;
import com.peterphi.std.guice.common.serviceprops.composite.GuiceConfig;
import com.peterphi.std.io.PropertyFile;
import java.util.List;
import java.util.concurrent.atomic.AtomicReference;
public class DbunitGuiceRole implements GuiceRole
{
@Override
public void adjustConfigurations(final List configs)
{
}
@Override
public void register(final Stage stage,
final ClassScannerFactory scanner,
final GuiceConfig config,
final GuiceSetup setup,
final List modules,
final AtomicReference injectorRef,
final MetricRegistry metrics)
{
if (config.getBoolean(GuiceProperties.ROLE_DBUNIT_AUTO, true))
{
modules.add(new DbunitModule());
}
}
@Override
public void injectorCreated(final Stage stage,
final ClassScannerFactory scanner,
final GuiceConfig config,
final GuiceSetup setup,
final List modules,
final AtomicReference injectorRef,
final MetricRegistry metrics)
{
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy