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 SessionConfigurationbuild()Build theSessionConfiguration.SessionConfiguration.BuilderclientDirect()Set the session'scoherence.clientparameter to "direct".SessionConfiguration.BuilderclientFixed()Set the session'scoherence.clientparameter to "remote-fixed".SessionConfiguration.BuilderclientRemote()Set the session'scoherence.clientparameter to "remote".SessionConfiguration.Buildernamed(String sName)Set the name for the session to be created.SessionConfiguration.BuilderwithClassLoader(ClassLoader loader)Set theClassLoaderfor the session to be created.SessionConfiguration.BuilderwithConfigUri(String sURI)Set the cache configuration URI for the session to be created.SessionConfiguration.BuilderwithInterceptor(EventInterceptor<?> interceptor)Add anEventInterceptorto add to the sessionSessionConfiguration.BuilderwithMode(Coherence.Mode mode)Set theCoherence.Modeto use, which will override any mode used by theCoherenceinstance.SessionConfiguration.BuilderwithParameter(Parameter parameter)Add a named parameter to use when resolving configuration parameters.SessionConfiguration.BuilderwithParameter(String sName, Expression<?> expression)Add a named parameter to use when resolving configuration parameters.SessionConfiguration.BuilderwithParameter(String sName, Object oValue)Add a named parameter to use when resolving configuration parameters.SessionConfiguration.BuilderwithParameterResolver(ParameterResolver resolver)Set the optionalParameterResolverto use to resolve configuration parameters.SessionConfiguration.BuilderwithPriority(int nPriority)Set the session creation priority.SessionConfiguration.BuilderwithScopeName(String sScope)Set the scope name for the session to be created.SessionConfiguration.BuilderwithSessionProvider(SessionProvider provider)Set theSessionProviderto 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 theClassLoaderfor the session to be created.- Parameters:
loader- theClassLoaderfor 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 anEventInterceptorto 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
EventDispatcherAwareInterceptorso that the interceptor can determine whether it should be registered with a specific session event dispatcher.- Parameters:
interceptor- anEventInterceptorto 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 optionalParameterResolverto use to resolve configuration parameters.Any parameter added directly with one of the
addParametermethods will take precedence over the parameters in the specified resolver.- Parameters:
resolver- the optionalParameterResolverto 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 parameterExpressionto 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.clientparameter to "remote".- Returns:
- this
SessionConfiguration.Builder
-
clientFixed
public SessionConfiguration.Builder clientFixed()
Set the session'scoherence.clientparameter to "remote-fixed".- Returns:
- this
SessionConfiguration.Builder
-
clientDirect
public SessionConfiguration.Builder clientDirect()
Set the session'scoherence.clientparameter to "direct".- Returns:
- this
SessionConfiguration.Builder
-
withMode
public SessionConfiguration.Builder withMode(Coherence.Mode mode)
Set theCoherence.Modeto use, which will override any mode used by theCoherenceinstance.- Parameters:
mode- theCoherence.Modeto use- Returns:
- this
SessionConfiguration.Builder
-
withSessionProvider
public SessionConfiguration.Builder withSessionProvider(SessionProvider provider)
Set theSessionProviderto use.- Parameters:
provider- theSessionProviderto use- Returns:
- this
SessionConfiguration.Builder
-
build
public SessionConfiguration build()
Build theSessionConfiguration.- Returns:
- the
SessionConfiguration
-
-