Polishing

This commit is contained in:
Juergen Hoeller
2014-08-18 21:25:38 +02:00
parent 5e2b9b6f07
commit f418e6e981
5 changed files with 12 additions and 15 deletions

View File

@@ -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();