Package com.tangosol.net
Interface CacheFactoryBuilder
- All Superinterfaces:
Comparable<SessionProvider>
,SessionProvider
- All Known Implementing Classes:
DefaultCacheFactoryBuilder
,ScopedCacheFactoryBuilder
,SingletonCacheFactoryBuilder
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
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.tangosol.net.SessionProvider
SessionProvider.Context, SessionProvider.DefaultContext, SessionProvider.Option, SessionProvider.Provider, SessionProvider.Providers
-
Field Summary
Fields inherited from interface com.tangosol.net.SessionProvider
PRIORITY
-
Method Summary
Modifier and TypeMethodDescriptiondefault SessionProvider.Context
createSession
(SessionConfiguration configuration, SessionProvider.Context context) Create aSession
from the specified configuration.Return the default ConfigurableCacheFactory for a given class loader.getConfigurableCacheFactory
(String sConfigURI, ClassLoader loader) Return the ConfigurableCacheFactory for a given URI and class loader.getConfigurableCacheFactory
(String sConfigURI, ClassLoader loader, ParameterResolver resolver) Return the ConfigurableCacheFactory for a given URI and class loader.void
release
(ConfigurableCacheFactory factory) Release the specified ConfigurableCacheFactory.void
releaseAll
(ClassLoader loader) Release all ConfigurableCacheFactory objects for a given ClassLoader.default void
releaseSession
(Session session) Release theSession
.void
setCacheConfiguration
(ClassLoader loader, XmlElement xmlConfig) Dynamically set the default cache configuration for a given class loader.void
setCacheConfiguration
(String sConfigURI, ClassLoader loader, XmlElement xmlConfig) Dynamically set the cache configuration for a given URI and class loader.setConfigurableCacheFactory
(ConfigurableCacheFactory ccf, String sConfigURI, ClassLoader loader, boolean fReplace) Dynamically set theConfigurableCacheFactory
for a given URI and class loader.Methods inherited from interface com.tangosol.net.SessionProvider
close, compareTo, createSession, createSession, createSession, createSession, getPriority
-
Field Details
-
URI_DEFAULT
Default URI identifier.- See Also:
-
-
Method Details
-
getConfigurableCacheFactory
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
Return the ConfigurableCacheFactory for a given URI and class loader.- Parameters:
sConfigURI
- the configuration URI; must not be nullloader
- 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 nullloader
- class loader for which the configuration should be used; must not be nullresolver
- the optionalParameterResolver
to use to resolve configuration parameters- Returns:
- the ConfigurableCacheFactory for a given URI and class loader
-
setCacheConfiguration
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 nullxmlConfig
- cache configuration in xml element format
-
setCacheConfiguration
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 nullloader
- class loader for which the configuration should be used; must not be nullxmlConfig
- cache configuration in xml element format
-
setConfigurableCacheFactory
ConfigurableCacheFactory setConfigurableCacheFactory(ConfigurableCacheFactory ccf, String sConfigURI, ClassLoader loader, boolean fReplace) Dynamically set theConfigurableCacheFactory
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 instancesConfigURI
- the configuration URI; must not be nullloader
- class loader for which the configuration should be used; must not be nullfReplace
- 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
Release all ConfigurableCacheFactory objects for a given ClassLoader.- Parameters:
loader
- the class loader for which all associated cache factories should be released
-
release
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 aSession
from the specified configuration.The return value is a
SessionProvider.Context
that may be the same context passed in. If the provider could create aSession
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 interfaceSessionProvider
- Parameters:
configuration
- the configuration to use to create the sessioncontext
- theSessionProvider.Context
to use when creating the session- Returns:
- the resulting
SessionProvider.Context
either not completed, completed with aSession
or completed empty.
-
releaseSession
Description copied from interface:SessionProvider
Release theSession
.- Specified by:
releaseSession
in interfaceSessionProvider
- Parameters:
session
- theSession
to release
-