Class SystemPropertyPreprocessor
java.lang.Object
com.tangosol.coherence.config.xml.preprocessor.SystemPropertyPreprocessor
- All Implemented Interfaces:
DocumentElementPreprocessor.ElementPreprocessor
public class SystemPropertyPreprocessor
extends Object
implements DocumentElementPreprocessor.ElementPreprocessor
A
SystemPropertyPreprocessor is an DocumentElementPreprocessor.ElementPreprocessor that will
replace XmlElement content annotated with "system-property" attributes with appropriate
System.getProperties().
The element's value is processed for macro expansion. The macro syntax is ${system-property default-value}. Thus, a value of near-${coherence.client direct} can be macro expanded by default to near-direct. If system property coherence.client is set to remote, then the value would be expanded to near-remote.
- Since:
- Coherence 12.1.2
- Author:
- bo 2011.08.03
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final SystemPropertyPreprocessorThis singleton instance of theSystemPropertyPreprocessor. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanpreprocess(ProcessingContext context, XmlElement element) Process anXmlElement, optionally mutating it (or it's children) if required.static booleanprocessValueMacro(XmlElement element) Process macros embedded in element's valuestatic booleanprocessValueMacro(XmlElement element, ParameterResolver resolver) Process macros embedded in element's value
-
Field Details
-
INSTANCE
This singleton instance of theSystemPropertyPreprocessor.
-
-
Constructor Details
-
SystemPropertyPreprocessor
public SystemPropertyPreprocessor()
-
-
Method Details
-
preprocess
public boolean preprocess(ProcessingContext context, XmlElement element) throws ConfigurationException Process anXmlElement, optionally mutating it (or it's children) if required.Note: An implementation of this interface should avoid attempting to traverse child
XmlElements. If you wish to manually traverse or change the entire document, you should instead use aDocumentPreprocessor.- Specified by:
preprocessin interfaceDocumentElementPreprocessor.ElementPreprocessor- Parameters:
context- theProcessingContextin which the pre-processing is occurringelement- theXmlElementto preprocess- Returns:
trueif the specifiedXmlElementshould be re-preprocessed by this and otherDocumentElementPreprocessor.ElementPreprocessors due to theXmlElementbeing modified,falseotherwise.- Throws:
ConfigurationException- if during pre-processing of theXmlElementa configuration issue was discovered (or if pre-processing fails for some reason)
-
processValueMacro
Process macros embedded in element's value- Parameters:
element- theXmlElementto preprocess- Returns:
- true iff the String value of element was macro expanded
-
processValueMacro
Process macros embedded in element's value- Parameters:
element- theXmlElementto preprocessresolver- theParameterResolverto use to resolve macro values- Returns:
- true iff the String value of element was macro expanded
-