Interface SessionConfiguration
-
- All Superinterfaces:
Comparable<SessionConfiguration>
- All Known Subinterfaces:
SessionInitializer
- All Known Implementing Classes:
SessionConfiguration.ConfigurableCacheFactorySessionConfig,WrapperSessionConfiguration
public interface SessionConfiguration extends Comparable<SessionConfiguration>
A class that can provide the configuration options for aSession.- Since:
- 20.12
- Author:
- Jonathan Knight 2020.11.03
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classSessionConfiguration.BuilderA builder to build aSessionConfiguration.ConfigurableCacheFactorySessionConfig.static classSessionConfiguration.ConfigurableCacheFactorySessionConfigAn immutableSessionConfigurationto configure aSessionthat wraps an underlyingConfigurableCacheFactory.
-
Field Summary
Fields Modifier and Type Field Description static intDEFAULT_PRIORITYThe default priority for a configuration.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description static SessionConfiguration.Builderbuilder()Create aSessionConfigurationbuilder.default intcompareTo(SessionConfiguration other)Order SessionConfiguration by priority, the lowest priority comes first.static SessionConfigurationcreate(String sConfigURI)Create aSessionConfigurationfor the defaultSessionwith the specified configuration file.static SessionConfigurationcreate(String sName, String sConfigURI)Create aSessionConfigurationfor aSessionwith a specific name and configuration file.static SessionConfigurationcreate(String sName, String sConfigURI, String sScopeName)Create aSessionConfigurationfor aSessionwith a specific name and configuration file.static SessionConfigurationdefaultSession()Create aSessionConfigurationfor the defaultSession.default Optional<ClassLoader>getClassLoader()Return the optionalClassLoaderto use for the session.default Optional<String>getConfigUri()Return the optional configuration file URI for a session that wraps aConfigurableCacheFactory.default Iterable<EventInterceptor<?>>getInterceptors()Return the interceptors to add to the session.default Optional<Coherence.Mode>getMode()Return an optionalCoherence.Modethat the session should use to set thecoherence.clientproperty.StringgetName()Return the name of theSession.default Optional<ParameterResolver>getParameterResolver()Returns an optionalParameterResolverto use to resolve configuration parameters when creating the session.default intgetPriority()Returns the priority for this configuration.StringgetScopeName()Return the scope name of theSession.default booleanisEnabled()Returntrueif this configuration is enabled and should be used to configure a session.default Optional<SessionProvider>sessionProvider()Return theSessionProviderto use to create a session.
-
-
-
Field Detail
-
DEFAULT_PRIORITY
static final int DEFAULT_PRIORITY
The default priority for a configuration.- See Also:
getPriority(), Constant Field Values
-
-
Method Detail
-
getName
String getName()
Return the name of theSession.If not specifically set the
Coherence.DEFAULT_NAMEwill be used.A session name must be unique.
- Returns:
- the name of the
Session
-
getScopeName
String getScopeName()
Return the scope name of theSession.If not specifically set, the name will default to the
getName()value. If thegetName()isCoherence.DEFAULT_NAMEno scope will be used.- Returns:
- the scope name of the
Session
-
getInterceptors
default Iterable<EventInterceptor<?>> getInterceptors()
Return the interceptors to add to the session.- Returns:
- the interceptors to add to the session
-
isEnabled
default boolean isEnabled()
Returntrueif this configuration is enabled and should be used to configure a session.- Returns:
trueif this configuration is enabled
-
getConfigUri
default Optional<String> getConfigUri()
Return the optional configuration file URI for a session that wraps aConfigurableCacheFactory.- Returns:
- the optional configuration file URI for a session that
wraps a
ConfigurableCacheFactory
-
getClassLoader
default Optional<ClassLoader> getClassLoader()
Return the optionalClassLoaderto use for the session.- Returns:
- the optional
ClassLoaderto use for the session
-
getPriority
default int getPriority()
Returns the priority for this configuration.Sessions will be created in priority order, the highest priority first.
The default priority is zero (see
DEFAULT_PRIORITY).- Returns:
- the priority for this configuration
-
compareTo
default int compareTo(SessionConfiguration other)
Order SessionConfiguration by priority, the lowest priority comes first.- Specified by:
compareToin interfaceComparable<SessionConfiguration>- Parameters:
other- the configuration to compare to- Returns:
- compare this configuration with the specified configuration ordering by priority
-
getParameterResolver
default Optional<ParameterResolver> getParameterResolver()
Returns an optionalParameterResolverto use to resolve configuration parameters when creating the session.- Returns:
- an optional
ParameterResolverto use to resolve configuration parameters
-
getMode
default Optional<Coherence.Mode> getMode()
Return an optionalCoherence.Modethat the session should use to set thecoherence.clientproperty.- Returns:
- an optional
Coherence.Modethat the session should use to set thecoherence.clientproperty
-
sessionProvider
default Optional<SessionProvider> sessionProvider()
Return theSessionProviderto use to create a session.- Returns:
- the
SessionProviderto use to create a session
-
builder
static SessionConfiguration.Builder builder()
Create aSessionConfigurationbuilder.- Returns:
- a
SessionConfigurationbuilder
-
defaultSession
static SessionConfiguration defaultSession()
Create aSessionConfigurationfor the defaultSession.The default session will wrap a
ConfigurableCacheFactorythat is configured from the default cache configuration file.The default session will have a name
Coherence.DEFAULT_NAMEand the default scope nameCoherence.DEFAULT_SCOPE.- Returns:
- a
SessionConfigurationfor the defaultSession
-
create
static SessionConfiguration create(String sConfigURI)
Create aSessionConfigurationfor the defaultSessionwith the specified configuration file.The default session will wrap a
ConfigurableCacheFactorythat is configured from the default cache configuration file.The default session will have a name
Coherence.DEFAULT_NAMEand the default scope nameCoherence.DEFAULT_SCOPE.- Parameters:
sConfigURI- the location of the configuration file to use- Returns:
- a
SessionConfigurationfor the defaultSession
-
create
static SessionConfiguration create(String sName, String sConfigURI)
Create aSessionConfigurationfor aSessionwith a specific name and configuration file.The session will have a scope name
Coherence.DEFAULT_SCOPE.- Parameters:
sName- the name of the sessionsConfigURI- the location of the configuration file to use- Returns:
- a
SessionConfiguration
-
create
static SessionConfiguration create(String sName, String sConfigURI, String sScopeName)
Create aSessionConfigurationfor aSessionwith a specific name and configuration file.- Parameters:
sName- the name of the sessionsConfigURI- the location of the configuration file to usesScopeName- the scope name to use for the session- Returns:
- a
SessionConfiguration
-
-