Class CoherenceConfigDataLocationResolver

java.lang.Object
com.oracle.coherence.spring.boot.config.CoherenceConfigDataLocationResolver
All Implemented Interfaces:
org.springframework.boot.context.config.ConfigDataLocationResolver<CoherenceConfigDataResource>

public class CoherenceConfigDataLocationResolver extends Object implements org.springframework.boot.context.config.ConfigDataLocationResolver<CoherenceConfigDataResource>
ConfigDataLocationResolver for Coherence Spring resolving CoherenceConfigDataResource using the COHERENCE_PREFIX prefix.
Since:
3.0
Author:
Gunnar Hillert
  • Field Details

  • Constructor Details

    • CoherenceConfigDataLocationResolver

      public CoherenceConfigDataLocationResolver()
  • Method Details

    • isResolvable

      public boolean isResolvable(org.springframework.boot.context.config.ConfigDataLocationResolverContext context, org.springframework.boot.context.config.ConfigDataLocation location)
      Will return true only if the provided ConfigDataLocation has the prefix as defined by getPrefix() and if the configuration for the Coherence backend is enabled.
      Specified by:
      isResolvable in interface org.springframework.boot.context.config.ConfigDataLocationResolver<CoherenceConfigDataResource>
      Parameters:
      context - the ConfigDataLocationResolverContext
      location - the ConfigDataLocation
      Returns:
      true if this ConfigDataLocationResolver is applicable to the provided location
      See Also:
    • getPrefix

      protected String getPrefix()
      Will return COHERENCE_PREFIX.
      Returns:
      the prefix constant COHERENCE_PREFIX
    • resolve

      public List<CoherenceConfigDataResource> resolve(org.springframework.boot.context.config.ConfigDataLocationResolverContext context, org.springframework.boot.context.config.ConfigDataLocation location)
      Not used. Returns an empty list.
      Specified by:
      resolve in interface org.springframework.boot.context.config.ConfigDataLocationResolver<CoherenceConfigDataResource>
      Parameters:
      context - not used
      location - not used
      Returns:
      an empty List
    • resolveProfileSpecific

      public List<CoherenceConfigDataResource> resolveProfileSpecific(org.springframework.boot.context.config.ConfigDataLocationResolverContext resolverContext, org.springframework.boot.context.config.ConfigDataLocation location, org.springframework.boot.context.config.Profiles profiles) throws org.springframework.boot.context.config.ConfigDataLocationNotFoundException
      Return a list of CoherenceConfigDataResources.
      Specified by:
      resolveProfileSpecific in interface org.springframework.boot.context.config.ConfigDataLocationResolver<CoherenceConfigDataResource>
      Parameters:
      resolverContext - the location resolver context
      location - the location that should be resolved
      profiles - profile information
      Returns:
      a list of resolved CoherenceConfigDataResources (contains 1 element only).
      Throws:
      org.springframework.boot.context.config.ConfigDataLocationNotFoundException - on a non-optional location that cannot be found
    • loadProperties

      protected CoherenceConfigClientProperties loadProperties(org.springframework.boot.context.config.ConfigDataLocationResolverContext context)
      Load the CoherenceConfigClientProperties. Also, if CoherenceConfigClientProperties.getApplicationName() is not set, then default to the value spring.application.name if available, of if that value is not available, either, default to the name application.
      Parameters:
      context - the ConfigDataLocationResolverContext
      Returns:
      returns either the CoherenceConfigClientProperties from the ConfigDataLocationResolverContext or a new instance of CoherenceConfigClientProperties