javax.cache
Interface CacheManagerFactory


public interface CacheManagerFactory

Manages CacheManager instances. It is invoked by the Caching class to create a CacheManager

Since:
1.0
Author:
Yannis Cosmadopoulos

Method Summary
 void close()
          Reclaims all resources obtained from this factory.
 boolean close(ClassLoader classLoader)
          Reclaims all resources for a ClassLoader from this factory.
 boolean close(ClassLoader classLoader, String name)
          Reclaims all resources for a ClassLoader from this factory.
 CacheManager getCacheManager(ClassLoader classLoader, String name)
          Get the cache manager for the specified name and class loader.
 CacheManager getCacheManager(String name)
          Get a named cache manager using the default cache loader as specified by the implementation.
 

Method Detail

getCacheManager

CacheManager getCacheManager(String name)
Get a named cache manager using the default cache loader as specified by the implementation.

Parameters:
name - the name of the cache manager
Returns:
the named cache manager
Throws:
NullPointerException - if name is null

getCacheManager

CacheManager getCacheManager(ClassLoader classLoader,
                             String name)
Get the cache manager for the specified name and class loader.

If there is no cache manager associated, it is created.

Parameters:
classLoader - associated with the cache manager.
name - the name of the cache manager
Returns:
the new cache manager
Throws:
NullPointerException - if classLoader or name is null

close

void close()
           throws CachingShutdownException
Reclaims all resources obtained from this factory.

All cache managers obtained from the factory are shutdown.

Subsequent requests from this factory will return different cache managers than would have been obtained before shutdown.

Throws:
CachingShutdownException - if any of the individual shutdowns failed

close

boolean close(ClassLoader classLoader)
              throws CachingShutdownException
Reclaims all resources for a ClassLoader from this factory.

All cache managers linked to the specified CacheLoader obtained from the factory are shutdown.

Parameters:
classLoader - the class loader for which managers will be shut down
Returns:
true if found, false otherwise
Throws:
CachingShutdownException - if any of the individual shutdowns failed

close

boolean close(ClassLoader classLoader,
              String name)
              throws CachingShutdownException
Reclaims all resources for a ClassLoader from this factory.

the named cache manager obtained from the factory is shutdown.

Parameters:
classLoader - the class loader for which managers will be shut down
name - the name of the cache manager
Returns:
true if found, false otherwise
Throws:
CachingShutdownException - if there is a problem shutting down a CacheManager


Copyright © 2012. All Rights Reserved.