net.sourceforge.esw.service.log
Class TransducerLog

java.lang.Object
  |
  +--net.sourceforge.esw.util.SupportObject
        |
        +--net.sourceforge.esw.service.AService
              |
              +--net.sourceforge.esw.service.ADefaultService
                    |
                    +--net.sourceforge.esw.service.log.ALog
                          |
                          +--net.sourceforge.esw.service.log.TransducerLog
All Implemented Interfaces:
ILog, IService, ISupportObject, java.io.Serializable
Direct Known Subclasses:
ReferenceLog

public class TransducerLog
extends ALog

Provides logging via ITransducer instances.

There are two ways to log using an this ILog instance. The first is to use the log(INode aNode) method. This requires that the INode instance contains INode instances that have the correct ID and data types. The second way is to use the log(ILogDatum aDatum) method. This is the preferred way to log data. Create a ILogDatum instance using the LogFactory.createLogDatum() method, then pass that ILogDatum instance to this ILog instance.

To create an instance of this ILog, see LogFactory.getLog().

Examples:

    TransducerLog log = new TransducerLog();
    log.setTransducer(new DefaultTransducer());
    ILogDatum datum = LogFactory.createLogDatum(new Date(),             // when
                                                "Machine Named George", // where
                                                5,                      // importance
                                                "A bad thing happened", // simple what
                                                myNode,                 // complex what
                                                "My App");              // who
    log.log( datum );
 

See Also:
ILog, LogFactory, Serialized Form

Field Summary
protected  ITransducer transducerSource
           
 
Fields inherited from class net.sourceforge.esw.service.ADefaultService
classServer, joinManager, proxy, serviceID
 
Fields inherited from class net.sourceforge.esw.service.AService
bStarted, heartbeatGenerator, priority
 
Fields inherited from class net.sourceforge.esw.util.SupportObject
id, properties, propertyChildren, propertyListeners, vetoableChildren, vetoableListeners
 
Fields inherited from interface net.sourceforge.esw.service.IService
PRIMARY, SECONDARY, TERTIARY, UNAVAILABLE
 
Constructor Summary
TransducerLog()
          Creates a new TransducerLog
TransducerLog(java.lang.Object aID)
          Creates a new TransducerLog with the specified identifier
 
Method Summary
 ITransducer getTransducer()
          gets the Transducer instance used to transduce the log messages.
 void log(ILogDatum aDatum)
          Logs the specified ILogDatum instance to this ILog instance.
 void log(INode aNode)
          Logs the specified INode instance to this ILog instance.
 void setTransducer(ITransducer transducer)
          sets the Transducer instance used to transduce the log messages.
 
Methods inherited from class net.sourceforge.esw.service.ADefaultService
die, persist, register, register, register, register, register, restore
 
Methods inherited from class net.sourceforge.esw.service.AService
getHeartbeatGenerator, getPriority, isSane, isStarted, ping, setPriority, start, stop
 
Methods inherited from class net.sourceforge.esw.util.SupportObject
addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, addVetoableChangeListener, firePropertyChange, firePropertyChange, fireVetoableChange, fireVetoableChange, getID, getProperty, getPropertySize, propertyKeys, removeProperty, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, removeVetoableChangeListener, setID, setProperty
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface net.sourceforge.esw.service.IService
die, getHeartbeatGenerator, getPriority, isSane, isStarted, ping, setPriority, start, stop
 
Methods inherited from interface net.sourceforge.esw.util.ISupportObject
addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, addVetoableChangeListener, firePropertyChange, firePropertyChange, fireVetoableChange, fireVetoableChange, getID, getProperty, getPropertySize, propertyKeys, removeProperty, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, removeVetoableChangeListener, setID, setProperty
 

Field Detail

transducerSource

protected ITransducer transducerSource
Constructor Detail

TransducerLog

public TransducerLog()
Creates a new TransducerLog

TransducerLog

public TransducerLog(java.lang.Object aID)
Creates a new TransducerLog with the specified identifier
Parameters:
aID - the id for this TransducerLog service
Method Detail

setTransducer

public void setTransducer(ITransducer transducer)
sets the Transducer instance used to transduce the log messages.
Parameters:
transducer - the transducer for this log

getTransducer

public ITransducer getTransducer()
gets the Transducer instance used to transduce the log messages.

log

public void log(INode aNode)
Logs the specified INode instance to this ILog instance.
Overrides:
log in class ALog
Parameters:
aNode - the INode instance containing the data of the event to be logged

log

public void log(ILogDatum aDatum)
Logs the specified ILogDatum instance to this ILog instance.
Overrides:
log in class ALog
Parameters:
aDatum - the ILogDatum instance containing the data of the event to be logged


Copyright 2002 Free Software Foundation. All Rights Reserved.