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
Modifier and TypeFieldDescriptionstatic final SystemPropertyPreprocessor
This singleton instance of theSystemPropertyPreprocessor
. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
preprocess
(ProcessingContext context, XmlElement element) Process anXmlElement
, optionally mutating it (or it's children) if required.static boolean
processValueMacro
(XmlElement element) Process macros embedded in element's valuestatic boolean
processValueMacro
(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
XmlElement
s. If you wish to manually traverse or change the entire document, you should instead use aDocumentPreprocessor
.- Specified by:
preprocess
in interfaceDocumentElementPreprocessor.ElementPreprocessor
- Parameters:
context
- theProcessingContext
in which the pre-processing is occurringelement
- theXmlElement
to preprocess- Returns:
true
if the specifiedXmlElement
should be re-preprocessed by this and otherDocumentElementPreprocessor.ElementPreprocessor
s due to theXmlElement
being modified,false
otherwise.- Throws:
ConfigurationException
- if during pre-processing of theXmlElement
a configuration issue was discovered (or if pre-processing fails for some reason)
-
processValueMacro
Process macros embedded in element's value- Parameters:
element
- theXmlElement
to preprocess- Returns:
- true iff the String value of element was macro expanded
-
processValueMacro
Process macros embedded in element's value- Parameters:
element
- theXmlElement
to preprocessresolver
- theParameterResolver
to use to resolve macro values- Returns:
- true iff the String value of element was macro expanded
-