org.apache.jetspeed.statistics.impl
Class BatchedPortletStatistics

java.lang.Object
  extended by org.apache.jetspeed.statistics.impl.BatchedStatistics
      extended by org.apache.jetspeed.statistics.impl.BatchedPortletStatistics
All Implemented Interfaces:
Runnable

public class BatchedPortletStatistics
extends BatchedStatistics

Batches up LogRecord statistics, and flushes them periodically to the appropriate table in the database.

IMPORTANT: It is the caller's responsibility to insure that the LogRecord instances added to a BatchedStatistics instance are all of the same type (Portlet Access, Page Access, or User Logout).

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

Field Summary
 
Fields inherited from class org.apache.jetspeed.statistics.impl.BatchedStatistics
batchSize, ds, logRecords, msElapsedTimeThreshold, msLastFlushTime, name, thread
 
Constructor Summary
BatchedPortletStatistics(DataSource ds, int batchSize, long msElapsedTimeThreshold, String name)
           
 
Method Summary
 boolean canDoRecordType(LogRecord rec)
           
protected  PreparedStatement getPreparedStatement(Connection con)
           
protected  void loadOneRecordToStatement(PreparedStatement stm, LogRecord rec)
           
 
Methods inherited from class org.apache.jetspeed.statistics.impl.BatchedStatistics
addStatistic, flush, getConnection, isDone, releaseConnection, run, startThread, tellThreadToStop
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BatchedPortletStatistics

public BatchedPortletStatistics(DataSource ds,
                                int batchSize,
                                long msElapsedTimeThreshold,
                                String name)
Method Detail

canDoRecordType

public boolean canDoRecordType(LogRecord rec)
Specified by:
canDoRecordType in class BatchedStatistics

loadOneRecordToStatement

protected void loadOneRecordToStatement(PreparedStatement stm,
                                        LogRecord rec)
                                 throws SQLException
Specified by:
loadOneRecordToStatement in class BatchedStatistics
Parameters:
stm -
recordIterator -
Throws:
SQLException

getPreparedStatement

protected PreparedStatement getPreparedStatement(Connection con)
                                          throws SQLException
Specified by:
getPreparedStatement in class BatchedStatistics
Parameters:
con -
Returns:
Throws:
SQLException


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