-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
HHH-7495 HHH-7492 Move RegionFactory to session factory scope service…
… registry
- Loading branch information
Showing
69 changed files
with
1,172 additions
and
1,130 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51 changes: 51 additions & 0 deletions
51
hibernate-core/src/main/java/org/hibernate/cache/spi/AbstractRegionFactory.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
package org.hibernate.cache.spi; | ||
|
||
import java.util.Properties; | ||
|
||
import org.jboss.logging.Logger; | ||
|
||
import org.hibernate.cache.CacheException; | ||
import org.hibernate.cfg.AvailableSettings; | ||
import org.hibernate.cfg.Settings; | ||
import org.hibernate.cfg.SettingsFactory; | ||
import org.hibernate.internal.CoreMessageLogger; | ||
import org.hibernate.service.config.spi.ConfigurationService; | ||
import org.hibernate.service.config.spi.StandardConverters; | ||
import org.hibernate.service.spi.ServiceRegistryAwareService; | ||
import org.hibernate.service.spi.ServiceRegistryImplementor; | ||
|
||
/** | ||
* @author Strong Liu <stliu@hibernate.org> | ||
*/ | ||
public abstract class AbstractRegionFactory implements RegionFactory, ServiceRegistryAwareService { | ||
private static final CoreMessageLogger LOG = Logger.getMessageLogger( | ||
CoreMessageLogger.class, | ||
AbstractRegionFactory.class.getName() | ||
); | ||
|
||
private ServiceRegistryImplementor serviceRegistry; | ||
private boolean isMinimalPutsEnabled; | ||
|
||
public ServiceRegistryImplementor getServiceRegistry() { | ||
return serviceRegistry; | ||
} | ||
|
||
@Override | ||
public void injectServices(ServiceRegistryImplementor serviceRegistry) { | ||
this.serviceRegistry = serviceRegistry; | ||
this.isMinimalPutsEnabled = serviceRegistry.getService( ConfigurationService.class ).getSetting( AvailableSettings.USE_MINIMAL_PUTS, | ||
StandardConverters.BOOLEAN, isMinimalPutsEnabledByDefault() | ||
); | ||
LOG.debugf( "Optimize cache for minimal puts: %s", SettingsFactory.enabledDisabled( isMinimalPutsEnabled ) ); | ||
} | ||
|
||
@Override | ||
public void start(Settings settings, Properties properties) throws CacheException { | ||
start(); | ||
} | ||
|
||
@Override | ||
public boolean isMinimalPutsEnabled() { | ||
return isMinimalPutsEnabled; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.