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
ASystemPropertyPreprocessor
is anDocumentElementPreprocessor.ElementPreprocessor
that will replaceXmlElement
content annotated with "system-property" attributes with appropriateSystem.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
Fields Modifier and Type Field Description static SystemPropertyPreprocessor
INSTANCE
This singleton instance of theSystemPropertyPreprocessor
.
-
Constructor Summary
Constructors Constructor Description SystemPropertyPreprocessor()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
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 Detail
-
INSTANCE
public static final SystemPropertyPreprocessor INSTANCE
This singleton instance of theSystemPropertyPreprocessor
.
-
-
Method Detail
-
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
public static boolean processValueMacro(XmlElement element)
Process macros embedded in element's value- Parameters:
element
- theXmlElement
to preprocess- Returns:
- true iff the String value of element was macro expanded
-
processValueMacro
public static boolean processValueMacro(XmlElement element, ParameterResolver resolver)
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
-
-