Prev Class | Next Class | Frames | No Frames |
Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
java.lang.Object
org.exolab.castor.jdo.engine.AbstractDatabaseImpl
Field Summary | |
protected boolean |
|
protected CallbackInterceptor |
|
protected ClassLoader |
|
protected TransactionContext |
|
protected String |
|
protected InstanceFactory |
|
protected int |
|
protected PersistenceInfoGroup |
|
Constructor Summary | |
|
Method Summary | |
abstract void |
|
abstract void |
|
abstract void |
|
void |
|
CacheManager | |
ClassLoader |
|
TransactionContext |
|
String |
|
Identity |
|
abstract Connection | |
(package private) LockEngine |
|
OQLQuery |
|
OQLQuery | |
OQLQuery |
|
Query |
|
PersistenceInfoGroup |
|
protected TransactionContext |
|
boolean |
|
boolean |
|
boolean |
|
boolean |
|
boolean |
|
Object |
|
Object |
|
Object |
|
protected void |
|
void |
|
protected void |
|
void |
|
abstract void |
|
void |
|
String |
|
protected void |
|
void |
|
protected boolean _autoStore
True if user prefer all reachable object to be stored automatically. False if user want only dependent object to be stored.
protected ClassLoader _classLoader
The class loader for application classes (may be null).
protected TransactionContext _ctx
The transaction context is this database was accessed with anjavax.transaction.xa.XAResource
.
protected String _dbName
The name of this database.
protected InstanceFactory _instanceFactory
The instance factory to that creates new instances of data object
protected int _lockTimeout
The lock timeout for this database. Zero for immediate timeout, an infinite value for no timeout. The timeout is specified in seconds.
protected PersistenceInfoGroup _scope
The database engine used to access the underlying SQL database.
public AbstractDatabaseImpl(String dbName, int lockTimeout, CallbackInterceptor callback, InstanceFactory instanceFactory, ClassLoader classLoader, boolean autoStore) throws DatabaseNotFoundException
Creates an instance of this class
- Parameters:
dbName
- Name of the database.lockTimeout
- Lock timeout to usecallback
- Callback interceptorsinstanceFactory
- Instance factoryclassLoader
- Current class loader.autoStore
- True if auto storing is enabled.
- Throws:
DatabaseNotFoundException
- If there's no database configuration for the given name.
public abstract void commit() throws TransactionNotInProgressException, TransactionAbortedException
- See Also:
Database.commit()
public void create(Object object) throws ClassNotPersistenceCapableException, DuplicateIdentityException, TransactionNotInProgressException, PersistenceException
- See Also:
org.exolab.castor.jdo.Database.create(java.lang.Object)
public CacheManager getCacheManager()
- Specified by:
- getCacheManager in interface Database
- See Also:
Database.getCacheManager()
public ClassLoader getClassLoader()
Gets the current application ClassLoader's instance.
- Specified by:
- getClassLoader in interface Database
- Returns:
- the current ClassLoader's instance, or
null
if not provided
public TransactionContext getCurrentTransaction() throws TransactionNotInProgressException
Gets the current Castor transaction in use.
- Returns:
- the current Castor
- Throws:
TransactionNotInProgressException
- If there's no transaction in progress.
public String getDatabaseName()
Return the name of the database
- Specified by:
- getDatabaseName in interface Database
- Returns:
- Name of the database.
public Identity getIdentity(Object object) throws PersistenceException
- Specified by:
- getIdentity in interface Database
- See Also:
org.exolab.castor.jdo.Database.getIdentity(java.lang.Object)
public abstract Connection getJdbcConnection() throws PersistenceException
- Specified by:
- getJdbcConnection in interface Database
- See Also:
Database.getJdbcConnection()
(package private) LockEngine getLockEngine()
Returns theLockEngine
in use by this database instance.
- Returns:
- the
LockEngine
in use by this database instance.
public OQLQuery getNamedQuery(String name) throws PersistenceException
- Specified by:
- getNamedQuery in interface Database
- See Also:
org.exolab.castor.jdo.Database.getNamedQuery(java.lang.String)
public OQLQuery getOQLQuery()
- Specified by:
- getOQLQuery in interface Database
- See Also:
Database.getOQLQuery()
public OQLQuery getOQLQuery(String oql) throws PersistenceException
- Specified by:
- getOQLQuery in interface Database
- See Also:
org.exolab.castor.jdo.Database.getOQLQuery(java.lang.String)
protected TransactionContext getTransaction() throws TransactionNotInProgressException
Returns the currently active transaction, if any.
- Returns:
- The current active transaction.
- Throws:
TransactionNotInProgressException
- If there's no active transaction.
public boolean isAutoStore()
Return if the current transaction is set to autoStore, it there is transaction active. If there is no active transaction, return if the next transaction will be set to autoStore.
- Specified by:
- isAutoStore in interface Database
- Returns:
- True if 'auto-store' mode is in use.
public boolean isLocked(Class cls, Object identity) throws PersistenceException
- See Also:
org.exolab.castor.jdo.Database.isLocked(java.lang.Class, java.lang.Object)
public boolean isPersistent(Object object)
- Specified by:
- isPersistent in interface Database
- See Also:
org.exolab.castor.jdo.Database.isPersistent(java.lang.Object)
public Object load(Class type, Object identity) throws ObjectNotFoundException, LockNotGrantedException, TransactionNotInProgressException, PersistenceException
- See Also:
{@inheritDoc}
public Object load(Class type, Object identity, Object object) throws TransactionNotInProgressException, ObjectNotFoundException, LockNotGrantedException, PersistenceException
- See Also:
{@inheritDoc}
public Object load(Class type, Object identity, AccessMode mode) throws TransactionNotInProgressException, ObjectNotFoundException, LockNotGrantedException, PersistenceException
- See Also:
{@inheritDoc}
protected void loadSynchronizables()
Load theTxSynchronizable
implementations from the properties file, if not loaded before.
public void lock(Object object) throws LockNotGrantedException, ObjectNotPersistentException, TransactionNotInProgressException, PersistenceException
- See Also:
org.exolab.castor.jdo.Database.lock(java.lang.Object)
protected void registerSynchronizables()
Register theTxSynchronizable
implementations at the TransactionContect at end of begin().
public void remove(Object object) throws ObjectNotPersistentException, LockNotGrantedException, TransactionNotInProgressException, PersistenceException
- See Also:
org.exolab.castor.jdo.Database.remove(java.lang.Object)
public abstract void rollback() throws TransactionNotInProgressException
- See Also:
Database.rollback()
public void setAutoStore(boolean autoStore)
Indicates whether user prefer all reachable object to be stored automatically; false if user wants dependent object only to be stored.
- Specified by:
- setAutoStore in interface Database
- Parameters:
autoStore
- True to indicate that 'autoStore' mode should be used.
public String toString()
- See Also:
java.lang.Object.toString()
protected void unregisterSynchronizables()
Unregister theTxSynchronizable
implementations at the TransactionContect after commit() or rollback().
public void update(Object object) throws ClassNotPersistenceCapableException, ObjectModifiedException, TransactionNotInProgressException, PersistenceException
- See Also:
org.exolab.castor.jdo.Database.update(java.lang.Object)