|
Side of Software Persistence Library 2.0 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface TransactionSupport
An auxiliary class that allows a TransactionPolicy
to register commit and abort actions
and to signal that an object's state has changed.
TransactionPolicy
Method Summary | |
---|---|
void |
addAbortAction(java.lang.Runnable action)
Registers an action to be run when the transaction aborts. |
void |
addCommitAction(java.lang.Runnable action)
Registers an action to be run when the top-level transaction commits. |
Database |
getDatabase()
Returns the database for which this transaction is occurring. |
java.lang.Object |
getKey()
Returns a key that uniquely identifies the object. |
java.lang.Object |
getObjectForRead()
Prepares and returns the object for reading. |
java.lang.Object |
getObjectForWrite()
Prepares and returns the object for writing. |
java.lang.Object |
getProxy()
Returns the database proxy object overseeing the object. |
void |
notifyChanged(java.lang.Object object,
boolean garbagePossible)
Informs the transaction that the object's state has changed and the object needs to be resaved in the database. |
Method Detail |
---|
void addCommitAction(java.lang.Runnable action)
action
- code to be executed when the top-level transaction commits
java.lang.NullPointerException
- if action
is null
void addAbortAction(java.lang.Runnable action)
action
- code to be executed when the transaction aborts
java.lang.NullPointerException
- if action
is null
Database getDatabase()
java.lang.Object getKey()
hashCode
, equals
, and toString
on the returned key.
null
object that uniquely identifies the objectjava.lang.Object getObjectForRead() throws java.io.IOException
java.io.IOException
- if an I/O error occursjava.lang.Object getObjectForWrite() throws java.io.IOException
java.io.IOException
- if an I/O error occursjava.lang.Object getProxy()
void notifyChanged(java.lang.Object object, boolean garbagePossible) throws java.io.IOException
object
- the modified objectgarbagePossible
- true
if the object has changed in such a way
that previously reachable database object may now be unreachable
java.lang.IllegalStateException
- if this database is open in read-only mode
java.io.IOException
- if an I/O error occurs
|
Side of Software Persistence Library 2.0 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |