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 ofConfigSource
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
- Since:
- 20.06
- Author:
- Aleks Seovic 2019.10.12
-
-
Field Summary
Fields Modifier and Type Field Description static String
ORDINAL_PROPERTY
The name of the system property that can be used to change the ordinal for thisConfigSource
.
-
Constructor Summary
Constructors Constructor Description CoherenceConfigSource()
ConstructCoherenceConfigSource
instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description NamedMap<String,String>
getConfigMap()
For testing.String
getName()
int
getOrdinal()
Map<String,String>
getProperties()
String
getValue(String key)
void
introduceEventDispatcher(String sIdentifier, EventDispatcher dispatcher)
Introduce and possibly bind thisEventInterceptor
to the specifiedEventDispatcher
.void
onEvent(CacheLifecycleEvent event)
Perform necessary processing of the specifiedEvent
.String
setValue(String sKey, String sValue)
Set the value of a configuration property.
-
-
-
Field Detail
-
ORDINAL_PROPERTY
public static final String ORDINAL_PROPERTY
The name of the system property that can be used to change the ordinal for thisConfigSource
.- See Also:
- Constant Field Values
-
-
Method Detail
-
getProperties
public Map<String,String> getProperties()
- Specified by:
getProperties
in interfaceorg.eclipse.microprofile.config.spi.ConfigSource
-
getOrdinal
public int getOrdinal()
- Specified by:
getOrdinal
in interfaceorg.eclipse.microprofile.config.spi.ConfigSource
-
getValue
public String getValue(String key)
- Specified by:
getValue
in interfaceorg.eclipse.microprofile.config.spi.ConfigSource
-
getName
public String getName()
- Specified by:
getName
in interfaceorg.eclipse.microprofile.config.spi.ConfigSource
-
setValue
public String setValue(String sKey, String sValue)
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
public void introduceEventDispatcher(String sIdentifier, EventDispatcher dispatcher)
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
public void onEvent(CacheLifecycleEvent event)
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:
Event.nextInterceptor()
-
-