Holger's
Java API

com.antelmann.mgmt
Interface Database<S>

All Known Implementing Classes:
AbstractDatabase, SQLDatabase

public interface Database<S>

provides a lookup service for persistence services for Resource objects. All database access through Database instances provided by this class is monitored and can be logged by adding listeners.

Author:
Holger Antelmann
See Also:
Resource, DBClassStore

Method Summary
 void addListener(DBListener listener)
           
 Collection<Class<? extends Resource>> getAvailableClassStores()
           
<T extends Resource>
DBClassStore<T>
getClassStore(Class<T> c)
          allows to query for a persistence service for a given Resource class.
 S getDatabaseSerivce()
          provides access to the actual database service that is used by the implementation of this interface
 Logger getLogger()
          access to the Logger that by default uses a LogWriter writing entries directly into this database.
 DBTransaction getTransaction()
          provides access to the DBTransaction, which coordinates all access to the Resources via DBClassStore
 User getUser()
          returns the user credentials of the one currently using this database
 void removeListener(DBListener listener)
           
 void setUser(User user)
          sets the user credentials for accessing resources
 

Method Detail

getUser

User getUser()
returns the user credentials of the one currently using this database


setUser

void setUser(User user)
sets the user credentials for accessing resources


getAvailableClassStores

Collection<Class<? extends Resource>> getAvailableClassStores()

getTransaction

DBTransaction getTransaction()
provides access to the DBTransaction, which coordinates all access to the Resources via DBClassStore


getDatabaseSerivce

S getDatabaseSerivce()
provides access to the actual database service that is used by the implementation of this interface


getLogger

Logger getLogger()
access to the Logger that by default uses a LogWriter writing entries directly into this database. This Logger is also commonly used to log all database access; adding your own LogWriter therefore allows to be notified of database access via logging. As this may possibly happen outside transaction boundaries (depending on the implementation), be aware of possible side-effects (e.g. in the event of transaction aborts).


getClassStore

<T extends Resource> DBClassStore<T> getClassStore(Class<T> c)
allows to query for a persistence service for a given Resource class.

Returns:
a persistence service for the given Resource class or null if such service doesn't exist

addListener

void addListener(DBListener listener)

removeListener

void removeListener(DBListener listener)


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