Class SharedThreadPoolStrategy
java.lang.Object
org.apache.maven.surefire.junitcore.pc.SchedulingStrategy
org.apache.maven.surefire.junitcore.pc.AbstractThreadPoolStrategy
org.apache.maven.surefire.junitcore.pc.SharedThreadPoolStrategy
- All Implemented Interfaces:
Destroyable
Parallel strategy for shared thread pool in private package.
- Since:
- 2.16
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Methods inherited from class org.apache.maven.surefire.junitcore.pc.AbstractThreadPoolStrategy
destroy, getFutureResults, getThreadPool, schedule, setDefaultShutdownHandler
Methods inherited from class org.apache.maven.surefire.junitcore.pc.SchedulingStrategy
canSchedule, disable, logQuietly
-
Constructor Details
-
SharedThreadPoolStrategy
SharedThreadPoolStrategy(ConsoleLogger logger, ExecutorService threadPool)
-
-
Method Details
-
finished
Description copied from class:SchedulingStrategy
Waiting for scheduled tasks to finish. New tasks will not be scheduled by calling this method.- Specified by:
finished
in classSchedulingStrategy
- Returns:
true
if successfully stopped the scheduler, elsefalse
if already stopped (a shared thread pool was shutdown externally).- Throws:
InterruptedException
- if interrupted while waiting for scheduled tasks to finish- See Also:
-
RunnerScheduler.finished()
-
stop
protected boolean stop()Description copied from class:SchedulingStrategy
Stops scheduling new tasks (e.g. byExecutorService.shutdown()
on a private thread pool which cannot be shared with other strategy).- Overrides:
stop
in classAbstractThreadPoolStrategy
- Returns:
true
if successfully stopped the scheduler, elsefalse
if already stopped (a shared thread pool was shutdown externally).- See Also:
-
stopNow
protected boolean stopNow()Description copied from class:SchedulingStrategy
Stops scheduling new tasks andinterrupts
running tasks (e.g. byExecutorService.shutdownNow()
on a private thread pool which cannot be shared with other strategy).
This method callsSchedulingStrategy.stop()
by default.- Overrides:
stopNow
in classAbstractThreadPoolStrategy
- Returns:
true
if successfully stopped the scheduler, elsefalse
if already stopped (a shared thread pool was shutdown externally).- See Also:
-
stop
private boolean stop(boolean interrupt)