Constructor and Description |
---|
Caching.CachingProviderRegistry()
Constructs a CachingProviderManager.
|
Modifier and Type | Method and Description |
---|---|
CachingProvider |
getCachingProvider()
Obtains the only CachingProvider defined by the
getDefaultClassLoader() . |
CachingProvider |
getCachingProvider(ClassLoader classLoader)
Obtains the only CachingProvider defined by the specified ClassLoader.
|
CachingProvider |
getCachingProvider(String fullyQualifiedClassName)
Obtain the CachingProvider that is implemented by the specified class
name using the
getDefaultClassLoader() . |
CachingProvider |
getCachingProvider(String fullyQualifiedClassName,
ClassLoader classLoader)
Obtain the CachingProvider that is implemented by the specified class
name using the provided ClassLoader.
|
Iterable<CachingProvider> |
getCachingProviders()
Obtain the CachingProviders that are available via the
getDefaultClassLoader() . |
Iterable<CachingProvider> |
getCachingProviders(ClassLoader classLoader)
Obtain the CachingProviders that are available via the specified ClassLoader.
|
ClassLoader |
getDefaultClassLoader()
Obtains the ClassLoader to use for API methods that don't explicitly require
a ClassLoader but internally require one.
|
protected CachingProvider |
loadCachingProvider(String fullyQualifiedClassName,
ClassLoader classLoader)
Load and instantiate the CachingProvider with the specified class name using the provided ClassLoader
|
public Caching.CachingProviderRegistry()
public ClassLoader getDefaultClassLoader()
Thread.getContextClassLoader()
.public CachingProvider getCachingProvider()
getDefaultClassLoader()
.
Should zero or more than one CachingProviders be available, a CacheException is
thrown.CacheException
- should zero or more than one CachingProvider be available
or a CachingProvider could not be loadedgetCachingProvider(ClassLoader)
,
getCachingProviders(ClassLoader)
public CachingProvider getCachingProvider(ClassLoader classLoader)
classLoader
- the ClassLoader to use for loading the CachingProviderCacheException
- should zero or more than one CachingProvider be available
or a CachingProvider could not be loadedgetCachingProviders(ClassLoader)
public Iterable<CachingProvider> getCachingProviders()
getDefaultClassLoader()
.
If a javax.cache.cachingprovider
system property is defined,
only that CachingProvider specified by that property is returned.
Otherwise all CachingProviders that are available via a ServiceLoader
for CachingProviders using the default ClassLoader (and those explicitly
requested via getCachingProvider(String)
) are returned.public Iterable<CachingProvider> getCachingProviders(ClassLoader classLoader)
javax.cache.cachingprovider
system property is defined,
only that CachingProvider specified by that property is returned.
Otherwise all CachingProviders that are available via a ServiceLoader
for CachingProviders using the specified ClassLoader (and those explicitly
requested via getCachingProvider(String, ClassLoader)
) are
returned.classLoader
- the ClassLoader of the returned CachingProviderspublic CachingProvider getCachingProvider(String fullyQualifiedClassName)
getDefaultClassLoader()
. Should this CachingProvider
already be loaded it is simply returned, otherwise an attempt will be
made to load and instantiate the specified class name (using a no-args constructor).fullyQualifiedClassName
- the fully qualified class name of the CachingProviderCacheException
- when the CachingProvider can't be createdprotected CachingProvider loadCachingProvider(String fullyQualifiedClassName, ClassLoader classLoader) throws CacheException
fullyQualifiedClassName
- the name of the CachingProvider classclassLoader
- the ClassLoader to useCacheException
- if the specified CachingProvider could not be loaded
or the specified class is not a CachingProviderpublic CachingProvider getCachingProvider(String fullyQualifiedClassName, ClassLoader classLoader)
fullyQualifiedClassName
- the fully qualified class name of the CachingProviderclassLoader
- the ClassLoader to load the CachingProviderCacheException
- when the CachingProvider can't be createdCopyright © 2013. All Rights Reserved.