@Override protected boolean isStarted() { return super.isStarted() && cacheManager != null; }
@Override public DomainDataRegion buildDomainDataRegion( DomainDataRegionConfig regionConfig, DomainDataRegionBuildingContext buildingContext) { verifyStarted(); return new DomainDataRegionTemplate( regionConfig, this, createDomainDataStorageAccess( regionConfig, buildingContext ), getImplicitCacheKeysFactory(), buildingContext ); }
@Override public QueryResultsRegion buildQueryResultsRegion( String regionName, SessionFactoryImplementor sessionFactory) { verifyStarted(); return new QueryResultsRegionTemplate( regionName, this, createQueryResultsRegionStorageAccess( regionName, sessionFactory ) ); }
@Override public TimestampsRegion buildTimestampsRegion( String regionName, SessionFactoryImplementor sessionFactory) { verifyStarted(); return new TimestampsRegionTemplate( regionName, this, createTimestampsRegionStorageAccess( regionName, sessionFactory ) ); }
@Override protected void prepareForUse(SessionFactoryOptions settings, Map configValues) { synchronized ( this ) { this.cacheManager = resolveCacheManager( settings, configValues ); if ( this.cacheManager == null ) { throw new CacheException( "Could not start Ehcache CacheManager" ); } this.missingCacheStrategy = MissingCacheStrategy.interpretSetting( configValues.get( ConfigSettings.MISSING_CACHE_STRATEGY ) ); Object cacheLockTimeoutConfigValue = configValues.get( ConfigSettings.EHCACHE_CONFIGURATION_CACHE_LOCK_TIMEOUT ); if ( cacheLockTimeoutConfigValue != null ) { Integer lockTimeoutInMillis = null; if ( cacheLockTimeoutConfigValue instanceof String ) { lockTimeoutInMillis = Integer.decode( (String) cacheLockTimeoutConfigValue ); } else if ( cacheLockTimeoutConfigValue instanceof Number ) { lockTimeoutInMillis = ( (Number) cacheLockTimeoutConfigValue ).intValue(); } if ( lockTimeoutInMillis != null ) { this.cacheLockTimeout = SimpleTimestamper.ONE_MS * lockTimeoutInMillis; } else { this.cacheLockTimeout = super.getTimeout(); } } } }
@Override public TimestampsRegion buildTimestampsRegion( String regionName, SessionFactoryImplementor sessionFactory) { verifyStarted(); return new TimestampsRegionTemplate( regionName, this, createTimestampsRegionStorageAccess( regionName, sessionFactory ) ); }
@Override protected void prepareForUse(SessionFactoryOptions settings, Map configValues) { synchronized ( this ) { this.cacheManager = resolveCacheManager( settings, configValues ); if ( this.cacheManager == null ) { throw new CacheException( "Could not start Ehcache CacheManager" ); } this.missingCacheStrategy = MissingCacheStrategy.interpretSetting( configValues.get( ConfigSettings.MISSING_CACHE_STRATEGY ) ); Object cacheLockTimeoutConfigValue = configValues.get( ConfigSettings.EHCACHE_CONFIGURATION_CACHE_LOCK_TIMEOUT ); if ( cacheLockTimeoutConfigValue != null ) { Integer lockTimeoutInMillis = null; if ( cacheLockTimeoutConfigValue instanceof String ) { lockTimeoutInMillis = Integer.decode( (String) cacheLockTimeoutConfigValue ); } else if ( cacheLockTimeoutConfigValue instanceof Number ) { lockTimeoutInMillis = ( (Number) cacheLockTimeoutConfigValue ).intValue(); } if ( lockTimeoutInMillis != null ) { this.cacheLockTimeout = SimpleTimestamper.ONE_MS * lockTimeoutInMillis; } else { this.cacheLockTimeout = super.getTimeout(); } } } }
@Override protected boolean isStarted() { return super.isStarted() && cacheManager != null; }
@Override public DomainDataRegion buildDomainDataRegion( DomainDataRegionConfig regionConfig, DomainDataRegionBuildingContext buildingContext) { verifyStarted(); return new DomainDataRegionTemplate( regionConfig, this, createDomainDataStorageAccess( regionConfig, buildingContext ), getImplicitCacheKeysFactory(), buildingContext ); }
@Override public QueryResultsRegion buildQueryResultsRegion( String regionName, SessionFactoryImplementor sessionFactory) { verifyStarted(); return new QueryResultsRegionTemplate( regionName, this, createQueryResultsRegionStorageAccess( regionName, sessionFactory ) ); }
/** * Load a resource from the classpath. */ protected URL loadResource(String configurationResourceName) { // we use this method to create the cache manager so we can't check it is non null // calling the super method then if ( ! super.isStarted() ) { throw new IllegalStateException( "Cannot load resource through a non-started EhcacheRegionFactory" ); } return loadResource( configurationResourceName, getOptions() ); }
protected boolean isStarted() { return super.isStarted() && null != redisClient; }
protected boolean isStarted() { return super.isStarted() && null != redisClient; }
@Override protected boolean isStarted() { return super.isStarted() && cacheManager != null; }
@Override protected boolean isStarted() { return super.isStarted() && cacheManager != null; }
/** * Load a resource from the classpath. */ protected URL loadResource(String configurationResourceName) { // we use this method to create the cache manager so we can't check it is non null // calling the super method then if ( ! super.isStarted() ) { throw new IllegalStateException( "Cannot load resource through a non-started EhcacheRegionFactory" ); } return loadResource( configurationResourceName, getOptions() ); }