Exemplo n.º 1
0
 /**
  * Obtain the {@link CachingProvider} that is implemented by the specified fully qualified class
  * name using the provided {@link ClassLoader}. Should this {@link 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).
  *
  * @param fullyQualifiedClassName the fully qualified class name of the {@link CachingProvider}
  * @param classLoader the {@link ClassLoader} to load the {@link CachingProvider}
  * @return the {@link CachingProvider}
  * @throws CacheException if the {@link CachingProvider} cannot be created
  * @throws SecurityException when the operation could not be performed due to the current security
  *     settings
  */
 public static CachingProvider getCachingProvider(
     String fullyQualifiedClassName, ClassLoader classLoader) {
   return CACHING_PROVIDERS.getCachingProvider(fullyQualifiedClassName, classLoader);
 }
Exemplo n.º 2
0
 /**
  * Obtains the {@link ClassLoader} to use for API methods that don't explicitly require a {@link
  * ClassLoader} but internally require one.
  *
  * <p>By default this is the {@link Thread#getContextClassLoader()}.
  *
  * @return the default {@link ClassLoader}
  */
 public static ClassLoader getDefaultClassLoader() {
   return CACHING_PROVIDERS.getDefaultClassLoader();
 }
Exemplo n.º 3
0
 /**
  * Obtains the {@link CachingProvider}s that are available via the specified {@link ClassLoader}.
  *
  * <p>If a <code>javax.cache.spi.cachingprovider</code> system property is defined, only that
  * {@link CachingProvider} specified by that property is returned. Otherwise all {@link
  * CachingProvider}s that are available via a {@link ServiceLoader} for {@link CachingProvider}s
  * using the specified {@link ClassLoader} (including those previously requested via {@link
  * #getCachingProvider(String, ClassLoader)}) are returned.
  *
  * @param classLoader the {@link ClassLoader} of the returned {@link CachingProvider}s
  * @return an {@link Iterable} of {@link CachingProvider}s loaded by the specified {@link
  *     ClassLoader}
  */
 public static Iterable<CachingProvider> getCachingProviders(ClassLoader classLoader) {
   return CACHING_PROVIDERS.getCachingProviders(classLoader);
 }
Exemplo n.º 4
0
 /**
  * Obtains the {@link CachingProvider}s that are available via the {@link
  * #getDefaultClassLoader()}.
  *
  * <p>If a <code>javax.cache.spi.cachingprovider</code> system property is defined, only that
  * {@link CachingProvider} specified by that property is returned. Otherwise all {@link
  * CachingProvider}s that are available via a {@link ServiceLoader} for {@link CachingProvider}s
  * using the default {@link ClassLoader} (including those previously requested via {@link
  * #getCachingProvider(String)}) are returned.
  *
  * @return an {@link Iterable} of {@link CachingProvider}s loaded by the specified {@link
  *     ClassLoader}
  */
 public static Iterable<CachingProvider> getCachingProviders() {
   return CACHING_PROVIDERS.getCachingProviders();
 }
Exemplo n.º 5
0
 /**
  * Obtains the single {@link CachingProvider} visible to the specified {@link ClassLoader}.
  *
  * @param classLoader the {@link ClassLoader} to use for loading the {@link CachingProvider}
  * @return the {@link CachingProvider}
  * @throws CacheException should zero, or more than one {@link CachingProvider} be available on
  *     the classpath, or it could not be loaded
  * @throws SecurityException when the operation could not be performed due to the current security
  *     settings
  * @see #getCachingProviders(ClassLoader)
  */
 public static CachingProvider getCachingProvider(ClassLoader classLoader) {
   return CACHING_PROVIDERS.getCachingProvider(classLoader);
 }
Exemplo n.º 6
0
 /**
  * Obtains the default {@link CachingProvider} available via the {@link #getDefaultClassLoader()}.
  *
  * @return the {@link CachingProvider}
  * @throws CacheException should zero, or more than one {@link CachingProvider} be available on
  *     the classpath, or it could not be loaded
  * @throws SecurityException when the operation could not be performed due to the current security
  *     settings
  */
 public static CachingProvider getCachingProvider() {
   return CACHING_PROVIDERS.getCachingProvider();
 }
Exemplo n.º 7
0
 /**
  * Set the {@link ClassLoader} to use for API methods that don't explicitly require a {@link
  * ClassLoader}, but internally use one.
  *
  * @param classLoader the {@link ClassLoader} or <code>null</code> if the calling {@link
  *     Thread#getContextClassLoader()} should be used
  */
 public static void setDefaultClassLoader(ClassLoader classLoader) {
   CACHING_PROVIDERS.setDefaultClassLoader(classLoader);
 }