org.apache.jetspeed.components.persistence.store
Interface PersistenceStore


public interface PersistenceStore

PersistenceStore

The persistence store allows access to the persistent storage mechanism within the application.
PersistenceStore instances ARE NOT thread safe. The best practices approach for using the persistence store is to use PersistenceStoreContainer.getStoreForThread() any time the store is to be accessed.

Version:
$ $
Author:
Scott T. Weaver

Field Summary
static int LOCK_NO_LOCK
          No lock at all aka the object is read only changes WILL NOT be persisted at checkPoints or commits.
static int LOCK_PESSIMISTIC
          changes to the object will be written to the database.
static int LOCK_READ
          changes to the object will be written to the database, in this case the lock will be automatically upgraded to the write lock on transaction
 
Method Summary
 void addEventListener(PersistenceStoreEventListener listener)
           
 void close()
           
 void deleteAll(java.lang.Object query)
           
 void deletePersistent(java.lang.Object obj)
           
 java.util.Collection getCollectionByQuery(java.lang.Object query)
           
 java.util.Collection getCollectionByQuery(java.lang.Object query, int lockLevel)
           
 int getCount(java.lang.Object query)
           
 java.util.Collection getExtent(java.lang.Class clazz)
           
 java.util.Collection getExtent(java.lang.Class clazz, int lockLevel)
           
 java.util.Iterator getIteratorByQuery(java.lang.Object query)
           
 java.util.Iterator getIteratorByQuery(java.lang.Object query, int lockLevel)
           
 java.lang.Object getObjectByIdentity(java.lang.Object object)
           
 java.lang.Object getObjectByIdentity(java.lang.Object object, int lockLevel)
           
 java.lang.Object getObjectByQuery(java.lang.Object query)
           
 java.lang.Object getObjectByQuery(java.lang.Object query, int lockLevel)
           
 Transaction getTransaction()
           getTransaction
 void invalidate(java.lang.Object obj)
           
 void invalidateAll()
           
 void invalidateByQuery(java.lang.Object query)
           
 void invalidateExtent(java.lang.Class clazz)
           
 boolean isClosed()
           isClosed
 void lockForWrite(java.lang.Object obj)
           
 void makePersistent(java.lang.Object obj)
           
 Filter newFilter()
           
 java.lang.Object newQuery(java.lang.Class clazz, Filter filter)
           
 

Field Detail

LOCK_NO_LOCK

static final int LOCK_NO_LOCK
No lock at all aka the object is read only changes WILL NOT be persisted at checkPoints or commits.

See Also:
Constant Field Values

LOCK_READ

static final int LOCK_READ
changes to the object will be written to the database, in this case the lock will be automatically upgraded to the write lock on transaction

See Also:
Constant Field Values

LOCK_PESSIMISTIC

static final int LOCK_PESSIMISTIC
changes to the object will be written to the database.

See Also:
Constant Field Values
Method Detail

addEventListener

void addEventListener(PersistenceStoreEventListener listener)

close

void close()

deletePersistent

void deletePersistent(java.lang.Object obj)
                      throws LockFailedException
Throws:
LockFailedException

deleteAll

void deleteAll(java.lang.Object query)
               throws LockFailedException
Throws:
LockFailedException

getCollectionByQuery

java.util.Collection getCollectionByQuery(java.lang.Object query)

getCollectionByQuery

java.util.Collection getCollectionByQuery(java.lang.Object query,
                                          int lockLevel)

getObjectByQuery

java.lang.Object getObjectByQuery(java.lang.Object query)

getObjectByQuery

java.lang.Object getObjectByQuery(java.lang.Object query,
                                  int lockLevel)

getObjectByIdentity

java.lang.Object getObjectByIdentity(java.lang.Object object)
                                     throws LockFailedException
Throws:
LockFailedException

getObjectByIdentity

java.lang.Object getObjectByIdentity(java.lang.Object object,
                                     int lockLevel)
                                     throws LockFailedException
Throws:
LockFailedException

getCount

int getCount(java.lang.Object query)

getIteratorByQuery

java.util.Iterator getIteratorByQuery(java.lang.Object query)

getIteratorByQuery

java.util.Iterator getIteratorByQuery(java.lang.Object query,
                                      int lockLevel)

isClosed

boolean isClosed()

isClosed

indicates whether or not this PersistenceStore instance has been closed. A closed store will generally throw exceptions when any operation is performed upon it.

Returns:

getTransaction

Transaction getTransaction()

getTransaction

Returns the current Transaction for thsis PersistenceStore instance. The transaction will always be the same for the lifetime of the PersistenceStore instance.

Returns:
Transaction for this PersistenceStore

invalidate

void invalidate(java.lang.Object obj)
                throws LockFailedException
Throws:
LockFailedException

invalidateAll

void invalidateAll()
                   throws LockFailedException
Throws:
LockFailedException

invalidateExtent

void invalidateExtent(java.lang.Class clazz)
                      throws LockFailedException
Throws:
LockFailedException

invalidateByQuery

void invalidateByQuery(java.lang.Object query)
                       throws LockFailedException
Throws:
LockFailedException

lockForWrite

void lockForWrite(java.lang.Object obj)
                  throws LockFailedException
Throws:
LockFailedException

makePersistent

void makePersistent(java.lang.Object obj)
                    throws LockFailedException
Throws:
LockFailedException

newFilter

Filter newFilter()

newQuery

java.lang.Object newQuery(java.lang.Class clazz,
                          Filter filter)

getExtent

java.util.Collection getExtent(java.lang.Class clazz)

getExtent

java.util.Collection getExtent(java.lang.Class clazz,
                               int lockLevel)


Copyright © 1999-2011 The Apache Software Foundation. All Rights Reserved.