org.eaglei.search.logging
Class AsynchronousLogger

java.lang.Object
  extended by org.eaglei.search.logging.AsynchronousLogger
Direct Known Subclasses:
AsynchronousLoggerCount, AsynchronousLoggerInstance, AsynchronousLoggerSearch

public abstract class AsynchronousLogger
extends java.lang.Object

Class providing asynchronous logging of events using a BlockingQueue. Specify a new or existing table in the constructor, along with the build ID and ontology ID. If you do not want one or the other of the IDs, set them to an empty string or to null. Extend this abstract class to create a new logger for a specified table. Implement the abstract methods with the details of the table and rows. See AsynchronousLogger for an example.

Author:
RTS6

Field Summary
protected  java.lang.String buildID
           
protected  java.sql.Connection conn
           
protected  java.text.SimpleDateFormat dateFormat
           
protected  java.sql.PreparedStatement insertCmd
           
protected static org.apache.commons.logging.Log logger
           
protected  java.lang.String ontologyID
           
protected  java.lang.String tableName
           
 
Constructor Summary
AsynchronousLogger(java.lang.String tname, java.lang.String buildVersion, java.lang.String ontVersion)
           
 
Method Summary
protected abstract  void createTable()
           
protected abstract  void fillInInsertCmd(LogInfo entry)
           
 void finalize()
           
 java.lang.String getBuildID()
           
 java.sql.Connection getConnection()
           
 java.lang.String getOntologyID()
           
 void log(LogInfo entry)
           
protected abstract  void setInsertCmd()
           
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected static final org.apache.commons.logging.Log logger

conn

protected java.sql.Connection conn

dateFormat

protected java.text.SimpleDateFormat dateFormat

buildID

protected java.lang.String buildID

ontologyID

protected java.lang.String ontologyID

tableName

protected java.lang.String tableName

insertCmd

protected java.sql.PreparedStatement insertCmd
Constructor Detail

AsynchronousLogger

public AsynchronousLogger(java.lang.String tname,
                          java.lang.String buildVersion,
                          java.lang.String ontVersion)
Method Detail

createTable

protected abstract void createTable()

setInsertCmd

protected abstract void setInsertCmd()

fillInInsertCmd

protected abstract void fillInInsertCmd(LogInfo entry)

log

public void log(LogInfo entry)

getConnection

public java.sql.Connection getConnection()

getBuildID

public java.lang.String getBuildID()

getOntologyID

public java.lang.String getOntologyID()

finalize

public void finalize()
Overrides:
finalize in class java.lang.Object


Copyright © 2009-2011 Eagle-I. All Rights Reserved.