|
2.17.2: 2011-06-17 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.basedb.core.log.db.DbLogManagerFactory
public class DbLogManagerFactory
Log manager factory implementationt that logs changes
to the database. Only items that has been tagged with
the LoggableData
interface are logged.
Field Summary | |
---|---|
private DefaultEntityLogger |
defaultLogger
|
private boolean |
detailedProperties
|
private Map<Class,EntityLogger> |
specialLoggers
|
Constructor Summary | |
---|---|
DbLogManagerFactory()
|
Method Summary | |
---|---|
EntityLogger |
getEntityLogger(LogManager logManager,
Object entity)
If a special logger has been registered for the class of the given entity, use that logger, otherwise use the default logger. |
LogManager |
getLogManager(LogControl logControl)
Creates a new DbLogManager . |
boolean |
isLoggable(Object entity)
Checks if changes to the given entity should be logged or not. |
void |
setSpecialLogger(Class clazz,
EntityLogger logger)
Register a special logger for entities of the given class. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private final Map<Class,EntityLogger> specialLoggers
private final DefaultEntityLogger defaultLogger
private final boolean detailedProperties
Constructor Detail |
---|
public DbLogManagerFactory()
Method Detail |
---|
public boolean isLoggable(Object entity)
LogManagerFactory
LogManagerFactory.getEntityLogger(LogManager, Object)
mustn't return null if called with the same entity parameter.
isLoggable
in interface LogManagerFactory
entity
- The entity to check
LoggableData
public EntityLogger getEntityLogger(LogManager logManager, Object entity)
getEntityLogger
in interface LogManagerFactory
logManager
- The log manager used in the current transactionentity
- The entity to get a logger for
LoggableData
public LogManager getLogManager(LogControl logControl)
DbLogManager
.
getLogManager
in interface LogManagerFactory
logControl
- A log controller with information about the
current transaction
public void setSpecialLogger(Class clazz, EntityLogger logger)
clazz
- The class to register a logger for. The class
must implement the LoggableData
interfacelogger
- The logger to use. It must be a thread-safe
implementation since it can be used by multiple threads
at the same time
|
2.17.2: 2011-06-17 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |