org.apache.jackrabbit.core.persistence.bundle
Class H2PersistenceManager

java.lang.Object
  extended by org.apache.jackrabbit.core.persistence.bundle.AbstractBundlePersistenceManager
      extended by org.apache.jackrabbit.core.persistence.bundle.BundleDbPersistenceManager
          extended by org.apache.jackrabbit.core.persistence.bundle.H2PersistenceManager
All Implemented Interfaces:
CachingPersistenceManager, PersistenceManager

public class H2PersistenceManager
extends BundleDbPersistenceManager

Extends the BundleDbPersistenceManager by H2 specific code.

Configuration:


Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.jackrabbit.core.persistence.bundle.BundleDbPersistenceManager
BundleDbPersistenceManager.CloseableBLOBStore, BundleDbPersistenceManager.DbBlobStore, BundleDbPersistenceManager.FSBlobStore
 
Field Summary
 
Fields inherited from class org.apache.jackrabbit.core.persistence.bundle.BundleDbPersistenceManager
binding, blobStore, bundleDelete, bundleInsert, bundleSelect, bundleUpdate, con, consistencyCheck, consistencyFix, driver, errorHandling, externalBLOBs, INITIAL_BUFFER_SIZE, initialized, nodeReferenceDelete, nodeReferenceInsert, nodeReferenceSelect, nodeReferenceUpdate, password, schema, SCHEMA_OBJECT_PREFIX_VARIABLE, schemaObjectPrefix, SM_BINARY_KEYS, SM_LONGLONG_KEYS, url, user
 
Fields inherited from class org.apache.jackrabbit.core.persistence.bundle.AbstractBundlePersistenceManager
context, NODEFILENAME, NODEREFSFILENAME, RES_NAME_INDEX, RES_NS_INDEX
 
Constructor Summary
H2PersistenceManager()
          Creates a new h2 persistence manager.
 
Method Summary
protected  void checkSchema()
          Checks if the required schema objects exist and creates them if they don't exist yet.
 void close()
          Closes the persistence manager.
 String getLockTimeout()
          Returns the lock timeout.
 void init(PMContext context)
          Initializes the persistence manager. The persistence manager is permanently bound to the given context, and any required external resources are acquired.

An appropriate exception is thrown if the persistence manager initialization fails for whatever reason. In this case the state of the persistence manager is undefined and the instance should be discarded. Initializes the internal structures of this abstract persistence manager.

 void setLockTimeout(String lockTimeout)
          Sets the lock timeout in milliseconds.
 
Methods inherited from class org.apache.jackrabbit.core.persistence.bundle.BundleDbPersistenceManager
checkTablesExist, checkTablesWithUser, closeResultSet, closeStatement, closeStream, createBlobStore, createDBBlobStore, createDbNameIndex, createLocalFSBlobStore, destroy, destroyBundle, exists, existsBundle, getConsistencyCheck, getConsistencyFix, getDriver, getErrorHandling, getExternalBLOBs, getMinBlobSize, getNameIndex, getPassword, getSchema, getSchemaObjectPrefix, getStorageModel, getUrl, getUser, isExternalBLOBs, load, loadBundle, logException, prepareSchemaObjectPrefix, resetStatement, setConsistencyCheck, setConsistencyFix, setDriver, setErrorHandling, setExternalBLOBs, setKey, setMinBlobSize, setPassword, setSchema, setSchemaObjectPrefix, setUrl, setUser, store, store, storeBundle, toString, useDbBlobStore, useLocalFsBlobStore
 
Methods inherited from class org.apache.jackrabbit.core.persistence.bundle.AbstractBundlePersistenceManager
buildBlobFilePath, buildNodeFilePath, buildNodeFolderPath, buildNodeReferencesFilePath, buildPropFilePath, createNew, createNew, exists, exists, getBundleCacheSize, getNsIndex, load, load, onExternalUpdate, setBundleCacheSize
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

H2PersistenceManager

public H2PersistenceManager()
Creates a new h2 persistence manager.

Method Detail

getLockTimeout

public String getLockTimeout()
Returns the lock timeout.

Returns:
the lock timeout

setLockTimeout

public void setLockTimeout(String lockTimeout)
Sets the lock timeout in milliseconds.

Parameters:
lockTimeout - the lock timeout.

init

public void init(PMContext context)
          throws Exception
Initializes the persistence manager. The persistence manager is permanently bound to the given context, and any required external resources are acquired.

An appropriate exception is thrown if the persistence manager initialization fails for whatever reason. In this case the state of the persistence manager is undefined and the instance should be discarded. Initializes the internal structures of this abstract persistence manager.

Specified by:
init in interface PersistenceManager
Overrides:
init in class BundleDbPersistenceManager
Parameters:
context - persistence manager context
Throws:
Exception - if the persistence manager intialization failed

checkSchema

protected void checkSchema()
                    throws SQLException,
                           RepositoryException
Checks if the required schema objects exist and creates them if they don't exist yet.

Overrides:
checkSchema in class BundleDbPersistenceManager
Throws:
SQLException - if an SQL error occurs.
RepositoryException - if an error occurs.

close

public void close()
           throws Exception
Description copied from class: BundleDbPersistenceManager
Closes the persistence manager. The consistency of the persistent storage is guaranteed and all acquired resources are released. It is an error to invoke any methods on a closed persistence manager, and implementations are free to enforce this constraint by throwing IllegalStateExceptions in such cases.

An appropriate exception is thrown if the persistence manager could not be closed properly. In this case the state of the persistence manager is undefined and the instance should be discarded.

Specified by:
close in interface PersistenceManager
Overrides:
close in class BundleDbPersistenceManager
Throws:
Exception - if the persistence manager failed to close properly
See Also:
PersistenceManager.close()


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