org.apache.log.output.db
Class AbstractJDBCTarget
- Closeable, ErrorAware, LogTarget
public abstract class AbstractJDBCTarget
Abstract JDBC target.
- Avalon Development Team
- Peter Donald
AbstractJDBCTarget(DataSource dataSource) - Creation of a new instance of the AbstractJDBCTarget.
|
protected void | checkConnection() - Utility method to check connection and bring it back up if necessary.
|
void | close() - Shutdown target.
|
protected void | closeConnection() - Close connection to underlying database.
|
protected void | doProcessEvent(LogEvent event) - Process a log event, via formatting and outputting it.
|
protected Connection | getConnection() - Utility method for subclasses to access connection.
|
protected boolean | isStale() - Detect if connection is stale and should be reopened.
|
protected void | open() - Startup log session.
|
protected void | openConnection() - Open connection to underlying database.
|
protected void | output(LogEvent event) - Output a log event to DB.
|
AbstractJDBCTarget
protected AbstractJDBCTarget(DataSource dataSource)
Creation of a new instance of the AbstractJDBCTarget.
dataSource
- the JDBC datasource
checkConnection
protected final void checkConnection()
Utility method to check connection and bring it back up if necessary.
close
public void close()
Shutdown target.
Attempting to write to target after close() will cause errors to be logged.
- close in interface Closeable
- close in interface AbstractTarget
closeConnection
protected void closeConnection()
Close connection to underlying database.
doProcessEvent
protected void doProcessEvent(LogEvent event)
throws Exception
Process a log event, via formatting and outputting it.
- doProcessEvent in interface AbstractTarget
event
- the log event
getConnection
protected final Connection getConnection()
Utility method for subclasses to access connection.
- the Connection
isStale
protected boolean isStale()
Detect if connection is stale and should be reopened.
- true if connection is stale, false otherwise
open
protected void open()
Startup log session.
- open in interface AbstractTarget
openConnection
protected void openConnection()
Open connection to underlying database.
output
protected void output(LogEvent event)
Output a log event to DB.
This must be implemented by subclasses.
event
- the log event.