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 Summary
FieldsModifier and TypeFieldDescriptionstatic final StringPrefix used to indicate aCoherenceConfigDataResource.protected static final Log -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected StringWill returnCOHERENCE_PREFIX.booleanisResolvable(org.springframework.boot.context.config.ConfigDataLocationResolverContext context, org.springframework.boot.context.config.ConfigDataLocation location) Will return true only if the providedConfigDataLocationhas the prefix as defined bygetPrefix()and if the configuration for the Coherence backend is enabled.protected CoherenceConfigClientPropertiesloadProperties(org.springframework.boot.context.config.ConfigDataLocationResolverContext context) Load theCoherenceConfigClientProperties.resolve(org.springframework.boot.context.config.ConfigDataLocationResolverContext context, org.springframework.boot.context.config.ConfigDataLocation location) Not used.resolveProfileSpecific(org.springframework.boot.context.config.ConfigDataLocationResolverContext resolverContext, org.springframework.boot.context.config.ConfigDataLocation location, org.springframework.boot.context.config.Profiles profiles) Return a list of CoherenceConfigDataResources.
-
Field Details
-
logger
-
COHERENCE_PREFIX
Prefix used to indicate aCoherenceConfigDataResource.- See Also:
-
-
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 providedConfigDataLocationhas the prefix as defined bygetPrefix()and if the configuration for the Coherence backend is enabled.- Specified by:
isResolvablein interfaceorg.springframework.boot.context.config.ConfigDataLocationResolver<CoherenceConfigDataResource>- Parameters:
context- the ConfigDataLocationResolverContextlocation- the ConfigDataLocation- Returns:
- true if this ConfigDataLocationResolver is applicable to the provided location
- See Also:
-
getPrefix
Will returnCOHERENCE_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:
resolvein interfaceorg.springframework.boot.context.config.ConfigDataLocationResolver<CoherenceConfigDataResource>- Parameters:
context- not usedlocation- 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:
resolveProfileSpecificin interfaceorg.springframework.boot.context.config.ConfigDataLocationResolver<CoherenceConfigDataResource>- Parameters:
resolverContext- the location resolver contextlocation- the location that should be resolvedprofiles- 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 theCoherenceConfigClientProperties. Also, ifCoherenceConfigClientProperties.getApplicationName()is not set, then default to the valuespring.application.nameif available, of if that value is not available, either, default to the nameapplication.- Parameters:
context- the ConfigDataLocationResolverContext- Returns:
- returns either the CoherenceConfigClientProperties from the ConfigDataLocationResolverContext or a new instance of CoherenceConfigClientProperties
-