HHH-12441 - Deprecate hibernate-ehcache

This commit is contained in:
Steve Ebersole 2018-03-28 14:04:13 -05:00
parent c10dbe9d9c
commit 9ba05c1e6b
4 changed files with 51 additions and 2 deletions

View File

@ -24,9 +24,11 @@ import static org.jboss.logging.Logger.Level.WARN;
@MessageLogger( projectCode = "HHH" )
@ValidIdRange( min = 90000001, max = 90001000 )
public interface DeprecationLogger extends BasicLogger {
String CATEGORY = "org.hibernate.orm.deprecation";
DeprecationLogger DEPRECATION_LOGGER = Logger.getMessageLogger(
DeprecationLogger.class,
"org.hibernate.orm.deprecation"
CATEGORY
);
/**

View File

@ -0,0 +1,44 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* License: GNU Lesser General Public License (LGPL), version 2.1 or later
* See the lgpl.txt file in the root directory or http://www.gnu.org/licenses/lgpl-2.1.html
*/
package org.hibernate.cache.ehcache.internal;
import org.jboss.logging.BasicLogger;
import org.jboss.logging.Logger;
import org.jboss.logging.annotations.LogMessage;
import org.jboss.logging.annotations.Message;
import org.jboss.logging.annotations.MessageLogger;
import org.jboss.logging.annotations.ValidIdRange;
import static org.hibernate.internal.log.DeprecationLogger.CATEGORY;
import static org.jboss.logging.Logger.Level.WARN;
/**
* @author Steve Ebersole
*/
@MessageLogger(projectCode = "HHH")
@ValidIdRange( min = 20100, max = 20100)
public interface DeprecationLogger extends BasicLogger {
/**
* Singleton access
*/
DeprecationLogger INSTANCE = Logger.getMessageLogger(
DeprecationLogger.class,
CATEGORY
);
/**
* Log a message (WARN) about this provider being deprecated
*/
@LogMessage(level = WARN)
@Message(
value = "The Ehcache second-level cache provider for Hibernate is deprecated. " +
"See https://hibernate.atlassian.net/browse/HHH-12441 for details.",
id = 20100
)
void logDeprecation();
}

View File

@ -13,16 +13,18 @@ import org.jboss.logging.Logger;
import org.jboss.logging.annotations.LogMessage;
import org.jboss.logging.annotations.Message;
import org.jboss.logging.annotations.MessageLogger;
import org.jboss.logging.annotations.ValidIdRange;
import static org.jboss.logging.Logger.Level.WARN;
/**
* The jboss-logging {@link MessageLogger} for the hibernate-ehcache module. It reserves message ids ranging from
* 20001 to 25000 inclusively.
* 20099 to 20099 (allow 20100 for our DeprecationLogger) inclusively.
* <p/>
* New messages must be added after the last message defined to ensure message codes are unique.
*/
@MessageLogger(projectCode = "HHH")
@ValidIdRange( min = 20001, max = 20099)
public interface EhCacheMessageLogger extends CoreMessageLogger {
EhCacheMessageLogger INSTANCE = Logger.getMessageLogger(
EhCacheMessageLogger.class,

View File

@ -50,6 +50,7 @@ public class EhcacheRegionFactory extends RegionFactoryTemplate {
public EhcacheRegionFactory(CacheKeysFactory cacheKeysFactory) {
this.cacheKeysFactory = cacheKeysFactory;
DeprecationLogger.INSTANCE.logDeprecation();
}
public CacheManager getCacheManager() {