net.sourceforge.esw.service.log
Class ReferenceLog
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
|
+--net.sourceforge.esw.service.log.ReferenceLog
- All Implemented Interfaces:
- ILog, ILogConstants, IService, ISupportObject, java.io.Serializable
- public class ReferenceLog
- extends TransducerLog
- implements ILogConstants, ILog
Describes the methods available for logging events from the enterprise.
This is the Reference ILog implementation provided as a turn-key solution.
It provides compatablity with JDBC compliant drivers.
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:
ILog log = LogFactory.getLog();
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
Fields inherited from interface net.sourceforge.esw.service.log.ILogConstants |
APP_ID, APP_ID_FIELD, CLASS_CONSTANT, CLASSES_CONSTANT, DATA_ID, DATA_ID_FIELD, DEFAULT_FILE_DIR, DESC_ID, DESC_ID_FIELD, ENTRY_CONSTANT, ENTRYS_CONSTANT, EXPRESSION_CONSTANT, FILENAME_CONSTANT, FILTER_CONSTANT, FILTER_LIST_CONSTANT, ID_ID, ID_ID_FIELD, LAST_FILTER_NUM_CONSTANT, RANK_ID, RANK_ID_FIELD, REFERENCE_LOG_DRIVER, REFERENCE_LOG_PASSWORD, REFERENCE_LOG_URL, REFERENCE_LOG_USER, SERVICE_ID, SERVICE_ID_CONSTANT, SERVICE_ID_FIELD, TARGET_CONSTANT, TARGETS_CONSTANT, WHEN_ID, WHEN_ID_FIELD, WHERE_ID, WHERE_ID_FIELD |
Constructor Summary |
protected |
ReferenceLog()
Creates a new ReferenceLog. |
Method Summary |
protected java.lang.String |
buildPutStatement()
Sets up the SimpleJDBCTransducer to be used for this ReferenceLog instance. |
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. |
static void |
main(java.lang.String[] abcd)
Main entry point into this TestDefaultService |
protected void |
setupTransducer()
Sets up the SimpleJDBCTransducer to be used for this ReferenceLog instance. |
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.util.ISupportObject |
addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, addVetoableChangeListener, firePropertyChange, firePropertyChange, fireVetoableChange, fireVetoableChange, getID, getProperty, getPropertySize, propertyKeys, removeProperty, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, removeVetoableChangeListener, setID, setProperty |
transducer
protected JDBCTransducer transducer
- The JDBCTransducer for use by the ReferenceLog.
ReferenceLog
protected ReferenceLog()
throws java.lang.Exception
- Creates a new ReferenceLog.
log
public void log(INode aNode)
- Logs the specified INode instance to this ILog instance.
- Specified by:
log
in interface ILog
- Overrides:
log
in class TransducerLog
- 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.
- Specified by:
log
in interface ILog
- Overrides:
log
in class TransducerLog
- Parameters:
aDatum
- the ILogDatum instance containing the data of the event
to be logged
setupTransducer
protected void setupTransducer()
throws java.lang.Exception
- Sets up the SimpleJDBCTransducer to be used for this ReferenceLog instance.
- Throws:
java.lang.Exception
- if the SimpleJDBCTransducer cannot be created.
buildPutStatement
protected java.lang.String buildPutStatement()
- Sets up the SimpleJDBCTransducer to be used for this ReferenceLog instance.
- Returns:
- the SQL INSERT statement for this ReferenceLog
- Throws:
java.lang.Exception
- if the SimpleJDBCTransducer cannot be created.
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.