Interface SessionConfiguration
- All Superinterfaces:
Comparable<SessionConfiguration>
- All Known Subinterfaces:
SessionInitializer
- All Known Implementing Classes:
SessionConfiguration.ConfigurableCacheFactorySessionConfig
,WrapperSessionConfiguration
Session
.- Since:
- 20.12
- Author:
- Jonathan Knight 2020.11.03
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic class
A builder to build aSessionConfiguration.ConfigurableCacheFactorySessionConfig
.static class
An immutableSessionConfiguration
to configure aSession
that wraps an underlyingConfigurableCacheFactory
. -
Field Summary
Modifier and TypeFieldDescriptionstatic final int
The default priority for a configuration. -
Method Summary
Modifier and TypeMethodDescriptionstatic SessionConfiguration.Builder
builder()
Create aSessionConfiguration
builder.default int
compareTo
(SessionConfiguration other) Order SessionConfiguration by priority, the lowest priority comes first.static SessionConfiguration
Create aSessionConfiguration
for the defaultSession
with the specified configuration file.static SessionConfiguration
Create aSessionConfiguration
for aSession
with a specific name and configuration file.static SessionConfiguration
Create aSessionConfiguration
for aSession
with a specific name and configuration file.static SessionConfiguration
Create aSessionConfiguration
for the defaultSession
.default Optional
<ClassLoader> Return the optionalClassLoader
to use for the session.Return the optional configuration file URI for a session that wraps aConfigurableCacheFactory
.default Iterable
<EventInterceptor<?>> 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.getName()
Return the name of theSession
.default Optional
<ParameterResolver> Returns an optionalParameterResolver
to use to resolve configuration parameters when creating the session.default int
Returns the priority for this configuration.Return the scope name of theSession
.default boolean
Returntrue
if this configuration is enabled and should be used to configure a session.default Optional
<SessionProvider> Return theSessionProvider
to use to create a session.
-
Field Details
-
DEFAULT_PRIORITY
static final int DEFAULT_PRIORITYThe default priority for a configuration.- See Also:
-
-
Method Details
-
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
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
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
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
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
Returns an optionalParameterResolver
to use to resolve configuration parameters when creating the session.- Returns:
- an optional
ParameterResolver
to use to resolve configuration parameters
-
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
Return theSessionProvider
to use to create a session.- Returns:
- the
SessionProvider
to use to create a session
-
builder
Create aSessionConfiguration
builder.- Returns:
- a
SessionConfiguration
builder
-
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
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
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
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
-