Interface CacheFactoryBuilder

All Superinterfaces:
Comparable<SessionProvider>, SessionProvider
All Known Implementing Classes:
DefaultCacheFactoryBuilder, ScopedCacheFactoryBuilder, SingletonCacheFactoryBuilder

public interface CacheFactoryBuilder extends SessionProvider
CacheFactoryBuilder provides the means for building and managing configurable cache factories across class loaders in a pluggable fashion.

This is an advanced facility that could be used within J2EE or OSGi containers to provide a class loader based application isolation.

Since:
Coherence 3.5.1
Author:
gg,rhl 2009.07.14
  • Field Details

  • Method Details

    • getConfigurableCacheFactory

      ConfigurableCacheFactory getConfigurableCacheFactory(ClassLoader loader)
      Return the default ConfigurableCacheFactory for a given class loader.
      Parameters:
      loader - class loader for which the configuration should be used; must not be null
      Returns:
      the default ConfigurableCacheFactory for a given class loader
    • getConfigurableCacheFactory

      ConfigurableCacheFactory getConfigurableCacheFactory(String sConfigURI, ClassLoader loader)
      Return the ConfigurableCacheFactory for a given URI and class loader.
      Parameters:
      sConfigURI - the configuration URI; must not be null
      loader - class loader for which the configuration should be used; must not be null
      Returns:
      the ConfigurableCacheFactory for a given URI and class loader
    • getConfigurableCacheFactory

      ConfigurableCacheFactory getConfigurableCacheFactory(String sConfigURI, ClassLoader loader, ParameterResolver resolver)
      Return the ConfigurableCacheFactory for a given URI and class loader.
      Parameters:
      sConfigURI - the configuration URI; must not be null
      loader - class loader for which the configuration should be used; must not be null
      resolver - the optional ParameterResolver to use to resolve configuration parameters
      Returns:
      the ConfigurableCacheFactory for a given URI and class loader
    • setCacheConfiguration

      void setCacheConfiguration(ClassLoader loader, XmlElement xmlConfig)
      Dynamically set the default cache configuration for a given class loader. If a ConfigurableCacheFactory for the given class loader already exists, the factory will be released.
      Parameters:
      loader - class loader for which the configuration should be used; must not be null
      xmlConfig - cache configuration in xml element format
    • setCacheConfiguration

      void setCacheConfiguration(String sConfigURI, ClassLoader loader, XmlElement xmlConfig)
      Dynamically set the cache configuration for a given URI and class loader. If a ConfigurableCacheFactory for the given URI and class loader already exists, the factory will be released.
      Parameters:
      sConfigURI - the configuration URI; must not be null
      loader - class loader for which the configuration should be used; must not be null
      xmlConfig - cache configuration in xml element format
    • setConfigurableCacheFactory

      ConfigurableCacheFactory setConfigurableCacheFactory(ConfigurableCacheFactory ccf, String sConfigURI, ClassLoader loader, boolean fReplace)
      Dynamically set the ConfigurableCacheFactory for a given URI and class loader. If a ConfigurableCacheFactory for the given URI and class loader already exists and the replacement is requested, the factory will be released.
      Parameters:
      ccf - the ConfigurableCacheFactory instance
      sConfigURI - the configuration URI; must not be null
      loader - class loader for which the configuration should be used; must not be null
      fReplace - specifies whether to replace a ConfigurableCacheFactory if one is already registered
      Returns:
      the previous ConfigurableCacheFactory associated with the URI and loader, if any
      Since:
      Coherence 12.1.2
    • releaseAll

      void releaseAll(ClassLoader loader)
      Release all ConfigurableCacheFactory objects for a given ClassLoader.
      Parameters:
      loader - the class loader for which all associated cache factories should be released
    • release

      void release(ConfigurableCacheFactory factory)
      Release the specified ConfigurableCacheFactory.
      Parameters:
      factory - the ConfigurableCacheFactory to release
    • createSession

      default SessionProvider.Context createSession(SessionConfiguration configuration, SessionProvider.Context context)
      Description copied from interface: SessionProvider
      Create a Session from the specified configuration.

      The return value is a SessionProvider.Context that may be the same context passed in. If the provider could create a Session the context will be completed and contain a session. If the provider cannot create a session the context will not be completed. If the provider could not create a session and no other providers should be tried then the result context will be completed without a session.

      Specified by:
      createSession in interface SessionProvider
      Parameters:
      configuration - the configuration to use to create the session
      context - the SessionProvider.Context to use when creating the session
      Returns:
      the resulting SessionProvider.Context either not completed, completed with a Session or completed empty.
    • releaseSession

      default void releaseSession(Session session)
      Description copied from interface: SessionProvider
      Release the Session.
      Specified by:
      releaseSession in interface SessionProvider
      Parameters:
      session - the Session to release