public final class JPADatabaseManager extends AbstractDatabaseManager
AbstractDatabaseManager implementation for relational databases accessed via JPA.AbstractDatabaseManager.AbstractFactoryDatacount, LOGGER| Modifier and Type | Method and Description |
|---|---|
protected void |
connectInternal()
Implementations should implement this method to perform any proprietary connection operations.
|
protected void |
disconnectInternal()
Implementations should implement this method to perform any proprietary disconnection / shutdown operations.
|
static JPADatabaseManager |
getJPADatabaseManager(String name,
int bufferSize,
Class<? extends AbstractLogEventWrapperEntity> entityClass,
Constructor<? extends AbstractLogEventWrapperEntity> entityConstructor,
String persistenceUnitName)
Creates a JPA manager for use within the
JPAAppender, or returns a suitable one if it already exists. |
protected void |
writeInternal(LogEvent event)
Performs the actual writing of the event in an implementation-specific way.
|
connect, disconnect, flush, getManager, isConnected, releaseSub, toString, writegetContentFormat, getCount, getName, hasManager, releaseprotected void connectInternal()
AbstractDatabaseManagerconnectInternal in class AbstractDatabaseManagerprotected void disconnectInternal()
AbstractDatabaseManagerAbstractDatabaseManager.connectInternal(). It is safe to throw any exceptions from this method.disconnectInternal in class AbstractDatabaseManagerprotected void writeInternal(LogEvent event)
AbstractDatabaseManagerAbstractDatabaseManager.write(LogEvent) if buffering is off, or from AbstractDatabaseManager.flush() if the buffer has reached its limit.writeInternal in class AbstractDatabaseManagerevent - The event to write to the database.public static JPADatabaseManager getJPADatabaseManager(String name, int bufferSize, Class<? extends AbstractLogEventWrapperEntity> entityClass, Constructor<? extends AbstractLogEventWrapperEntity> entityConstructor, String persistenceUnitName)
JPAAppender, or returns a suitable one if it already exists.name - The name of the manager, which should include connection details, entity class name, etc.bufferSize - The size of the log event buffer.entityClass - The fully-qualified class name of the AbstractLogEventWrapperEntity concrete
implementation.entityConstructor - The one-arg LogEvent constructor for the concrete entity class.persistenceUnitName - The name of the JPA persistence unit that should be used for persisting log events.Copyright © 1999-2014 Apache Software Foundation. All Rights Reserved.
Apache Logging, Apache Log4j, Log4j, Apache, the Apache feather logo, the Apache Logging project logo, and the Apache Log4j logo are trademarks of The Apache Software Foundation.