Package com.oracle.coherence.mp.config
Class CoherenceConfigSource
java.lang.Object
com.oracle.coherence.mp.config.CoherenceConfigSource
- All Implemented Interfaces:
EventDispatcherAwareInterceptor<CacheLifecycleEvent>
,EventInterceptor<CacheLifecycleEvent>
,org.eclipse.microprofile.config.spi.ConfigSource
@ApplicationScoped
public class CoherenceConfigSource
extends Object
implements org.eclipse.microprofile.config.spi.ConfigSource, EventDispatcherAwareInterceptor<CacheLifecycleEvent>
An implementation of
ConfigSource
that reads configuration properties from a Coherence map.
Be default, this config source has the ordinal of 500. That implies that
any config properties in it will override properties with the same name from
standard MP config sources (files, environment variables and Java system
properties). The ordinal value can be changed via coherence.config.ordinal
config property.
This config source is also mutable. It can be injected into any application class by the CDI container, and the values can be modified by calling invalid input: '{@link /*missing*/}'
- Since:
- 20.06
- Author:
- Aleks Seovic 2019.10.12
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
The name of the system property that can be used to change the ordinal for thisConfigSource
.Fields inherited from interface org.eclipse.microprofile.config.spi.ConfigSource
CONFIG_ORDINAL
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionFor testing.getName()
int
void
introduceEventDispatcher
(String sIdentifier, EventDispatcher dispatcher) Introduce and possibly bind thisEventInterceptor
to the specifiedEventDispatcher
.void
onEvent
(CacheLifecycleEvent event) Perform necessary processing of the specifiedEvent
.Set the value of a configuration property.
-
Field Details
-
ORDINAL_PROPERTY
The name of the system property that can be used to change the ordinal for thisConfigSource
.- See Also:
-
-
Constructor Details
-
CoherenceConfigSource
public CoherenceConfigSource()ConstructCoherenceConfigSource
instance.
-
-
Method Details
-
getProperties
- Specified by:
getProperties
in interfaceorg.eclipse.microprofile.config.spi.ConfigSource
-
getPropertyNames
- Specified by:
getPropertyNames
in interfaceorg.eclipse.microprofile.config.spi.ConfigSource
-
getOrdinal
public int getOrdinal()- Specified by:
getOrdinal
in interfaceorg.eclipse.microprofile.config.spi.ConfigSource
-
getValue
- Specified by:
getValue
in interfaceorg.eclipse.microprofile.config.spi.ConfigSource
-
getName
- Specified by:
getName
in interfaceorg.eclipse.microprofile.config.spi.ConfigSource
-
setValue
Set the value of a configuration property.- Parameters:
sKey
- configuration property keysValue
- the new value to set- Returns:
- the previous value of the specified configuration property
-
introduceEventDispatcher
Description copied from interface:EventDispatcherAwareInterceptor
Introduce and possibly bind thisEventInterceptor
to the specifiedEventDispatcher
.Note that EventInterceptors are responsible for determining whether they should be registered with an EventDispatcher by calling
EventDispatcher.addEventInterceptor(com.tangosol.net.events.EventInterceptor<E>)
.- Specified by:
introduceEventDispatcher
in interfaceEventDispatcherAwareInterceptor<CacheLifecycleEvent>
- Parameters:
sIdentifier
- the unique name identifying this interceptordispatcher
- the dispatcher being introduced
-
onEvent
Description copied from interface:EventInterceptor
Perform necessary processing of the specifiedEvent
.- Specified by:
onEvent
in interfaceEventInterceptor<CacheLifecycleEvent>
- Parameters:
event
- the Event to be processed- See Also:
-
getConfigMap
For testing.- Returns:
- internal config map
-