Holger's Java API

## com.antelmann.db
Interface DBStoreListener

All Known Implementing Classes:
  DatabaseTableModel, DBStoreListener.Adapter, DBStoreListener.StoreUpdateAdapter, DBStoreProfiler, DBTransactionStoreAdapter, LoggerDBListener

    public interface DBStoreListener

listens for database updates and access through DBClassStore objects

Author:
  Holger Antelmann
See Also:
  `DatabaseChangeMonitor`

Nested Class Summary
`static class` `DBStoreListener.Adapter` provides convenient empty implementations for all methods
`static class` `DBStoreListener.StoreUpdateAdapter` allows to simply register an ActionListener for changes of a specified type

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

Method Detail

### prepareDatabaseCall

    void prepareDatabaseCall(DBClassStore<?> dbstore,
                             DBClassStore.DBMethod method,
                             Object parameter)
                             throws DBVetoException

  called before the given method is delegated to the embedded store

  Throws:
    `DBVetoException` - if a listener seeks to prevent the call to the embedded store

### databaseUpdated

    void databaseUpdated(DBUpdateEvent event,
                         long timeTaken)
                         throws DBVetoException

  called upon successful insert, delete or update; note that the update becomes permanent ONLY if the current transaction successfully commits.

  Throws:
    `DBVetoException` - if the listener explicitly wants to prevent the update from occurring; this exception is then propagated
  See Also:
    `TransactionListener`, `DatabaseChangeMonitor`, `DBVersionedUpdateEvent`, `Database.setVersioningEnabled(Class, boolean)`

### databaseAccessed

    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). This method is not called when an update occurred - in which case only `databaseUpdated(DBUpdateEvent, long)` is called.

### databaseError

    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)

### fetchCall

    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

  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