public static class Caching.CachingProviderRegistry extends Object
CachingProviders scoped by
ClassLoader.| 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
fully qualified class name using the getDefaultClassLoader(). |
CachingProvider |
getCachingProvider(String fullyQualifiedClassName,
ClassLoader classLoader)
Obtain the
CachingProvider that is implemented by the specified
fully qualified 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
fully qualified class name using the provided ClassLoader |
void |
setDefaultClassLoader(ClassLoader classLoader)
Set the
ClassLoader to use for API methods that don't explicitly
require a ClassLoader, but internally use one. |
public Caching.CachingProviderRegistry()
public ClassLoader getDefaultClassLoader()
ClassLoader to use for API methods that don't
explicitly require a ClassLoader but internally require one.
By default this is the Thread.getContextClassLoader().ClassLoaderpublic void setDefaultClassLoader(ClassLoader classLoader)
ClassLoader to use for API methods that don't explicitly
require a ClassLoader, but internally use one.classLoader - the ClassLoader or null if the
calling Thread.getContextClassLoader() should
be usedpublic CachingProvider getCachingProvider()
CachingProvider defined by the
getDefaultClassLoader().
Should zero or more than one CachingProviders be available, a
CacheException is thrown.CachingProviderCacheException - should zero or more than one
CachingProvider be available
or a CachingProvider could not be loadedgetCachingProvider(ClassLoader),
getCachingProviders(ClassLoader)public CachingProvider getCachingProvider(ClassLoader classLoader)
CachingProvider defined by the specified
ClassLoader.
Should zero or more than one CachingProviders be available, a
CacheException is thrown.classLoader - the ClassLoader to use for loading the
CachingProviderCachingProviderCacheException - should zero or more than one
CachingProvider be available
or a CachingProvider could not be loadedgetCachingProviders(ClassLoader)public Iterable<CachingProvider> getCachingProviders()
CachingProviders that are available via the
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.Iterable of CachingProviders loaded by the
default ClassLoaderpublic Iterable<CachingProvider> getCachingProviders(ClassLoader classLoader)
CachingProviders that are available via the specified
ClassLoader.
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 specified
ClassLoader (and those explicitly requested via
getCachingProvider(String, ClassLoader)) are returned.classLoader - the ClassLoader of the returned
CachingProvidersIterable of CachingProviders loaded by the
specified ClassLoaderpublic CachingProvider getCachingProvider(String fullyQualifiedClassName)
CachingProvider that is implemented by the specified
fully qualified class name using the 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
CachingProviderCachingProviderCacheException - when the CachingProvider can't be createdprotected CachingProvider loadCachingProvider(String fullyQualifiedClassName, ClassLoader classLoader) throws CacheException
CachingProvider with the specified
fully qualified class name using the provided ClassLoaderfullyQualifiedClassName - the name of the CachingProvider classclassLoader - the ClassLoader to useCachingProvider instanceCacheException - if the specified CachingProvider could not be loaded
or the specified class is not a CachingProviderpublic CachingProvider getCachingProvider(String fullyQualifiedClassName, ClassLoader classLoader)
CachingProvider that is implemented by the specified
fully qualified class name using the provided ClassLoader.
Should this CachingProvider already be loaded it is returned,
otherwise an attempt will be made to load and instantiate the specified
class (using a no-args constructor).fullyQualifiedClassName - the fully qualified class name of the
CachingProviderclassLoader - the ClassLoader to load the
CachingProviderCachingProviderCacheException - when the CachingProvider can't be createdCopyright © 2013. All Rights Reserved.