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 ofConfigSourcethat 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.ordinalconfig 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 StringORDINAL_PROPERTYThe name of the system property that can be used to change the ordinal for thisConfigSource.
-
Constructor Summary
Constructors Constructor Description CoherenceConfigSource()ConstructCoherenceConfigSourceinstance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description NamedMap<String,String>getConfigMap()For testing.StringgetName()intgetOrdinal()Map<String,String>getProperties()StringgetValue(String key)voidintroduceEventDispatcher(String sIdentifier, EventDispatcher dispatcher)Introduce and possibly bind thisEventInterceptorto the specifiedEventDispatcher.voidonEvent(CacheLifecycleEvent event)Perform necessary processing of the specifiedEvent.StringsetValue(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:
getPropertiesin interfaceorg.eclipse.microprofile.config.spi.ConfigSource
-
getOrdinal
public int getOrdinal()
- Specified by:
getOrdinalin interfaceorg.eclipse.microprofile.config.spi.ConfigSource
-
getValue
public String getValue(String key)
- Specified by:
getValuein interfaceorg.eclipse.microprofile.config.spi.ConfigSource
-
getName
public String getName()
- Specified by:
getNamein 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:EventDispatcherAwareInterceptorIntroduce and possibly bind thisEventInterceptorto 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:
introduceEventDispatcherin interfaceEventDispatcherAwareInterceptor<CacheLifecycleEvent>- Parameters:
sIdentifier- the unique name identifying this interceptordispatcher- the dispatcher being introduced
-
onEvent
public void onEvent(CacheLifecycleEvent event)
Description copied from interface:EventInterceptorPerform necessary processing of the specifiedEvent.- Specified by:
onEventin interfaceEventInterceptor<CacheLifecycleEvent>- Parameters:
event- the Event to be processed- See Also:
Event.nextInterceptor()
-
-