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 class
SessionConfiguration.Builder
A builder to build aSessionConfiguration.ConfigurableCacheFactorySessionConfig
.static class
SessionConfiguration.ConfigurableCacheFactorySessionConfig
An immutableSessionConfiguration
to configure aSession
that wraps an underlyingConfigurableCacheFactory
.
-
Field Summary
Fields Modifier and Type Field Description static int
DEFAULT_PRIORITY
The default priority for a configuration.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description static SessionConfiguration.Builder
builder()
Create aSessionConfiguration
builder.default int
compareTo(SessionConfiguration other)
Order SessionConfiguration by priority, the lowest priority comes first.static SessionConfiguration
create(String sConfigURI)
Create aSessionConfiguration
for the defaultSession
with the specified configuration file.static SessionConfiguration
create(String sName, String sConfigURI)
Create aSessionConfiguration
for aSession
with a specific name and configuration file.static SessionConfiguration
create(String sName, String sConfigURI, String sScopeName)
Create aSessionConfiguration
for aSession
with a specific name and configuration file.static SessionConfiguration
defaultSession()
Create aSessionConfiguration
for the defaultSession
.default Optional<ClassLoader>
getClassLoader()
Return the optionalClassLoader
to 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.Mode
that the session should use to set thecoherence.client
property.String
getName()
Return the name of theSession
.default Optional<ParameterResolver>
getParameterResolver()
Returns an optionalParameterResolver
to use to resolve configuration parameters when creating the session.default int
getPriority()
Returns the priority for this configuration.String
getScopeName()
Return the scope name of theSession
.default boolean
isEnabled()
Returntrue
if this configuration is enabled and should be used to configure a session.default Optional<SessionProvider>
sessionProvider()
Return theSessionProvider
to 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_NAME
will 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_NAME
no 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()
Returntrue
if this configuration is enabled and should be used to configure a session.- Returns:
true
if 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 optionalClassLoader
to use for the session.- Returns:
- the optional
ClassLoader
to 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:
compareTo
in 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 optionalParameterResolver
to use to resolve configuration parameters when creating the session.- Returns:
- an optional
ParameterResolver
to use to resolve configuration parameters
-
getMode
default Optional<Coherence.Mode> getMode()
Return an optionalCoherence.Mode
that the session should use to set thecoherence.client
property.- Returns:
- an optional
Coherence.Mode
that the session should use to set thecoherence.client
property
-
sessionProvider
default Optional<SessionProvider> sessionProvider()
Return theSessionProvider
to use to create a session.- Returns:
- the
SessionProvider
to use to create a session
-
builder
static SessionConfiguration.Builder builder()
Create aSessionConfiguration
builder.- Returns:
- a
SessionConfiguration
builder
-
defaultSession
static SessionConfiguration defaultSession()
Create aSessionConfiguration
for the defaultSession
.The default session will wrap a
ConfigurableCacheFactory
that is configured from the default cache configuration file.The default session will have a name
Coherence.DEFAULT_NAME
and the default scope nameCoherence.DEFAULT_SCOPE
.- Returns:
- a
SessionConfiguration
for the defaultSession
-
create
static SessionConfiguration create(String sConfigURI)
Create aSessionConfiguration
for the defaultSession
with the specified configuration file.The default session will wrap a
ConfigurableCacheFactory
that is configured from the default cache configuration file.The default session will have a name
Coherence.DEFAULT_NAME
and the default scope nameCoherence.DEFAULT_SCOPE
.- Parameters:
sConfigURI
- the location of the configuration file to use- Returns:
- a
SessionConfiguration
for the defaultSession
-
create
static SessionConfiguration create(String sName, String sConfigURI)
Create aSessionConfiguration
for aSession
with 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 aSessionConfiguration
for aSession
with 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
-
-