Package com.tangosol.net
Class SessionConfiguration.Builder
- java.lang.Object
-
- com.tangosol.net.SessionConfiguration.Builder
-
- Enclosing interface:
- SessionConfiguration
public static class SessionConfiguration.Builder extends Object
A builder to build aSessionConfiguration.ConfigurableCacheFactorySessionConfig
.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SessionConfiguration
build()
Build theSessionConfiguration
.SessionConfiguration.Builder
clientDirect()
Set the session'scoherence.client
parameter to "direct".SessionConfiguration.Builder
clientFixed()
Set the session'scoherence.client
parameter to "remote-fixed".SessionConfiguration.Builder
clientRemote()
Set the session'scoherence.client
parameter to "remote".SessionConfiguration.Builder
named(String sName)
Set the name for the session to be created.SessionConfiguration.Builder
withClassLoader(ClassLoader loader)
Set theClassLoader
for the session to be created.SessionConfiguration.Builder
withConfigUri(String sURI)
Set the cache configuration URI for the session to be created.SessionConfiguration.Builder
withInterceptor(EventInterceptor<?> interceptor)
Add anEventInterceptor
to add to the sessionSessionConfiguration.Builder
withMode(Coherence.Mode mode)
Set theCoherence.Mode
to use, which will override any mode used by theCoherence
instance.SessionConfiguration.Builder
withParameter(Parameter parameter)
Add a named parameter to use when resolving configuration parameters.SessionConfiguration.Builder
withParameter(String sName, Expression<?> expression)
Add a named parameter to use when resolving configuration parameters.SessionConfiguration.Builder
withParameter(String sName, Object oValue)
Add a named parameter to use when resolving configuration parameters.SessionConfiguration.Builder
withParameterResolver(ParameterResolver resolver)
Set the optionalParameterResolver
to use to resolve configuration parameters.SessionConfiguration.Builder
withPriority(int nPriority)
Set the session creation priority.SessionConfiguration.Builder
withScopeName(String sScope)
Set the scope name for the session to be created.SessionConfiguration.Builder
withSessionProvider(SessionProvider provider)
Set theSessionProvider
to use.
-
-
-
Method Detail
-
named
public SessionConfiguration.Builder named(String sName)
Set the name for the session to be created.- Parameters:
sName
- the name for the session to be created- Returns:
- this
SessionConfiguration.Builder
-
withConfigUri
public SessionConfiguration.Builder withConfigUri(String sURI)
Set the cache configuration URI for the session to be created.- Parameters:
sURI
- the cache configuration URI for the session to be created- Returns:
- this
SessionConfiguration.Builder
-
withClassLoader
public SessionConfiguration.Builder withClassLoader(ClassLoader loader)
Set theClassLoader
for the session to be created.- Parameters:
loader
- theClassLoader
for the session to be created- Returns:
- this
SessionConfiguration.Builder
-
withScopeName
public SessionConfiguration.Builder withScopeName(String sScope)
Set the scope name for the session to be created.- Parameters:
sScope
- the scope name for the session to be created- Returns:
- this
SessionConfiguration.Builder
-
withInterceptor
public SessionConfiguration.Builder withInterceptor(EventInterceptor<?> interceptor)
Add anEventInterceptor
to add to the sessionIt is important that the interceptor is able to intercept the event types from the session being configured. Ideally use an implementation of
EventDispatcherAwareInterceptor
so that the interceptor can determine whether it should be registered with a specific session event dispatcher.- Parameters:
interceptor
- anEventInterceptor
to add to the session- Returns:
- this
SessionConfiguration.Builder
-
withPriority
public SessionConfiguration.Builder withPriority(int nPriority)
Set the session creation priority.- Parameters:
nPriority
- the session creation priority- Returns:
- this
SessionConfiguration.Builder
- See Also:
SessionConfiguration.getPriority()
-
withParameterResolver
public SessionConfiguration.Builder withParameterResolver(ParameterResolver resolver)
Set the optionalParameterResolver
to use to resolve configuration parameters.Any parameter added directly with one of the
addParameter
methods will take precedence over the parameters in the specified resolver.- Parameters:
resolver
- the optionalParameterResolver
to use to resolve configuration parameters- Returns:
- this
SessionConfiguration.Builder
- See Also:
withParameter(String, Object)
,withParameter(String, Expression)
,withParameter(Parameter)
-
withParameter
public SessionConfiguration.Builder withParameter(String sName, Object oValue)
Add a named parameter to use when resolving configuration parameters.- Parameters:
sName
- the name of the parameteroValue
- the parameter value- Returns:
- this
SessionConfiguration.Builder
-
withParameter
public SessionConfiguration.Builder withParameter(String sName, Expression<?> expression)
Add a named parameter to use when resolving configuration parameters.- Parameters:
sName
- the name of the parameterexpression
- the parameterExpression
to use to resolve the parameter value- Returns:
- this
SessionConfiguration.Builder
-
withParameter
public SessionConfiguration.Builder withParameter(Parameter parameter)
Add a named parameter to use when resolving configuration parameters.- Parameters:
parameter
- the namedParameter
- Returns:
- this
SessionConfiguration.Builder
-
clientRemote
public SessionConfiguration.Builder clientRemote()
Set the session'scoherence.client
parameter to "remote".- Returns:
- this
SessionConfiguration.Builder
-
clientFixed
public SessionConfiguration.Builder clientFixed()
Set the session'scoherence.client
parameter to "remote-fixed".- Returns:
- this
SessionConfiguration.Builder
-
clientDirect
public SessionConfiguration.Builder clientDirect()
Set the session'scoherence.client
parameter to "direct".- Returns:
- this
SessionConfiguration.Builder
-
withMode
public SessionConfiguration.Builder withMode(Coherence.Mode mode)
Set theCoherence.Mode
to use, which will override any mode used by theCoherence
instance.- Parameters:
mode
- theCoherence.Mode
to use- Returns:
- this
SessionConfiguration.Builder
-
withSessionProvider
public SessionConfiguration.Builder withSessionProvider(SessionProvider provider)
Set theSessionProvider
to use.- Parameters:
provider
- theSessionProvider
to use- Returns:
- this
SessionConfiguration.Builder
-
build
public SessionConfiguration build()
Build theSessionConfiguration
.- Returns:
- the
SessionConfiguration
-
-