org.codehaus.groovy.maven.common
Class SystemOutputHijacker

java.lang.Object
  extended by org.codehaus.groovy.maven.common.SystemOutputHijacker

public class SystemOutputHijacker
extends java.lang.Object

Hijacks the systems standard output and error streams on a per-thread basis and redirects to given streams.

Version:
$Id: SystemOutputHijacker.java 13181 2008-08-10 14:05:55Z user57 $
Author:
Jason Dillon

Constructor Summary
SystemOutputHijacker()
           
 
Method Summary
static void deregister()
          Reregister streams for the current thread, and restore the previous if any.
static void install()
          Install the hijacker.
static void install(java.io.PrintStream out)
          Install the hijacker and register combinded streams for the current thread.
static void install(java.io.PrintStream out, java.io.PrintStream err)
          Install the hijacker and register streams for the current thread.
static boolean isInstalled()
          Check if the hijacker has been installed.
static boolean isRegistered()
          Check if there are streams registered for the current thread.
static void register(java.io.PrintStream out)
          Register combinded streams for the current thread.
static void register(java.io.PrintStream out, java.io.PrintStream err)
          Register streams for the current thread.
static void register(StreamPair pair)
          Register streams for the current thread.
static void restore()
          Restores the original System streams from StreamPair.SYSTEM and resets the hijacker state to uninstalled.
static void restore(StreamPair streams)
          Restores the System streams to the given pair and resets the hijacker state to uninstalled.
static void uninstall()
          Uninstall the hijacker.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SystemOutputHijacker

public SystemOutputHijacker()
Method Detail

isInstalled

public static boolean isInstalled()
Check if the hijacker has been installed.


install

public static void install()
Install the hijacker.


install

public static void install(java.io.PrintStream out,
                           java.io.PrintStream err)
Install the hijacker and register streams for the current thread.


install

public static void install(java.io.PrintStream out)
Install the hijacker and register combinded streams for the current thread.


uninstall

public static void uninstall()
Uninstall the hijacker.


isRegistered

public static boolean isRegistered()
Check if there are streams registered for the current thread.


register

public static void register(java.io.PrintStream out,
                            java.io.PrintStream err)
Register streams for the current thread.


register

public static void register(java.io.PrintStream out)
Register combinded streams for the current thread.


register

public static void register(StreamPair pair)
Register streams for the current thread.


deregister

public static void deregister()
Reregister streams for the current thread, and restore the previous if any.


restore

public static void restore(StreamPair streams)
Restores the System streams to the given pair and resets the hijacker state to uninstalled.


restore

public static void restore()
Restores the original System streams from StreamPair.SYSTEM and resets the hijacker state to uninstalled.



Copyright © 2006-2010 Codehaus. All Rights Reserved.