org.apache.avalon.excalibur.logger.util
Class AvalonTee

java.lang.Object
  extended byorg.apache.avalon.excalibur.logger.util.AvalonTee
All Implemented Interfaces:
Configurable, Contextualizable, Disposable, LogEnabled, Startable
Direct Known Subclasses:
LoggerManagerTee

public class AvalonTee
extends java.lang.Object
implements LogEnabled, Contextualizable, Configurable, Startable, Disposable

This class broadcasts Avalon lifestyle events to several destination objects, somewhat like Unix 'tee' command directing its input both to file and to its output. The current implementation is incomplete and handles only LogEnabled, Contextutalizable, Configurable and Disposable interfaces.

Since:
4.0
Version:
CVS $Revision: 1.4 $ $Date: 2004/03/10 13:54:51 $
Author:
Avalon Development Team

Constructor Summary
AvalonTee()
           
 
Method Summary
 void addTee(java.lang.Object obj)
          Adds an object to the list of objects receiving events.
 void configure(Configuration config)
          Pass the Configuration to the Configurable class.
 void contextualize(Context context)
          Pass the Context to the component.
 void dispose()
          The dispose operation is called at the end of a components lifecycle.
 void enableLogging(Logger logger)
          Provide component with a logger.
 void makeReadOnly()
          Disallow adding more tees.
 void start()
          Starts the component.
 void stop()
          Stops the component.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AvalonTee

public AvalonTee()
Method Detail

makeReadOnly

public void makeReadOnly()
Disallow adding more tees.


addTee

public void addTee(java.lang.Object obj)
Adds an object to the list of objects receiving events.

Parameters:
obj - the object to add; can not be null.

enableLogging

public void enableLogging(Logger logger)
Description copied from interface: LogEnabled
Provide component with a logger.

Specified by:
enableLogging in interface LogEnabled
Parameters:
logger - the logger. Must not be null.

contextualize

public void contextualize(Context context)
                   throws ContextException
Description copied from interface: Contextualizable
Pass the Context to the component. This method is called after the LogEnabled.enableLogging( Logger ) (if present) method and before any other method.

Specified by:
contextualize in interface Contextualizable
Parameters:
context - the context. Must not be null.
Throws:
ContextException - if context is invalid

configure

public void configure(Configuration config)
               throws ConfigurationException
Description copied from interface: Configurable
Pass the Configuration to the Configurable class.

Specified by:
configure in interface Configurable
Parameters:
config - the class configurations. Must not be null.
Throws:
ConfigurationException - if an error occurs

start

public void start()
           throws java.lang.Exception
Description copied from interface: Startable
Starts the component.

Specified by:
start in interface Startable
Throws:
java.lang.Exception - if Component can not be started

stop

public void stop()
          throws java.lang.Exception
Description copied from interface: Startable
Stops the component.

Specified by:
stop in interface Startable
Throws:
java.lang.Exception - if the Component can not be Stopped.

dispose

public void dispose()
Description copied from interface: Disposable
The dispose operation is called at the end of a components lifecycle. This method will be called after Startable.stop() method (if implemented by component). Components use this method to release and destroy any resources that the Component owns.

Specified by:
dispose in interface Disposable


Copyright © 1997-2005 The Apache Software Foundation. All Rights Reserved.