org.hibernate.agroal.internal.StrategyRegistrationProviderImpl Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of hibernate-agroal Show documentation
Show all versions of hibernate-agroal Show documentation
Integration for Agroal as a ConnectionProvider for Hibernate ORM
The newest version!
/*
* SPDX-License-Identifier: LGPL-2.1-or-later
* Copyright Red Hat Inc. and Hibernate Authors
*/
package org.hibernate.agroal.internal;
import java.util.Collections;
import org.hibernate.boot.registry.selector.SimpleStrategyRegistrationImpl;
import org.hibernate.boot.registry.selector.StrategyRegistration;
import org.hibernate.boot.registry.selector.StrategyRegistrationProvider;
import org.hibernate.engine.jdbc.connections.spi.ConnectionProvider;
/**
* Provides the {@link AgroalConnectionProvider} to the
* {@link org.hibernate.boot.registry.selector.spi.StrategySelector} service.
*
* @author Luis Barreiro
*/
public final class StrategyRegistrationProviderImpl implements StrategyRegistrationProvider {
@Override
public Iterable getStrategyRegistrations() {
final SimpleStrategyRegistrationImpl strategyRegistration = new SimpleStrategyRegistrationImpl<>(
ConnectionProvider.class,
AgroalConnectionProvider.class,
AgroalConnectionProvider.class.getSimpleName(),
"agroal",
"Agroal",
// for consistency's sake
"org.hibernate.connection.AgroalConnectionProvider"
);
return Collections.singleton( strategyRegistration );
}
}