org.apache.log.output.db
public abstract class AbstractJDBCTarget extends AbstractTarget
Modifier and Type | Field and Description |
---|---|
private Connection |
m_connection |
private DataSource |
m_dataSource |
Modifier | Constructor and Description |
---|---|
protected |
AbstractJDBCTarget(DataSource dataSource)
Creation of a new instance of the AbstractJDBCTarget.
|
Modifier and Type | Method and Description |
---|---|
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 abstract void |
output(LogEvent event)
Output a log event to DB.
|
getErrorHandler, isOpen, processEvent, setErrorHandler
private DataSource m_dataSource
private Connection m_connection
protected AbstractJDBCTarget(DataSource dataSource)
dataSource
- the JDBC datasourceprotected void doProcessEvent(LogEvent event) throws Exception
doProcessEvent
in class AbstractTarget
event
- the log eventException
- if an event processing error occursprotected abstract void output(LogEvent event)
event
- the log event.protected void open()
open
in class AbstractTarget
protected void openConnection()
protected final Connection getConnection()
protected final void checkConnection()
protected boolean isStale()
public void close()
close
in interface Closeable
close
in class AbstractTarget
protected void closeConnection()
Copyright © 2003-2004 The Apache Software Foundation. All Rights Reserved.