Polishing
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2013 the original author or authors.
|
||||
* Copyright 2002-2014 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -45,7 +45,7 @@ import org.springframework.core.io.Resource;
|
||||
* also necessary for loading EhCache configuration from a non-default config location.
|
||||
*
|
||||
* <p>Note: As of Spring 4.0, Spring's EhCache support requires EhCache 2.1 or higher.
|
||||
* We recommend the use of EhCache 2.5 or higher.
|
||||
* We strongly recommend the use of EhCache 2.5 or higher.
|
||||
*
|
||||
* @author Juergen Hoeller
|
||||
* @author Dmitriy Kopylenko
|
||||
@@ -132,7 +132,7 @@ public class EhCacheManagerFactoryBean implements FactoryBean<CacheManager>, Ini
|
||||
|
||||
|
||||
@Override
|
||||
public void afterPropertiesSet() throws IOException, CacheException {
|
||||
public void afterPropertiesSet() throws CacheException, IOException {
|
||||
logger.info("Initializing EhCache CacheManager");
|
||||
InputStream is = (this.configLocation != null ? this.configLocation.getInputStream() : null);
|
||||
try {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2013 the original author or authors.
|
||||
* Copyright 2002-2014 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -20,7 +20,6 @@ import java.net.URI;
|
||||
import java.util.Properties;
|
||||
import javax.cache.CacheManager;
|
||||
import javax.cache.Caching;
|
||||
import javax.cache.spi.CachingProvider;
|
||||
|
||||
import org.springframework.beans.factory.BeanClassLoaderAware;
|
||||
import org.springframework.beans.factory.DisposableBean;
|
||||
@@ -75,8 +74,7 @@ public class JCacheManagerFactoryBean
|
||||
|
||||
@Override
|
||||
public void afterPropertiesSet() {
|
||||
CachingProvider provider = Caching.getCachingProvider();
|
||||
this.cacheManager = provider.getCacheManager(
|
||||
this.cacheManager = Caching.getCachingProvider().getCacheManager(
|
||||
this.cacheManagerUri, this.beanClassLoader, this.cacheManagerProperties);
|
||||
}
|
||||
|
||||
|
||||
@@ -155,7 +155,7 @@ public abstract class SchedulerAccessor implements ResourceLoaderAware {
|
||||
*/
|
||||
public void setJobDetails(JobDetail... jobDetails) {
|
||||
// Use modifiable ArrayList here, to allow for further adding of
|
||||
// JobDetail objects during autodetection of JobDetailAwareTriggers.
|
||||
// JobDetail objects during autodetection of JobDetail-aware Triggers.
|
||||
this.jobDetails = new ArrayList<JobDetail>(Arrays.asList(jobDetails));
|
||||
}
|
||||
|
||||
|
||||
@@ -476,7 +476,6 @@ public class SchedulerFactoryBean extends SchedulerAccessor implements FactoryBe
|
||||
configTimeNonTransactionalDataSourceHolder.set(this.nonTransactionalDataSource);
|
||||
}
|
||||
|
||||
|
||||
// Get Scheduler instance from SchedulerFactory.
|
||||
try {
|
||||
this.scheduler = createScheduler(schedulerFactory, this.schedulerName);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2013 the original author or authors.
|
||||
* Copyright 2002-2014 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -46,12 +46,11 @@ public abstract class AbstractCacheManager implements CacheManager, Initializing
|
||||
public void afterPropertiesSet() {
|
||||
Collection<? extends Cache> caches = loadCaches();
|
||||
|
||||
// preserve the initial order of the cache names
|
||||
// Preserve the initial order of the cache names
|
||||
this.cacheMap.clear();
|
||||
this.cacheNames.clear();
|
||||
for (Cache cache : caches) {
|
||||
this.cacheMap.put(cache.getName(), decorateCache(cache));
|
||||
this.cacheNames.add(cache.getName());
|
||||
addCache(cache);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -83,8 +82,9 @@ public abstract class AbstractCacheManager implements CacheManager, Initializing
|
||||
|
||||
|
||||
/**
|
||||
* Load the caches for this cache manager. Occurs at startup.
|
||||
* The returned collection must not be null.
|
||||
* Load the initial caches for this cache manager.
|
||||
* <p>Called by {@link #afterPropertiesSet()} on startup.
|
||||
* The returned collection may be empty but must not be {@code null}.
|
||||
*/
|
||||
protected abstract Collection<? extends Cache> loadCaches();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user