edu.stanford.smi.protege.model
Class Transaction
java.lang.Object
edu.stanford.smi.protege.model.Transaction
public abstract class Transaction
- extends Object
Encapsulation of method for executing a tranaction.
Example:
void foo(KnowledgeBase kb) {
Transaction t = new Transaction(kb) {
public boolean doOperations() {
// kb calls go here
// return true for commit, false for rollback
}
};
boolean committed = t.execute();
if (committed) {
System.out("transaction committed");
} else {
System.out("transaction rolled back");
}
}
- Author:
- Ray Fergerson
Method Summary |
abstract boolean |
doOperations()
returns true if the the results of this method should be committed |
boolean |
execute()
returns true if the transaction was committed
This method handles the logic of executing a transaction, including the
necessary synchronization. |
static String |
getApplyTo(String beginString)
|
KnowledgeBase |
getKnowledgeBase()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
APPLY_TO_TRAILER_STRING
public static final String APPLY_TO_TRAILER_STRING
- See Also:
- Constant Field Values
Transaction
protected Transaction(KnowledgeBase kb)
getKnowledgeBase
public KnowledgeBase getKnowledgeBase()
doOperations
public abstract boolean doOperations()
- returns true if the the results of this method should be committed
execute
public boolean execute()
- returns true if the transaction was committed
This method handles the logic of executing a transaction, including the
necessary synchronization. In addition, it handles correctly both
runtime exceptions and errors.
getApplyTo
public static String getApplyTo(String beginString)
Submit a bug report or feature request
Protégé is a trademark of Stanford University.
Copyright (c) 1998-2007 Stanford University.