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 resolvingCoherenceConfigDataResource
using theCOHERENCE_PREFIX
prefix.- Since:
- 3.0
- Author:
- Gunnar Hillert
-
-
Field Summary
Fields Modifier and Type Field Description static String
COHERENCE_PREFIX
Prefix used to indicate aCoherenceConfigDataResource
.protected static Log
logger
-
Constructor Summary
Constructors Constructor Description CoherenceConfigDataLocationResolver()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected String
getPrefix()
Will returnCOHERENCE_PREFIX
.boolean
isResolvable(org.springframework.boot.context.config.ConfigDataLocationResolverContext context, org.springframework.boot.context.config.ConfigDataLocation location)
Will return true only if the providedConfigDataLocation
has the prefix as defined bygetPrefix()
and if the configuration for the Coherence backend is enabled.protected CoherenceConfigClientProperties
loadProperties(org.springframework.boot.context.config.ConfigDataLocationResolverContext context)
Load theCoherenceConfigClientProperties
.List<CoherenceConfigDataResource>
resolve(org.springframework.boot.context.config.ConfigDataLocationResolverContext context, org.springframework.boot.context.config.ConfigDataLocation location)
Not used.List<CoherenceConfigDataResource>
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 Detail
-
logger
protected static final Log logger
-
COHERENCE_PREFIX
public static final String COHERENCE_PREFIX
Prefix used to indicate aCoherenceConfigDataResource
.- See Also:
- Constant Field Values
-
-
Method Detail
-
isResolvable
public boolean isResolvable(org.springframework.boot.context.config.ConfigDataLocationResolverContext context, org.springframework.boot.context.config.ConfigDataLocation location)
Will return true only if the providedConfigDataLocation
has the prefix as defined bygetPrefix()
and if the configuration for the Coherence backend is enabled.- Specified by:
isResolvable
in 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:
CoherenceConfigClientProperties
-
getPrefix
protected String 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:
resolve
in 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:
resolveProfileSpecific
in 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.name
if 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
-
-