Class CoherenceConfiguration.Builder
- Enclosing interface:
CoherenceConfiguration
CoherenceConfiguration
instance.
This class is not thread-safe, application code that calls methods on this builder from multiple threads must implement its own thread-safety.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Build aCoherenceConfiguration
from thisCoherenceConfiguration.Builder
.Add all of theSessionConfiguration
instances discovered using theServiceLoader
.Set the name of theCoherence
instance.withApplicationContext
(com.tangosol.application.Context context) Set theapplication context
to associate to theCoherence
instance.withEventInterceptor
(EventInterceptor<?> interceptor) Add anEventInterceptor
that will be added to allSession
instances as they are created on start-up.withEventInterceptors
(EventInterceptor<?>... interceptors) Add theEventInterceptor
instances that will be added to allSession
instances as they are created on start-up.withEventInterceptors
(Iterable<? extends EventInterceptor<?>> interceptors) Add theEventInterceptor
instances that will be added to allSession
instances as they are created on start-up.withSession
(SessionConfiguration config) Add aSessionConfiguration
to theCoherence
instance that will be used to create the correspondingSession
on start-up.withSessions
(SessionConfiguration... configs) Add theSessionConfiguration
instances to theCoherence
instance that will be used to create the correspondingSession
instances on start-up.withSessions
(Iterable<? extends SessionConfiguration> configs) Add theSessionConfiguration
instances to theCoherence
instance that will be used to create the correspondingSession
instances on start-up.
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
named
Set the name of theCoherence
instance.If the name is set ot
null
or empty/blank string theCoherence.DEFAULT_NAME
will be used.The name must be unique across all
Coherence
instances.- Parameters:
sName
- the name of theCoherence
instance- Returns:
- this
CoherenceConfiguration.Builder
-
discoverSessions
Add all of theSessionConfiguration
instances discovered using theServiceLoader
.- Returns:
- this
CoherenceConfiguration.Builder
-
withSession
Add aSessionConfiguration
to theCoherence
instance that will be used to create the correspondingSession
on start-up.The name of the
SessionConfiguration
returned by theSessionConfiguration.getName()
method must be unique across allCoherence
instances.Adding a
SessionConfiguration
with the same name as aSessionConfiguration
already added to this builder will overwrite the previously added configuration.- Parameters:
config
- theSessionConfiguration
to configure aSession
- Returns:
- this
CoherenceConfiguration.Builder
-
withSessions
public CoherenceConfiguration.Builder withSessions(Iterable<? extends SessionConfiguration> configs) Add theSessionConfiguration
instances to theCoherence
instance that will be used to create the correspondingSession
instances on start-up.The name of the
SessionConfiguration
returned by theSessionConfiguration.getName()
method must be unique across allCoherence
instances.Adding a
SessionConfiguration
with the same name as aSessionConfiguration
already added to this builder will overwrite the previously added configuration.- Parameters:
configs
- theSessionConfiguration
instances to configureSession
instances- Returns:
- this
CoherenceConfiguration.Builder
-
withSessions
Add theSessionConfiguration
instances to theCoherence
instance that will be used to create the correspondingSession
instances on start-up.The name of the
SessionConfiguration
returned by theSessionConfiguration.getName()
method must be unique across allCoherence
instances.Adding a
SessionConfiguration
with the same name as aSessionConfiguration
already added to this builder will overwrite the previously added configuration.- Parameters:
configs
- theSessionConfiguration
instances to configureSession
instances- Returns:
- this
CoherenceConfiguration.Builder
-
withEventInterceptor
Add anEventInterceptor
that will be added to allSession
instances as they are created on start-up.- Parameters:
interceptor
- theEventInterceptor
to add- Returns:
- this
CoherenceConfiguration.Builder
-
withEventInterceptors
Add theEventInterceptor
instances that will be added to allSession
instances as they are created on start-up.- Parameters:
interceptors
- theEventInterceptor
instances to add- Returns:
- this
CoherenceConfiguration.Builder
-
withEventInterceptors
public CoherenceConfiguration.Builder withEventInterceptors(Iterable<? extends EventInterceptor<?>> interceptors) Add theEventInterceptor
instances that will be added to allSession
instances as they are created on start-up.- Parameters:
interceptors
- theEventInterceptor
instances to add- Returns:
- this
CoherenceConfiguration.Builder
-
withApplicationContext
public CoherenceConfiguration.Builder withApplicationContext(com.tangosol.application.Context context) Set theapplication context
to associate to theCoherence
instance.- Parameters:
context
- theapplication context
to associate to theCoherence
instance- Returns:
- this
CoherenceConfiguration.Builder
-
build
Build aCoherenceConfiguration
from thisCoherenceConfiguration.Builder
.- Returns:
- a
CoherenceConfiguration
created from thisCoherenceConfiguration.Builder
-