Class DefaultConsoleInterceptionAggregator
- java.lang.Object
-
- de.gebit.integrity.runner.console.intercept.DefaultConsoleInterceptionAggregator
-
- All Implemented Interfaces:
ConsoleInterceptionAggregator
public class DefaultConsoleInterceptionAggregator extends Object implements ConsoleInterceptionAggregator
Default implementation of an interception aggregator. This one uses theConsoleOutputInterceptorto do the actual intercepting.- Author:
- Rene Schneider - initial API and implementation
-
-
Field Summary
Fields Modifier and Type Field Description protected InterceptcurrentInterceptThe currently active interception job.protected ObjectinterceptionSyncA sync object used to synchronize access to the interception buffer.protected ConsoleOutputInterceptorinterceptorThe interceptor service.protected ConsoleInterceptorTargetinterceptorTargetThe interceptor target used to receive intercepted lines.protected booleaninterceptPausedWhether interception is temporarily paused.
-
Constructor Summary
Constructors Constructor Description DefaultConsoleInterceptionAggregator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidpauseIntercept()Pauses interception.voidresumeIntercept()Resumes a paused interception.InterceptretrieveIntercept()Returns a single interception job.voidstartIntercept()Starts interception.voidstopIntercept()Stops interception.
-
-
-
Field Detail
-
interceptionSync
protected final 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:ConsoleInterceptionAggregatorStarts interception. Must be called at least once. May be called repeatedly without any effect.- Specified by:
startInterceptin interfaceConsoleInterceptionAggregator
-
stopIntercept
public void stopIntercept()
Description copied from interface:ConsoleInterceptionAggregatorStops interception. Must be called at some point in time if an interception has been started! Can be called repeatedly without any effect.- Specified by:
stopInterceptin interfaceConsoleInterceptionAggregator
-
pauseIntercept
public void pauseIntercept()
Description copied from interface:ConsoleInterceptionAggregatorPauses interception. Streams are kept hooked; this command can thus be called often without negative effects on performance.- Specified by:
pauseInterceptin interfaceConsoleInterceptionAggregator
-
resumeIntercept
public void resumeIntercept()
Description copied from interface:ConsoleInterceptionAggregatorResumes a paused interception.- Specified by:
resumeInterceptin interfaceConsoleInterceptionAggregator
-
retrieveIntercept
public Intercept retrieveIntercept()
Description copied from interface:ConsoleInterceptionAggregatorReturns a single interception job. This automatically starts a new interception job.- Specified by:
retrieveInterceptin interfaceConsoleInterceptionAggregator- Returns:
- the intercept job
-
-