Class DefaultCoherenceConfigurer
java.lang.Object
com.oracle.coherence.spring.configuration.DefaultCoherenceConfigurer
- All Implemented Interfaces:
CoherenceConfigurer
@Configuration
public class DefaultCoherenceConfigurer
extends Object
implements CoherenceConfigurer
Default implementation of the
CoherenceConfigurer interface.- Since:
- 3.0
- Author:
- Gunnar Hillert
-
Constructor Summary
ConstructorsConstructorDescriptionDefaultCoherenceConfigurer(ConfigurableApplicationContext context, CoherenceEventListenerCandidates coherenceEventListenerCandidates) -
Method Summary
Modifier and TypeMethodDescriptionprotected com.tangosol.net.CoherencecreateCoherence(Set<SessionType> detectedSessionTypes) Creates aCoherenceinstance with theCoherenceConfigurationprovided bygetCoherenceConfiguration().protected com.tangosol.net.CoherenceConfigurationCreate theCoherenceConfiguration.protected CoherenceServerCreate aCoherenceServerusing the providedCoherenceinstance.com.tangosol.net.CoherenceResponsible for returning theCoherenceinstance.com.tangosol.net.CoherenceConfigurationResponsible for creating theCoherenceConfigurationfor theCoherenceServer.Return the configuredCoherenceInstanceType.Returns theCoherenceServerinstance.Return the Coherence Server startup timeout value.voidvoidsetCoherenceInstanceType(CoherenceInstanceType coherenceInstanceType) Set the Coherence instance type explicitly.voidsetCoherenceServerStartupTimeout(Duration coherenceServerStartupTimeout) Set the Coherence Server startup timeout value.
-
Constructor Details
-
DefaultCoherenceConfigurer
public DefaultCoherenceConfigurer(ConfigurableApplicationContext context, CoherenceEventListenerCandidates coherenceEventListenerCandidates)
-
-
Method Details
-
getCoherence
public com.tangosol.net.Coherence getCoherence()Description copied from interface:CoherenceConfigurerResponsible for returning theCoherenceinstance.- Specified by:
getCoherencein interfaceCoherenceConfigurer- Returns:
- the Coherence instance
-
getCoherenceServer
Description copied from interface:CoherenceConfigurerReturns theCoherenceServerinstance. Use theCoherenceServerto start and stop theCoherenceinstance.- Specified by:
getCoherenceServerin interfaceCoherenceConfigurer- Returns:
- the Coherence Server
-
getCoherenceConfiguration
public com.tangosol.net.CoherenceConfiguration getCoherenceConfiguration()Description copied from interface:CoherenceConfigurerResponsible for creating theCoherenceConfigurationfor theCoherenceServer.- Specified by:
getCoherenceConfigurationin interfaceCoherenceConfigurer- Returns:
- the configuration for a Coherence instance
-
initialize
@PostConstruct public void initialize() -
createCoherenceConfiguration
protected com.tangosol.net.CoherenceConfiguration createCoherenceConfiguration()Create theCoherenceConfiguration.- Returns:
- the Configuration for a Coherence instance.
-
createCoherence
Creates aCoherenceinstance with theCoherenceConfigurationprovided bygetCoherenceConfiguration(). The created Coherence instance may either be a client Coherence instance (Coherence.client(CoherenceConfiguration)) or a cluster member instance (Coherence.clusterMember(CoherenceConfiguration).The rules for determining the instance type are as follows in descending priority:
- Explicit configuration via
getCoherenceInstanceType(). - Via the
Setof detectedSessionTypes. As soon asSessionType.SERVERis provided, the Coherence instance is configured usingCoherence.clusterMember(CoherenceConfiguration). - If the
Setof detectedSessionTypeis empty, the Coherence instances is configured usingCoherence.clusterMember(CoherenceConfiguration).
- Parameters:
detectedSessionTypes- must not be null- Returns:
- the Coherence instance
- Explicit configuration via
-
createCoherenceServer
Create aCoherenceServerusing the providedCoherenceinstance. IfgetCoherenceServerStartupTimeout()is not null, also provide it to theCoherenceServer. IfgetCoherenceServerStartupTimeout()is null, theCoherenceServerwill use the timout specified byCoherenceServer.DEFAULT_STARTUP_TIMEOUT_MILLIS.- Returns:
- the created CoherenceServer, never null
-
getCoherenceServerStartupTimeout
Return the Coherence Server startup timeout value.- Returns:
- may be null
-
setCoherenceServerStartupTimeout
Set the Coherence Server startup timeout value. This is an optional property. If not specified theCoherenceServerwill useCoherenceServer.DEFAULT_STARTUP_TIMEOUT_MILLIS.- Parameters:
coherenceServerStartupTimeout- must be a positive value- See Also:
-
setCoherenceInstanceType
Set the Coherence instance type explicitly. This is an optional property. If not specified, theCoherenceInstanceTypewill be defined depending on the configured CoherenceSessions. SeecreateCoherence(Set)for further details.- Parameters:
coherenceInstanceType- explicitly set the CoherenceInstanceType
-
getCoherenceInstanceType
Return the configuredCoherenceInstanceType.- Returns:
- value may be null
-