diff --git a/hibernate-envers/src/main/java/org/hibernate/envers/boot/internal/EnversService.java b/hibernate-envers/src/main/java/org/hibernate/envers/boot/internal/EnversService.java index e722bd650f..55ba23e1be 100644 --- a/hibernate-envers/src/main/java/org/hibernate/envers/boot/internal/EnversService.java +++ b/hibernate-envers/src/main/java/org/hibernate/envers/boot/internal/EnversService.java @@ -34,13 +34,7 @@ public interface EnversService extends Service { * The name of the configuration setting used to control whether the Envers integration * is enabled. Default is true */ - public static final String INTEGRATION_ENABLED = "hibernate.integration.envers.enabled"; - - /** - * The name of the legacy configuration setting used to control whether auto registration - * of envers listeners should happen or not. Default is true - */ - public static final String LEGACY_AUTO_REGISTER = "hibernate.listeners.envers.autoRegister"; + String INTEGRATION_ENABLED = "hibernate.integration.envers.enabled"; /** * Is the Envers integration enabled? This is generally used as a diff --git a/hibernate-envers/src/main/java/org/hibernate/envers/boot/internal/EnversServiceImpl.java b/hibernate-envers/src/main/java/org/hibernate/envers/boot/internal/EnversServiceImpl.java index 54d26e940a..091d319b09 100644 --- a/hibernate-envers/src/main/java/org/hibernate/envers/boot/internal/EnversServiceImpl.java +++ b/hibernate-envers/src/main/java/org/hibernate/envers/boot/internal/EnversServiceImpl.java @@ -50,6 +50,8 @@ import org.jboss.logging.Logger; public class EnversServiceImpl implements EnversService, Configurable, Stoppable { private static final Logger log = Logger.getLogger( EnversServiceImpl.class ); + private static final String LEGACY_AUTO_REGISTER = "hibernate.listeners.envers.autoRegister"; + private boolean integrationEnabled; private boolean initialized; @@ -77,9 +79,15 @@ public class EnversServiceImpl implements EnversService, Configurable, Stoppable @Override public void configure(Map configurationValues) { - final boolean legacySetting = ConfigurationHelper.getBoolean( LEGACY_AUTO_REGISTER, configurationValues, true ); - this.integrationEnabled = ConfigurationHelper.getBoolean( INTEGRATION_ENABLED, configurationValues, legacySetting ); - + if ( configurationValues.containsKey( LEGACY_AUTO_REGISTER ) ) { + log.debugf( + "Encountered deprecated Envers setting [%s]; use [%s] or [%s] instead", + LEGACY_AUTO_REGISTER, + INTEGRATION_ENABLED, + EnversIntegrator.AUTO_REGISTER + ); + } + this.integrationEnabled = ConfigurationHelper.getBoolean( INTEGRATION_ENABLED, configurationValues, true ); log.infof( "Envers integration enabled? : %s", integrationEnabled ); }