Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.eireneh.util.event
Class StdOutCaptureListener  view StdOutCaptureListener download StdOutCaptureListener.java

java.lang.Object
  extended bycom.eireneh.util.event.StdOutCaptureListener
All Implemented Interfaces:
CaptureListener, java.util.EventListener, ReporterListener

public class StdOutCaptureListener
extends java.lang.Object
implements CaptureListener, ReporterListener

This class listens to Reporter captures and copies them to a stream.
Distribution Licence:
Project B is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2 as published by the Free Software Foundation.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
The License is available on the internet here, by writing to Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA, Or locally at the Licence link below.
The copyright to this program is held by it's authors.


Field Summary
private static StdOutCaptureListener inform
          The listener for the inform service
private static StdOutCaptureListener logger
          The listener for the logging service
private  java.io.PrintStream out
          The stream to log to
 
Constructor Summary
StdOutCaptureListener()
           
 
Method Summary
 void captureException(CaptureEvent ev)
          Called whenever Reporter.informUser() is passed an Exception
 void captureMessage(CaptureEvent ev)
          Called whenever Reporter.informUser() is passed a message
static boolean getHelpDeskInformListener()
          Get the listening status
static boolean getHelpDeskLogListener()
          Get the listening status
private  void println(java.lang.Throwable ex)
          Actually println the Throwable and recurse if needed
 void reportException(ReporterEvent ev)
          Called whenever Reporter.informUser() is passed an Exception
 void reportMessage(ReporterEvent ev)
          Called whenever Reporter.informUser() is passed a message
static void setHelpDeskInformListener(boolean joined)
          You must call setHelpDeskListener() in order to start displaying Exceptions sent to the Log, and in order to properly close this class you must call it again (with false).
static void setHelpDeskLogListener(boolean joined)
          You must call setHelpDeskListener() in order to start logging messages sent to the Log, and in order to properly close this class you must call it again (with false).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

out

private java.io.PrintStream out
The stream to log to


logger

private static StdOutCaptureListener logger
The listener for the logging service


inform

private static StdOutCaptureListener inform
The listener for the inform service

Constructor Detail

StdOutCaptureListener

public StdOutCaptureListener()
Method Detail

captureException

public void captureException(CaptureEvent ev)
Called whenever Reporter.informUser() is passed an Exception

Specified by:
captureException in interface CaptureListener

captureMessage

public void captureMessage(CaptureEvent ev)
Called whenever Reporter.informUser() is passed a message

Specified by:
captureMessage in interface CaptureListener

reportException

public void reportException(ReporterEvent ev)
Called whenever Reporter.informUser() is passed an Exception

Specified by:
reportException in interface ReporterListener

reportMessage

public void reportMessage(ReporterEvent ev)
Called whenever Reporter.informUser() is passed a message

Specified by:
reportMessage in interface ReporterListener

println

private void println(java.lang.Throwable ex)
Actually println the Throwable and recurse if needed


setHelpDeskInformListener

public static void setHelpDeskInformListener(boolean joined)
You must call setHelpDeskListener() in order to start displaying Exceptions sent to the Log, and in order to properly close this class you must call it again (with false).


getHelpDeskInformListener

public static boolean getHelpDeskInformListener()
Get the listening status


setHelpDeskLogListener

public static void setHelpDeskLogListener(boolean joined)
You must call setHelpDeskListener() in order to start logging messages sent to the Log, and in order to properly close this class you must call it again (with false).


getHelpDeskLogListener

public static boolean getHelpDeskLogListener()
Get the listening status