org.apache.jackrabbit.core.journal
Class JNDIDatabaseJournal

java.lang.Object
  extended by org.apache.jackrabbit.core.journal.AbstractJournal
      extended by org.apache.jackrabbit.core.journal.DatabaseJournal
          extended by org.apache.jackrabbit.core.journal.JNDIDatabaseJournal
All Implemented Interfaces:
Journal

public class JNDIDatabaseJournal
extends DatabaseJournal

Database journal that uses JNDI to acquire the database connection. The JNDI location of the DataSource to be used in given as the dataSourceLocation configuration property.

WARNING: The acquired database connection is kept for the entire lifetime of the journal instance. The configured data source should be prepared for this.


Field Summary
 
Fields inherited from class org.apache.jackrabbit.core.journal.DatabaseJournal
insertRevisionStmtSQL, schemaObjectPrefix, selectGlobalStmtSQL, selectRevisionsStmtSQL, updateGlobalStmtSQL
 
Constructor Summary
JNDIDatabaseJournal()
           
 
Method Summary
protected  Connection getConnection()
          Returns a JDBC connection from a DataSource acquired from JNDI with the configured data source location.
 String getDataSourceLocation()
          Returns the JNDI location of the data source.
protected  void init()
          Overridden to avoid the driver and url checks in DatabaseJournal.
 void setDataSourceLocation(String dataSourceLocation)
          Sets the JNDI location of the data source.
 
Methods inherited from class org.apache.jackrabbit.core.journal.DatabaseJournal
append, appending, buildSQLStatements, close, createSchemaSQL, doLock, doUnlock, getDriver, getPassword, getReconnectDelayMs, getRecords, getSchema, getSchemaObjectPrefix, getUrl, getUser, init, schemaExists, setDriver, setPassword, setReconnectDelayMs, setSchema, setSchemaObjectPrefix, setUrl, setUser
 
Methods inherited from class org.apache.jackrabbit.core.journal.AbstractJournal
createProducer, doSync, getConsumer, getId, getNamePathResolver, getProducer, getResolver, lockAndSync, register, sync, unlock, unregister
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JNDIDatabaseJournal

public JNDIDatabaseJournal()
Method Detail

getDataSourceLocation

public String getDataSourceLocation()
Returns the JNDI location of the data source.

Returns:
data source location

setDataSourceLocation

public void setDataSourceLocation(String dataSourceLocation)
Sets the JNDI location of the data source.

Parameters:
dataSourceLocation - data source location

getConnection

protected Connection getConnection()
                            throws SQLException
Returns a JDBC connection from a DataSource acquired from JNDI with the configured data source location.

Overrides:
getConnection in class DatabaseJournal
Returns:
new database connection
Throws:
SQLException - if a database access error occurs
See Also:
DatabaseJournal.getConnection()

init

protected void init()
             throws JournalException
Overridden to avoid the driver and url checks in DatabaseJournal.

Overrides:
init in class DatabaseJournal
Throws:
JournalException - if initialization fails
See Also:
DatabaseJournal.getConnection()


Copyright © 2004-2008 The Apache Software Foundation. All Rights Reserved.