Top Description Methods
javax.cache.spi

public Interface CachingProvider

extends Closeable
Imports
javax.cache.CacheException, .CacheManager, javax.cache.configuration.OptionalFeature, java.io.Closeable, java.net.URI, java.util.Properties

Provides mechanisms to create, request and later manage the life-cycle of configured CacheManagers, identified by URIs and scoped by ClassLoaders.

The meaning and semantics of the URI used to identify a CacheManager is implementation dependent. For applications to remain implementation independent, they should avoid attempting to create URIs and instead use those returned by getDefaultURI().

Authors
Brian Oliver, Greg Luck
Since
1.0

Method Summary

Modifier and TypeMethod and Description
public void
close()

Redeclares java.io.Closeable.close.

Closes all of the CacheManager instances and associated resources created and maintained by the CachingProvider across all ClassLoaders.
public void
close(ClassLoader
the ClassLoader to release
classLoader
)

Closes all CacheManager instances and associated resources created by the CachingProvider using the specified ClassLoader.

public void
close(URI
the URI to release
uri
,
ClassLoader
the ClassLoader to release
classLoader
)

Closes all CacheManager instances and associated resources created by the CachingProvider for the specified URI and ClassLoader.

public CacheManager
getCacheManager(URI
an implementation specific URI for the CacheManager (null means use getDefaultURI())
uri
,
ClassLoader
the ClassLoader to use for the CacheManager (null means use getDefaultClassLoader())
classLoader
,
Properties
the Properties for the CachingProvider to create the CacheManager (null means no implementation specific Properties are required)
properties
)

Requests a CacheManager configured according to the implementation specific URI be made available that uses the provided ClassLoader for loading underlying classes.

public CacheManager
getCacheManager(URI
an implementation specific URI for the CacheManager (null means use getDefaultURI())
uri
,
ClassLoader
the ClassLoader to use for the CacheManager (null means use getDefaultClassLoader())
classLoader
)

Requests a CacheManager configured according to the implementation specific URI that uses the provided ClassLoader for loading underlying classes.

public CacheManager
getCacheManager()

Requests a CacheManager configured according to the getDefaultURI() and getDefaultProperties() be made available that using the getDefaultClassLoader() for loading underlying classes.

public ClassLoader

Returns:

the default ClassLoader used by the CachingProvider
getDefaultClassLoader
()

Obtains the default ClassLoader that will be used by the CachingProvider.

public Properties

Returns:

the default Properties for the CachingProvider
getDefaultProperties
()

Obtains the default Properties for the CachingProvider.

public URI

Returns:

the default URI for the CachingProvider
getDefaultURI
()

Obtains the default URI for the CachingProvider.

public boolean

Returns:

true if the feature is supported
isSupported
(OptionalFeature
the feature to check for
optionalFeature
)

Determines whether an optional feature is supported by the CachingProvider.

Method Detail

closeback to summary
public void close()

Redeclares java.io.Closeable.close.

Closes all of the CacheManager instances and associated resources created and maintained by the CachingProvider across all ClassLoaders.

After closing the CachingProvider will still be operational. It may still be used for acquiring CacheManager instances, though those will now be new.

Exceptions
SecurityException:
when the operation could not be performed due to the current security settings
closeback to summary
public void close(ClassLoader classLoader)

Closes all CacheManager instances and associated resources created by the CachingProvider using the specified ClassLoader.

After closing the CachingProvider will still be operational. It may still be used for acquiring CacheManager instances, though those will now be new for the specified ClassLoader .

Parameters
classLoader:ClassLoader

the ClassLoader to release

Exceptions
SecurityException:
when the operation could not be performed due to the current security settings
closeback to summary
public void close(URI uri, ClassLoader classLoader)

Closes all CacheManager instances and associated resources created by the CachingProvider for the specified URI and ClassLoader.

Parameters
uri:URI

the URI to release

classLoader:ClassLoader

the ClassLoader to release

Exceptions
SecurityException:
when the operation could not be performed due to the current security settings
getCacheManagerback to summary
public CacheManager getCacheManager(URI uri, ClassLoader classLoader, Properties properties)

Requests a CacheManager configured according to the implementation specific URI be made available that uses the provided ClassLoader for loading underlying classes.

Multiple calls to this method with the same URI and ClassLoader must return the same CacheManager instance, except if a previously returned CacheManager has been closed.

Properties are used in construction of a CacheManager and do not form part of the identity of the CacheManager. i.e. if a second call is made to with the same URI and ClassLoader but different properties, the CacheManager created in the first call is returned.

Properties names follow the same scheme as package names. The prefixes java and javax are reserved. Properties are passed through and can be retrieved via CacheManager#getProperties(). Properties within the package scope of a caching implementation may be used for additional configuration.

Parameters
uri:URI

an implementation specific URI for the CacheManager (null means use getDefaultURI())

classLoader:ClassLoader

the ClassLoader to use for the CacheManager (null means use getDefaultClassLoader())

properties:Properties

the Properties for the CachingProvider to create the CacheManager (null means no implementation specific Properties are required)

Exceptions
CacheException:
when a CacheManager for the specified arguments could not be produced
SecurityException:
when the operation could not be performed due to the current security settings
getCacheManagerback to summary
public CacheManager getCacheManager(URI uri, ClassLoader classLoader)

Requests a CacheManager configured according to the implementation specific URI that uses the provided ClassLoader for loading underlying classes.

Multiple calls to this method with the same URI and ClassLoader must return the same CacheManager instance, except if a previously returned CacheManager has been closed.

Parameters
uri:URI

an implementation specific URI for the CacheManager (null means use getDefaultURI())

classLoader:ClassLoader

the ClassLoader to use for the CacheManager (null means use getDefaultClassLoader())

Exceptions
CacheException:
when a CacheManager for the specified arguments could not be produced
SecurityException:
when the operation could not be performed due to the current security settings
getCacheManagerback to summary
public CacheManager getCacheManager()

Requests a CacheManager configured according to the getDefaultURI() and getDefaultProperties() be made available that using the getDefaultClassLoader() for loading underlying classes.

Multiple calls to this method must return the same CacheManager instance, except if a previously returned CacheManager has been closed.

Exceptions
SecurityException:
when the operation could not be performed due to the current security settings
getDefaultClassLoaderback to summary
public ClassLoader getDefaultClassLoader()

Obtains the default ClassLoader that will be used by the CachingProvider.

Returns:ClassLoader

the default ClassLoader used by the CachingProvider

getDefaultPropertiesback to summary
public Properties getDefaultProperties()

Obtains the default Properties for the CachingProvider.

Use this method to obtain suitable Properties for the CachingProvider.

Returns:Properties

the default Properties for the CachingProvider

getDefaultURIback to summary
public URI getDefaultURI()

Obtains the default URI for the CachingProvider.

Use this method to obtain a suitable URI for the CachingProvider.

Returns:URI

the default URI for the CachingProvider

isSupportedback to summary
public boolean isSupported(OptionalFeature optionalFeature)

Determines whether an optional feature is supported by the CachingProvider.

Parameters
optionalFeature:OptionalFeature

the feature to check for

Returns:boolean

true if the feature is supported