2.17.2: 2011-06-17

net.sf.basedb.core.log.db
Class DbLogManager

java.lang.Object
  extended by net.sf.basedb.core.log.db.DbLogManager
All Implemented Interfaces:
LogManager

public class DbLogManager
extends Object
implements LogManager

Log manager implementation that logs changes to the database.

Version:
2.13
Author:
Nicklas
Last modified
$Date: 2009-08-07 12:50:01 +0200 (Fri, 07 Aug 2009) $

Field Summary
private  ChangeHistoryData history
           
private  LogControl logControl
           
 
Constructor Summary
DbLogManager(LogControl logControl)
           
 
Method Summary
 void afterCommit()
          Called after a successful commit of changes to the database.
 void afterRollback()
          Called after rollback.
private  void createHistory()
           
 LogControl getLogControl()
          Get the log controller that is used in this transaction.
 void logChangeDetails(ChangeHistoryDetailData details)
          Log the given details to the database.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logControl

private final LogControl logControl

history

private ChangeHistoryData history
Constructor Detail

DbLogManager

public DbLogManager(LogControl logControl)
Method Detail

afterCommit

public void afterCommit()
Description copied from interface: LogManager
Called after a successful commit of changes to the database. Note that this method is not called until after the changes have been written to the database and the connection has been closed. If the log manager wants to add information to the database, it must be done before this method is called.

Specified by:
afterCommit in interface LogManager

afterRollback

public void afterRollback()
Description copied from interface: LogManager
Called after rollback. Note that this methd is not called until after the connection to the database has been closed, and that any information that the log manager has added to the database have also been rolled back.

Specified by:
afterRollback in interface LogManager

getLogControl

public LogControl getLogControl()
Description copied from interface: LogManager
Get the log controller that is used in this transaction.

Specified by:
getLogControl in interface LogManager

logChangeDetails

public void logChangeDetails(ChangeHistoryDetailData details)
Log the given details to the database. The ChangeHistoryDetailData.setChangeHistory(ChangeHistoryData) is automatically populated (and saved if needed) with information from the current transaction.


createHistory

private void createHistory()

2.17.2: 2011-06-17