org.apache.commons.pipeline.stage
Class LogStage

java.lang.Object
  extended by org.apache.commons.pipeline.stage.BaseStage
      extended by org.apache.commons.pipeline.stage.LogStage
All Implemented Interfaces:
Stage

public class LogStage
extends BaseStage

A do-nothing implementation of Stage that simply logs the state of processing. and each object seen by its process(Object) method. Useful for debugging purposes.


Field Summary
 
Fields inherited from class org.apache.commons.pipeline.stage.BaseStage
context
 
Constructor Summary
LogStage()
          Creates a new LogStage.
 
Method Summary
 void postprocess()
          Logs tht point at which postprocessing runs
 void preprocess()
          Logs the point at which preprocessing runs.
 void process(Object obj)
          Logs the current state of an object on the queue and passes the object unchanged to the next stage in the pipeline.
 void release()
          Logs the point at which stage resources are released.
 void setLog(Class clazz)
          Sets the logger based upon the specified class.
 void setLog(org.apache.commons.logging.Log log)
          Sets the logger.
 void setLog(String logName)
          Sets the logger based upon the log name.
 
Methods inherited from class org.apache.commons.pipeline.stage.BaseStage
emit, emit, init
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LogStage

public LogStage()
Creates a new LogStage.

Method Detail

preprocess

public void preprocess()
                throws StageException
Logs the point at which preprocessing runs.

Specified by:
preprocess in interface Stage
Overrides:
preprocess in class BaseStage
Throws:
StageException - an Exception thrown by an overriding implementation should be wrapped in a StageException
See Also:
Stage.preprocess()

process

public void process(Object obj)
             throws StageException
Logs the current state of an object on the queue and passes the object unchanged to the next stage in the pipeline.

Specified by:
process in interface Stage
Overrides:
process in class BaseStage
Parameters:
obj - Object to be passed to downstream pipeline.
Throws:
StageException - an Exception thrown by an overriding implementation should be wrapped in a StageException

postprocess

public void postprocess()
                 throws StageException
Logs tht point at which postprocessing runs

Specified by:
postprocess in interface Stage
Overrides:
postprocess in class BaseStage
Throws:
StageException - an Exception thrown by an overriding implementation should be wrapped in a StageException

release

public void release()
Logs the point at which stage resources are released.

Specified by:
release in interface Stage
Overrides:
release in class BaseStage
See Also:
Stage.release()

setLog

public void setLog(org.apache.commons.logging.Log log)
Sets the logger.


setLog

public void setLog(String logName)
Sets the logger based upon the log name.


setLog

public void setLog(Class clazz)
Sets the logger based upon the specified class.



Copyright © 2004-2009 The Apache Software Foundation. All Rights Reserved.