public class CacheAwareContextLoaderDelegate
extends java.lang.Object
CacheAwareContextLoaderDelegate
loads application contexts from
MergedContextConfiguration
by delegating to the
ContextLoader
configured in the MergedContextConfiguration
and interacting transparently with the ContextCache
behind the scenes.
Note: CacheAwareContextLoaderDelegate
does not implement the
ContextLoader
or SmartContextLoader
interface.
Modifier and Type | Field and Description |
---|---|
private ContextCache |
contextCache |
private static Log |
logger |
private static Log |
statsLogger |
Constructor and Description |
---|
CacheAwareContextLoaderDelegate(ContextCache contextCache) |
Modifier and Type | Method and Description |
---|---|
ApplicationContext |
loadContext(MergedContextConfiguration mergedContextConfiguration)
Load the
application context for the supplied
merged context configuration. |
private ApplicationContext |
loadContextInternal(MergedContextConfiguration mergedContextConfiguration)
Load the
ApplicationContext for the supplied merged context
configuration. |
private static final Log logger
private static final Log statsLogger
private final ContextCache contextCache
CacheAwareContextLoaderDelegate(ContextCache contextCache)
private ApplicationContext loadContextInternal(MergedContextConfiguration mergedContextConfiguration) throws java.lang.Exception
ApplicationContext
for the supplied merged context
configuration. Supports both the SmartContextLoader
and
ContextLoader
SPIs.java.lang.Exception
- if an error occurs while loading the application contextpublic ApplicationContext loadContext(MergedContextConfiguration mergedContextConfiguration)
application context
for the supplied
merged context configuration.
If the context is present in the cache it will simply be returned; otherwise, it will be loaded, stored in the cache, and returned.
java.lang.IllegalStateException
- if an error occurs while retrieving or
loading the application context