org.apache.jetspeed.statistics.impl
Class BatchedStatistics

java.lang.Object
  extended by org.apache.jetspeed.statistics.impl.BatchedStatistics
All Implemented Interfaces:
java.lang.Runnable
Direct Known Subclasses:
BatchedPageStatistics, BatchedPortletStatistics, BatchedUserStatistics

public abstract class BatchedStatistics
extends java.lang.Object
implements java.lang.Runnable

BatchedStatistics

Version:
$Id: TestPortletEntityDAO.java,v 1.3 2005/05/24 14:43:19 ate Exp $
Author:
Chris Schaefer , David Sean Taylor

Field Summary
protected  int batchSize
           
protected  javax.sql.DataSource ds
           
protected  java.util.List logRecords
           
protected  long msElapsedTimeThreshold
           
protected  long msLastFlushTime
           
protected  java.lang.String name
           
protected  java.lang.Thread thread
           
 
Constructor Summary
BatchedStatistics(javax.sql.DataSource ds, int batchSize, long msElapsedTimeThreshold, java.lang.String name)
           
 
Method Summary
 void addStatistic(LogRecord logRecord)
           
abstract  boolean canDoRecordType(LogRecord rec)
           
 void flush()
           
protected  java.sql.Connection getConnection()
           
protected abstract  java.sql.PreparedStatement getPreparedStatement(java.sql.Connection con)
           
 boolean isDone()
           
protected abstract  void loadOneRecordToStatement(java.sql.PreparedStatement stm, LogRecord rec)
           
 void run()
           
 void startThread()
           
 void tellThreadToStop()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

thread

protected java.lang.Thread thread

msLastFlushTime

protected long msLastFlushTime

batchSize

protected int batchSize

msElapsedTimeThreshold

protected long msElapsedTimeThreshold

logRecords

protected java.util.List logRecords

ds

protected javax.sql.DataSource ds

name

protected java.lang.String name
Constructor Detail

BatchedStatistics

public BatchedStatistics(javax.sql.DataSource ds,
                         int batchSize,
                         long msElapsedTimeThreshold,
                         java.lang.String name)
Method Detail

startThread

public void startThread()

getConnection

protected java.sql.Connection getConnection()
                                     throws java.sql.SQLException
Throws:
java.sql.SQLException

addStatistic

public void addStatistic(LogRecord logRecord)

isDone

public boolean isDone()

tellThreadToStop

public void tellThreadToStop()

run

public void run()
Specified by:
run in interface java.lang.Runnable

flush

public void flush()

getPreparedStatement

protected abstract java.sql.PreparedStatement getPreparedStatement(java.sql.Connection con)
                                                            throws java.sql.SQLException
Throws:
java.sql.SQLException

loadOneRecordToStatement

protected abstract void loadOneRecordToStatement(java.sql.PreparedStatement stm,
                                                 LogRecord rec)
                                          throws java.sql.SQLException
Throws:
java.sql.SQLException

canDoRecordType

public abstract boolean canDoRecordType(LogRecord rec)


Copyright © 1999-2010 Apache Software Foundation. All Rights Reserved.