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 Details

  • Method Details

    • getCoherence

      public com.tangosol.net.Coherence getCoherence()
      Description copied from interface: CoherenceConfigurer
      Responsible for returning the Coherence instance.
      Specified by:
      getCoherence in interface CoherenceConfigurer
      Returns:
      the Coherence instance
    • getCoherenceServer

      public CoherenceServer getCoherenceServer()
      Description copied from interface: CoherenceConfigurer
      Returns the CoherenceServer instance. Use the CoherenceServer to start and stop the Coherence instance.
      Specified by:
      getCoherenceServer in interface CoherenceConfigurer
      Returns:
      the Coherence Server
    • getCoherenceConfiguration

      public com.tangosol.net.CoherenceConfiguration getCoherenceConfiguration()
      Description copied from interface: CoherenceConfigurer
      Responsible for creating the CoherenceConfiguration for the CoherenceServer.
      Specified by:
      getCoherenceConfiguration in interface CoherenceConfigurer
      Returns:
      the configuration for a Coherence instance
    • initialize

      @PostConstruct public void initialize()
    • createCoherenceConfiguration

      protected com.tangosol.net.CoherenceConfiguration createCoherenceConfiguration()
      Create the CoherenceConfiguration.
      Returns:
      the Configuration for a Coherence instance.
    • createCoherence

      protected com.tangosol.net.Coherence createCoherence(Set<SessionType> detectedSessionTypes)
      Creates a Coherence instance with the CoherenceConfiguration provided by getCoherenceConfiguration(). 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 Set of detected SessionTypes. As soon as SessionType.SERVER is provided, the Coherence instance is configured using Coherence.clusterMember(CoherenceConfiguration).
      • If the Set of detected SessionType is empty, the Coherence instances is configured using Coherence.clusterMember(CoherenceConfiguration).
      Parameters:
      detectedSessionTypes - must not be null
      Returns:
      the Coherence instance
    • createCoherenceServer

      protected CoherenceServer createCoherenceServer()
      Create a CoherenceServer using the provided Coherence instance. If getCoherenceServerStartupTimeout() is not null, also provide it to the CoherenceServer. If getCoherenceServerStartupTimeout() is null, the CoherenceServer will use the timout specified by CoherenceServer.DEFAULT_STARTUP_TIMEOUT_MILLIS.
      Returns:
      the created CoherenceServer, never null
    • getCoherenceServerStartupTimeout

      public Duration getCoherenceServerStartupTimeout()
      Return the Coherence Server startup timeout value.
      Returns:
      may be null
    • setCoherenceServerStartupTimeout

      public void setCoherenceServerStartupTimeout(Duration coherenceServerStartupTimeout)
      Set the Coherence Server startup timeout value. This is an optional property. If not specified the CoherenceServer will use CoherenceServer.DEFAULT_STARTUP_TIMEOUT_MILLIS.
      Parameters:
      coherenceServerStartupTimeout - must be a positive value
      See Also:
    • setCoherenceInstanceType

      public void setCoherenceInstanceType(CoherenceInstanceType coherenceInstanceType)
      Set the Coherence instance type explicitly. This is an optional property. If not specified, the CoherenceInstanceType will be defined depending on the configured Coherence Sessions. See createCoherence(Set) for further details.
      Parameters:
      coherenceInstanceType - explicitly set the CoherenceInstanceType
    • getCoherenceInstanceType

      public CoherenceInstanceType getCoherenceInstanceType()
      Return the configured CoherenceInstanceType.
      Returns:
      value may be null