Holger's
Java API

com.antelmann.db
Class LoggerDBListener

java.lang.Object
  extended by com.antelmann.db.LoggerDBListener
All Implemented Interfaces:
DBStoreListener

public class LoggerDBListener
extends Object
implements DBStoreListener

provides convenient logging capabilities for Database objects

Since:
7. Dezember 2006, 01:33
Author:
Holger Antelmann

Nested Class Summary
 
Nested classes/interfaces inherited from interface com.antelmann.db.DBStoreListener
DBStoreListener.Adapter, DBStoreListener.StoreUpdateAdapter
 
Constructor Summary
LoggerDBListener(Logger logger)
           
 
Method Summary
 void databaseAccessed(DBClassStore<?> dbstore, DBClassStore.DBMethod method, Object parameter, long timeTaken)
          called upon successfully reading from the database (guaranteed to be called from within the transaction).
 void databaseError(DBClassStore<?> dbstore, Throwable t, DBClassStore.DBMethod method, Object parameter)
          called when an error occurred while accessing the database (not guaranteed to be called from within the transaction)
 void databaseUpdated(DBUpdateEvent event, long timeTaken)
          called upon successful insert, delete or update; note that the update becomes permanent ONLY if the current transaction successfully commits.
 void fetchCall(DBClassStore<?> dbstore, DBEnumeration<?> e, String method, long timeTaken)
          called when a method is called on a DBEnumeration that is returned by the store
 void prepareDatabaseCall(DBClassStore<?> dbstore, DBClassStore.DBMethod method, Object parameter)
          called before the given method is delegated to the embedded store
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LoggerDBListener

public LoggerDBListener(Logger logger)
Method Detail

prepareDatabaseCall

public void prepareDatabaseCall(DBClassStore<?> dbstore,
                                DBClassStore.DBMethod method,
                                Object parameter)
                         throws DBVetoException
Description copied from interface: DBStoreListener
called before the given method is delegated to the embedded store

Specified by:
prepareDatabaseCall in interface DBStoreListener
Throws:
DBVetoException - if a listener seeks to prevent the call to the embedded store

databaseUpdated

public void databaseUpdated(DBUpdateEvent event,
                            long timeTaken)
Description copied from interface: DBStoreListener
called upon successful insert, delete or update; note that the update becomes permanent ONLY if the current transaction successfully commits.

Specified by:
databaseUpdated in interface DBStoreListener
See Also:
TransactionListener, DatabaseChangeMonitor, DBVersionedUpdateEvent, Database.setVersioningEnabled(Class, boolean)

databaseAccessed

public void databaseAccessed(DBClassStore<?> dbstore,
                             DBClassStore.DBMethod method,
                             Object parameter,
                             long timeTaken)
Description copied from interface: DBStoreListener
called upon successfully reading from the database (guaranteed to be called from within the transaction). This method is not called when an update occurred - in which case only DBStoreListener.databaseUpdated(DBUpdateEvent, long) is called.

Specified by:
databaseAccessed in interface DBStoreListener

databaseError

public void databaseError(DBClassStore<?> dbstore,
                          Throwable t,
                          DBClassStore.DBMethod method,
                          Object parameter)
Description copied from interface: DBStoreListener
called when an error occurred while accessing the database (not guaranteed to be called from within the transaction)

Specified by:
databaseError in interface DBStoreListener

fetchCall

public void fetchCall(DBClassStore<?> dbstore,
                      DBEnumeration<?> e,
                      String method,
                      long timeTaken)
Description copied from interface: DBStoreListener
called when a method is called on a DBEnumeration that is returned by the store

Specified by:
fetchCall in interface DBStoreListener
See Also:
DBClassStore.fetch(com.antelmann.util.Filter), DBClassStore.fetchStubs(com.antelmann.util.Filter), DBEnumeration


(c) Holger Antelmann since 2001- all rights reserved (contact: info@antelmann.com)
see www.antelmann.com/developer for further details and available downloads