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

org.hibernate.cache.jcache.internal.StrategyRegistrationProviderImpl Maven / Gradle / Ivy

There is a newer version: 7.0.0.Beta2
Show newest version
/*
 * SPDX-License-Identifier: LGPL-2.1-or-later
 * Copyright Red Hat Inc. and Hibernate Authors
 */
package org.hibernate.cache.jcache.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.cache.jcache.ConfigSettings;
import org.hibernate.cache.spi.RegionFactory;

/**
 * Makes the JCache RegionFactory available to the Hibernate
 * {@link org.hibernate.boot.registry.selector.spi.StrategySelector} service
 * under a number of keys.  Prefer to use
 *
 * @author Steve Ebersole
 */
public final class StrategyRegistrationProviderImpl implements StrategyRegistrationProvider {

	@Override
	@SuppressWarnings("unchecked")
	public Iterable getStrategyRegistrations() {
		final SimpleStrategyRegistrationImpl simpleStrategyRegistration = new SimpleStrategyRegistrationImpl(
				RegionFactory.class,
				JCacheRegionFactory.class,
				ConfigSettings.SIMPLE_FACTORY_NAME,
				JCacheRegionFactory.class.getName(),
				JCacheRegionFactory.class.getSimpleName(),
				// legacy impl class name
				"org.hibernate.cache.jcache.JCacheRegionFactory"
		);

		return Collections.singleton( simpleStrategyRegistration );
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy