@Override public RegionFactory initiateService(Map configurationValues, ServiceRegistryImplementor registry) { final RegionFactory regionFactory = resolveRegionFactory( configurationValues, registry ); LOG.debugf( "Cache region factory : %s", regionFactory.getClass().getName() ); return regionFactory; }
final RegionFactory fallback = getFallback( configurationValues, registry ); if ( fallback != null ) { return fallback;
@Override @SuppressWarnings( { "unchecked" }) public RegionFactory initiateService(Map configurationValues, ServiceRegistryImplementor registry) { final Object impl = configurationValues.get( IMPL_NAME ); if ( impl == null ) { return new NoCachingRegionFactory(); } if ( getServiceInitiated().isInstance( impl ) ) { return (RegionFactory) impl; } Class<? extends RegionFactory> customImplClass = null; if ( Class.class.isInstance( impl ) ) { customImplClass = (Class<? extends RegionFactory>) impl; } else { customImplClass = registry.getService( ClassLoaderService.class ) .classForName( mapLegacyNames( impl.toString() ) ); } try { return customImplClass.newInstance(); } catch ( Exception e ) { throw new ServiceException( "Could not initialize custom RegionFactory impl [" + customImplClass.getName() + "]", e ); } }
public static RegionFactory createRegionFactory(Properties properties, boolean cachingEnabled) { String regionFactoryClassName = RegionFactoryInitiator.mapLegacyNames( ConfigurationHelper.getString( Environment.CACHE_REGION_FACTORY, properties, null
@Override @SuppressWarnings( { "unchecked" }) public RegionFactory initiateService(Map configurationValues, ServiceRegistryImplementor registry) { final Object impl = configurationValues.get( IMPL_NAME ); if ( impl == null ) { return new NoCachingRegionFactory(); } if ( getServiceInitiated().isInstance( impl ) ) { return (RegionFactory) impl; } Class<? extends RegionFactory> customImplClass = null; if ( Class.class.isInstance( impl ) ) { customImplClass = (Class<? extends RegionFactory>) impl; } else { customImplClass = registry.getService( ClassLoaderService.class ) .classForName( mapLegacyNames( impl.toString() ) ); } try { return customImplClass.newInstance(); } catch ( Exception e ) { throw new ServiceException( "Could not initialize custom RegionFactory impl [" + customImplClass.getName() + "]", e ); } }
public static RegionFactory createRegionFactory(Properties properties, boolean cachingEnabled) { String regionFactoryClassName = RegionFactoryInitiator.mapLegacyNames( ConfigurationHelper.getString( Environment.CACHE_REGION_FACTORY, properties, null
@Override protected RegionFactory resolveRegionFactory(Map configurationValues, ServiceRegistryImplementor registry) { final Object useSecondLevelCache = configurationValues.get(USE_SECOND_LEVEL_CACHE); final String jpaSharedCodeModeValue = configurationValues.get(JPA_SHARED_CACHE_MODE) != null ? configurationValues.get(JPA_SHARED_CACHE_MODE).toString() : UNSPECIFIED; final Object regionFactory = configurationValues.get(HIBERNATE_REGION_FACTORY_CLASS); // treat Hibernate 2lc as off, if not specified. // Note that Hibernate 2lc in 5.1.x, defaults to disabled, so this code is only needed in 5.3.x+. if(Boolean.parseBoolean((String)useSecondLevelCache)) { JPA_LOGGER.tracef("WildFlyCustomRegionFactoryInitiator#resolveRegionFactory using %s for 2lc, useSecondLevelCache=%s, jpaSharedCodeModeValue=%s, regionFactory=%s", V53_INFINISPAN_REGION_FACTORY, useSecondLevelCache,jpaSharedCodeModeValue, regionFactory); configurationValues.put(HIBERNATE_REGION_FACTORY_CLASS, V53_INFINISPAN_REGION_FACTORY); return super.resolveRegionFactory(configurationValues, registry); } else if(UNSPECIFIED.equals(jpaSharedCodeModeValue) || NONE.equals(jpaSharedCodeModeValue)) { // explicitly disable 2lc cache JPA_LOGGER.tracef("WildFlyCustomRegionFactoryInitiator#resolveRegionFactory not using a 2lc, useSecondLevelCache=%s, jpaSharedCodeModeValue=%s, regionFactory=%s", useSecondLevelCache,jpaSharedCodeModeValue, regionFactory); return NoCachingRegionFactory.INSTANCE; } else { JPA_LOGGER.tracef("WildFlyCustomRegionFactoryInitiator#resolveRegionFactory using %s for 2lc, useSecondLevelCache=%s, jpaSharedCodeModeValue=%s, regionFactory=%s", V53_INFINISPAN_REGION_FACTORY, useSecondLevelCache,jpaSharedCodeModeValue, regionFactory); configurationValues.put(HIBERNATE_REGION_FACTORY_CLASS, V53_INFINISPAN_REGION_FACTORY); return super.resolveRegionFactory(configurationValues, registry); } } }
private static RegionFactory createRegionFactory(Properties properties, boolean cachingEnabled, ServiceRegistry serviceRegistry) { String regionFactoryClassName = RegionFactoryInitiator.mapLegacyNames( ConfigurationHelper.getString( Environment.CACHE_REGION_FACTORY, properties, null
final RegionFactory fallback = getFallback( configurationValues, registry ); if ( fallback != null ) { return fallback;
@Override public RegionFactory initiateService(Map configurationValues, ServiceRegistryImplementor registry) { final RegionFactory regionFactory = resolveRegionFactory( configurationValues, registry ); LOG.debugf( "Cache region factory : %s", regionFactory.getClass().getName() ); return regionFactory; }
private static RegionFactory createRegionFactory(Properties properties, boolean cachingEnabled, ServiceRegistry serviceRegistry) { String regionFactoryClassName = RegionFactoryInitiator.mapLegacyNames( ConfigurationHelper.getString( Environment.CACHE_REGION_FACTORY, properties, null
@Override protected RegionFactory resolveRegionFactory(Map configurationValues, ServiceRegistryImplementor registry) { final Object useSecondLevelCache = configurationValues.get(USE_SECOND_LEVEL_CACHE); final String jpaSharedCodeModeValue = configurationValues.get(JPA_SHARED_CACHE_MODE) != null ? configurationValues.get(JPA_SHARED_CACHE_MODE).toString() : UNSPECIFIED; // treat Hibernate 2lc as off, if not specified. // Note that Hibernate 2lc in 5.1.x, defaults to disabled, so this code is only needed in 5.3.x+. if(Boolean.parseBoolean((String)useSecondLevelCache)) { configurationValues.put(HIBERNATE_REGION_FACTORY_CLASS, V53_INFINISPAN_REGION_FACTORY); return super.resolveRegionFactory(configurationValues, registry); } else if(UNSPECIFIED.equals(jpaSharedCodeModeValue) || NONE.equals(jpaSharedCodeModeValue)) { // explicitly disable 2lc cache return NoCachingRegionFactory.INSTANCE; } else { configurationValues.put(HIBERNATE_REGION_FACTORY_CLASS, V53_INFINISPAN_REGION_FACTORY); return super.resolveRegionFactory(configurationValues, registry); } } }