Class MappingLogEventWriter
java.lang.Object
org.jpos.util.BaseLogEventWriter
org.jpos.util.MappingLogEventWriter
- All Implemented Interfaces:
XmlConfigurable, LogEventWriter
LogEventWriter that can be configured with event and output mappers to modify
the events before writing to output stream and modify the output stream before writing
to the final destination respectfully.
Example configuration:
<writer class="org.jpos.util.MappingLogEventWriter">
<event-mapper class="...">
<property.... />
</event-mapper>
<event-mapper class="..."/>
<output-mapper class="...">
<property.... />
</output-mapper>
<output-mapper class="..."/>
</writer>
- Since:
- 2.1.4
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()protected voidprotected voidconfigureEventMappers(org.jdom2.Element e) protected voidconfigureOutputMappers(org.jdom2.Element e) protected voidThis method exists and is used so that we can verify the order of instructions during a call to write in unit tests.protected LogEventprotected byte[]mapOutput(byte[] output) voidsetConfiguration(org.jdom2.Element e) voidvoidprotected voidWrite to capture print stream when defined.
-
Constructor Details
-
MappingLogEventWriter
public MappingLogEventWriter()
-
-
Method Details
-
setPrintStream
- Specified by:
setPrintStreamin interfaceLogEventWriter- Overrides:
setPrintStreamin classBaseLogEventWriter
-
close
- Specified by:
closein interfaceLogEventWriter- Overrides:
closein classBaseLogEventWriter
-
write
- Specified by:
writein interfaceLogEventWriter- Overrides:
writein classBaseLogEventWriter
-
setConfiguration
- Specified by:
setConfigurationin interfaceXmlConfigurable- Parameters:
e- Configuration element- Throws:
ConfigurationException- on error
-
configureCaptureStreams
-
configureEventMappers
- Throws:
ConfigurationException
-
configureOutputMappers
- Throws:
ConfigurationException
-
mapEvents
-
mapOutput
-
delegateWriteToSuper
This method exists and is used so that we can verify the order of instructions during a call to write in unit tests.- Parameters:
ev- LogEvent to write.
-
writeToCaptureStream
Write to capture print stream when defined.- Parameters:
ev- LogEvent to write.
-