net.sourceforge.esw.service.log
Class MailLog

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.MailLog
All Implemented Interfaces:
ILog, IService, ISupportObject, java.io.Serializable

public class MailLog
extends ALog

Provides logging via a MailTransducer instance.

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:

    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:
net.sourceforge.esw.service.graph.INode, ILog, ILogDatum, LogFactory, Serialized Form

Field Summary
protected static java.lang.String DEBUG_PROPERTY_NAME
          The property name of the debug flag
protected static java.lang.String PASSWORD_PROPERTY_NAME
          The property name of the Password.
protected static java.lang.String SMTP_HOST_PROPERTY_NAME
          The property name of the SMTPHost.
protected  MailTransducer transducer
          The MailTransducer through which to Log.
protected static java.lang.String USERNAME_PROPERTY_NAME
          The property name of the Username.
 
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
MailLog()
          Creates a new MailLog
 
Method Summary
 void log(INode aNode)
          Logs the specified INode instance to this ILog instance.
static void main(java.lang.String[] abcd)
          Main entry point into this TestDefaultService
 
Methods inherited from class net.sourceforge.esw.service.log.ALog
log
 
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

transducer

protected MailTransducer transducer
The MailTransducer through which to Log.

SMTP_HOST_PROPERTY_NAME

protected static final java.lang.String SMTP_HOST_PROPERTY_NAME
The property name of the SMTPHost.

USERNAME_PROPERTY_NAME

protected static final java.lang.String USERNAME_PROPERTY_NAME
The property name of the Username.

PASSWORD_PROPERTY_NAME

protected static final java.lang.String PASSWORD_PROPERTY_NAME
The property name of the Password.

DEBUG_PROPERTY_NAME

protected static final java.lang.String DEBUG_PROPERTY_NAME
The property name of the debug flag
Constructor Detail

MailLog

public MailLog()
        throws java.lang.Exception
Creates a new MailLog
Method Detail

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

main

public static void main(java.lang.String[] abcd)
                 throws java.lang.Exception
Main entry point into this TestDefaultService


Copyright 2002 Free Software Foundation. All Rights Reserved.