Class DefaultConsoleInterceptionAggregator
- java.lang.Object
-
- de.gebit.integrity.runner.console.intercept.DefaultConsoleInterceptionAggregator
-
- All Implemented Interfaces:
ConsoleInterceptionAggregator
public class DefaultConsoleInterceptionAggregator extends java.lang.Object implements ConsoleInterceptionAggregator
Default implementation of an interception aggregator. This one uses theConsoleOutputInterceptor
to do the actual intercepting.- Author:
- Rene Schneider - initial API and implementation
-
-
Field Summary
Fields Modifier and Type Field Description protected Intercept
currentIntercept
The currently active interception job.protected java.lang.Object
interceptionSync
A sync object used to synchronize access to the interception buffer.protected ConsoleOutputInterceptor
interceptor
The interceptor service.protected ConsoleInterceptorTarget
interceptorTarget
The interceptor target used to receive intercepted lines.protected boolean
interceptPaused
Whether interception is temporarily paused.
-
Constructor Summary
Constructors Constructor Description DefaultConsoleInterceptionAggregator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
pauseIntercept()
Pauses interception.void
resumeIntercept()
Resumes a paused interception.Intercept
retrieveIntercept()
Returns a single interception job.void
startIntercept()
Starts interception.void
stopIntercept()
Stops interception.
-
-
-
Field Detail
-
interceptionSync
protected final java.lang.Object interceptionSync
A sync object used to synchronize access to the interception buffer.
-
currentIntercept
protected Intercept currentIntercept
The currently active interception job.
-
interceptPaused
protected volatile boolean interceptPaused
Whether interception is temporarily paused. This flag is used for quick and lightweight interception pauses.
-
interceptorTarget
protected ConsoleInterceptorTarget interceptorTarget
The interceptor target used to receive intercepted lines.
-
interceptor
@Inject protected ConsoleOutputInterceptor interceptor
The interceptor service.
-
-
Method Detail
-
startIntercept
public void startIntercept()
Description copied from interface:ConsoleInterceptionAggregator
Starts interception. Must be called at least once. May be called repeatedly without any effect.- Specified by:
startIntercept
in interfaceConsoleInterceptionAggregator
-
stopIntercept
public void stopIntercept()
Description copied from interface:ConsoleInterceptionAggregator
Stops interception. Must be called at some point in time if an interception has been started! Can be called repeatedly without any effect.- Specified by:
stopIntercept
in interfaceConsoleInterceptionAggregator
-
pauseIntercept
public void pauseIntercept()
Description copied from interface:ConsoleInterceptionAggregator
Pauses interception. Streams are kept hooked; this command can thus be called often without negative effects on performance.- Specified by:
pauseIntercept
in interfaceConsoleInterceptionAggregator
-
resumeIntercept
public void resumeIntercept()
Description copied from interface:ConsoleInterceptionAggregator
Resumes a paused interception.- Specified by:
resumeIntercept
in interfaceConsoleInterceptionAggregator
-
retrieveIntercept
public Intercept retrieveIntercept()
Description copied from interface:ConsoleInterceptionAggregator
Returns a single interception job. This automatically starts a new interception job.- Specified by:
retrieveIntercept
in interfaceConsoleInterceptionAggregator
- Returns:
- the intercept job
-
-