hudson.plugins.perforce
Class HudsonPipedOutputStream

java.lang.Object
  extended by java.io.OutputStream
      extended by java.io.PipedOutputStream
          extended by hudson.plugins.perforce.HudsonPipedOutputStream
All Implemented Interfaces:
java.io.Closeable, java.io.Flushable

public class HudsonPipedOutputStream
extends java.io.PipedOutputStream

Extended class of PipedOutputStream, used specifically for passing into hudson launcher.launch() calls. The extra closeOnProcess method is required as launcher.launch() does NOT close its output stream, which will cause a deadlock if using read calls (that block) to read data.

The Hudson method in question that doesn't close it's output stream is StreamCopyThread.class.

User contract: After calling launcher.launch(), pass its process into closeOnProcess().

Example: HudsonPipedOutputStream hudsonOut = new HudsonPipedOutputStream(); Proc process = hudsonLauncher.launch(cmd,env,hudsonOut,filePath); hudsonOut.closeOnProcess(process);

Author:
Victor Szoltysek

Constructor Summary
HudsonPipedOutputStream()
           
 
Method Summary
 void closeOnProcess(hudson.Proc process)
           
 
Methods inherited from class java.io.PipedOutputStream
close, connect, flush, write, write
 
Methods inherited from class java.io.OutputStream
write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HudsonPipedOutputStream

public HudsonPipedOutputStream()
Method Detail

closeOnProcess

public void closeOnProcess(hudson.Proc process)


Copyright © 2010. All Rights Reserved.