Interface ConsoleOutputInterceptor
-
- All Known Implementing Classes:
DefaultConsoleOutputInterceptor
public interface ConsoleOutputInterceptor
Performs interception of both console output streams (stdout and stderr). The implementation of this interface is responsible for the actual capture, including splitting data into lines and sending those lines to a number of targets. Since this service knows the real console output streams, it can be used to print strings on the real streams, whether they are being intercepted or not.- Author:
- Rene Schneider - initial API and implementation
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
printlnStdErr(java.lang.String aLine)
Prints a line on the original System.err stream, including an added newline.void
printlnStdOut(java.lang.String aLine)
Prints a line on the original System.out stream, including an added newline.void
printStdErr(java.lang.String aText)
Prints text on the original System.err stream.void
printStdOut(java.lang.String aText)
Prints text on the original System.out stream.void
registerTarget(ConsoleInterceptorTarget aTarget)
Registers a target for intercepted data.void
unregisterTarget(ConsoleInterceptorTarget aTarget)
Unregisters a registered target.
-
-
-
Method Detail
-
registerTarget
void registerTarget(ConsoleInterceptorTarget aTarget)
Registers a target for intercepted data.- Parameters:
aTarget
- the target to register
-
unregisterTarget
void unregisterTarget(ConsoleInterceptorTarget aTarget)
Unregisters a registered target.- Parameters:
aTarget
- the target to unregister
-
printlnStdErr
void printlnStdErr(java.lang.String aLine)
Prints a line on the original System.err stream, including an added newline. Automatically flushes the stream.- Parameters:
aLine
- the line- See Also:
PrintWriter.println(String)
-
printStdErr
void printStdErr(java.lang.String aText)
Prints text on the original System.err stream.- Parameters:
aText
- the text to print- See Also:
PrintWriter.print(String)
-
printlnStdOut
void printlnStdOut(java.lang.String aLine)
Prints a line on the original System.out stream, including an added newline. Automatically flushes the stream.- Parameters:
aLine
- the line- See Also:
PrintWriter.println(String)
-
printStdOut
void printStdOut(java.lang.String aText)
Prints text on the original System.out stream.- Parameters:
aText
- the text to print- See Also:
PrintWriter.print(String)
-
-