javax.cache.spi
Interface CachingProvider


public interface CachingProvider

Interface that should be implemented by a CacheManager factory provider. It is invoked by the Caching class to create a CacheManager

An implementation of this interface must have a public no-arg constructor.

Since:
1.0
Author:
Yannis Cosmadopoulos
See Also:
Caching

Method Summary
 CacheManager createCacheManager(ClassLoader classLoader, String name)
          Called by the Caching class when a new CacheManager needs to be created.
 ClassLoader getDefaultClassLoader()
          Called by the Caching class when a new CacheManager needs to be created and the ClassLoader is not specified.
 boolean isSupported(OptionalFeature optionalFeature)
          Indicates whether a optional feature is supported by this implementation
 

Method Detail

createCacheManager

CacheManager createCacheManager(ClassLoader classLoader,
                                String name)
Called by the Caching class when a new CacheManager needs to be created.

The name may be used to associate a configuration with this CacheManager instance.

Parameters:
classLoader - the ClassLoader that should be used in converting values into Java Objects.
name - the name of this cache manager
Returns:
a new cache manager.
Throws:
NullPointerException - if classLoader or name is null
See Also:
Caching.getCacheManager(ClassLoader, String)

getDefaultClassLoader

ClassLoader getDefaultClassLoader()
Called by the Caching class when a new CacheManager needs to be created and the ClassLoader is not specified.

Possible strategies include the following:

     Thread.currentThread().getContextClassLoader();
     getClass().getClassLoader();
     todo decide which one

Returns:
the default ClassLoader. This will never be null.
See Also:
Caching.getCacheManager()

isSupported

boolean isSupported(OptionalFeature optionalFeature)
Indicates whether a optional feature is supported by this implementation

Parameters:
optionalFeature - the feature to check for
Returns:
true if the feature is supported


Copyright © 2011. All Rights Reserved.