public final class JpaDatabaseManager extends AbstractDatabaseManager
AbstractDatabaseManager
implementation for relational databases accessed via JPA.AbstractDatabaseManager.AbstractFactoryData
count, LOGGER
Modifier and Type | Method and Description |
---|---|
protected boolean |
commitAndClose() |
protected void |
connectAndStart() |
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 boolean |
shutdownInternal() |
protected void |
startupInternal() |
protected void |
writeInternal(LogEvent event,
Serializable serializable) |
buffer, flush, getManager, isBuffered, isRunning, releaseSub, shutdown, startup, toString, write, write, writeInternal, writeThrough
close, getContentFormat, getCount, getLoggerContext, getName, getStrSubstitutor, hasManager, log, logDebug, logError, logger, logWarn, narrow, release, stop, updateData
protected void startupInternal()
startupInternal
in class AbstractDatabaseManager
protected boolean shutdownInternal()
shutdownInternal
in class AbstractDatabaseManager
protected void connectAndStart()
connectAndStart
in class AbstractDatabaseManager
protected void writeInternal(LogEvent event, Serializable serializable)
writeInternal
in class AbstractDatabaseManager
protected boolean commitAndClose()
commitAndClose
in class AbstractDatabaseManager
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-2022 The 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.