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
FieldsModifier and TypeFieldDescriptionstatic final StringThe 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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionFor testing.getName()intvoidintroduceEventDispatcher(String sIdentifier, EventDispatcher dispatcher) Introduce and possibly bind thisEventInterceptorto the specifiedEventDispatcher.voidonEvent(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()ConstructCoherenceConfigSourceinstance.
-
-
Method Details
-
getProperties
- Specified by:
getPropertiesin interfaceorg.eclipse.microprofile.config.spi.ConfigSource
-
getPropertyNames
- Specified by:
getPropertyNamesin interfaceorg.eclipse.microprofile.config.spi.ConfigSource
-
getOrdinal
public int getOrdinal()- Specified by:
getOrdinalin interfaceorg.eclipse.microprofile.config.spi.ConfigSource
-
getValue
- Specified by:
getValuein interfaceorg.eclipse.microprofile.config.spi.ConfigSource
-
getName
- Specified by:
getNamein 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: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
Description copied from interface:EventInterceptorPerform necessary processing of the specifiedEvent.- Specified by:
onEventin interfaceEventInterceptor<CacheLifecycleEvent>- Parameters:
event- the Event to be processed- See Also:
-
getConfigMap
For testing.- Returns:
- internal config map
-