Class ThreadOutputMuxer
- java.lang.Object
-
- org.apache.maven.lifecycle.internal.builder.multithreaded.ThreadOutputMuxer
-
public class ThreadOutputMuxer extends java.lang.ObjectNOTE: This class is not part of any public api and can be changed or deleted without prior notice. This class in particular may spontaneously self-combust and be replaced by a plexus-compliant thread aware logger implementation at any time.- Since:
- 3.0
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) classThreadOutputMuxer.ConsolePrinterA simple but safe solution for printing to the console.private classThreadOutputMuxer.ThreadBoundPrintStream
-
Field Summary
Fields Modifier and Type Field Description private java.util.Set<ProjectSegment>completedBuildsprivate ProjectSegmentcurrentBuildprivate java.io.ByteArrayOutputStreamdefaultOutputStreamForUnknownDataprivate java.io.PrintStreamdefaultPrintStreamprivate java.io.PrintStreamoriginalSystemOUtStreamprivate ThreadOutputMuxer.ConsolePrinterprinterprivate java.util.Map<ProjectSegment,java.io.PrintStream>printStreamsprivate java.lang.ThreadLocal<ProjectSegment>projectBuildThreadLocalprivate java.util.Iterator<ProjectSegment>projectsprivate java.util.Map<ProjectSegment,java.io.ByteArrayOutputStream>streams
-
Constructor Summary
Constructors Constructor Description ThreadOutputMuxer(ProjectBuildList segmentChunks, java.io.PrintStream originalSystemOut)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidassociateThreadWithProjectSegment(ProjectSegment projectBuild)voidclose()private voiddisconnectThreadFromProject()private java.io.PrintStreamgetThreadBoundPrintStream()private booleanownsRealOutputStream(ProjectSegment projectBuild)private voidsetNext()voidsetThisModuleComplete(ProjectSegment projectBuild)
-
-
-
Field Detail
-
projects
private final java.util.Iterator<ProjectSegment> projects
-
projectBuildThreadLocal
private final java.lang.ThreadLocal<ProjectSegment> projectBuildThreadLocal
-
streams
private final java.util.Map<ProjectSegment,java.io.ByteArrayOutputStream> streams
-
printStreams
private final java.util.Map<ProjectSegment,java.io.PrintStream> printStreams
-
defaultOutputStreamForUnknownData
private final java.io.ByteArrayOutputStream defaultOutputStreamForUnknownData
-
defaultPrintStream
private final java.io.PrintStream defaultPrintStream
-
completedBuilds
private final java.util.Set<ProjectSegment> completedBuilds
-
currentBuild
private volatile ProjectSegment currentBuild
-
originalSystemOUtStream
private final java.io.PrintStream originalSystemOUtStream
-
printer
private final ThreadOutputMuxer.ConsolePrinter printer
-
-
Constructor Detail
-
ThreadOutputMuxer
public ThreadOutputMuxer(ProjectBuildList segmentChunks, java.io.PrintStream originalSystemOut)
-
-
Method Detail
-
close
public void close()
-
setNext
private void setNext()
-
ownsRealOutputStream
private boolean ownsRealOutputStream(ProjectSegment projectBuild)
-
getThreadBoundPrintStream
private java.io.PrintStream getThreadBoundPrintStream()
-
associateThreadWithProjectSegment
public void associateThreadWithProjectSegment(ProjectSegment projectBuild)
-
setThisModuleComplete
public void setThisModuleComplete(ProjectSegment projectBuild)
-
disconnectThreadFromProject
private void disconnectThreadFromProject()
-
-