edu.stanford.smi.protege.model
Class Transaction<X>
java.lang.Object
edu.stanford.smi.protege.model.Transaction<X>
public abstract class Transaction<X>
- 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
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)
Transaction
protected Transaction(KnowledgeBase kb,
String transactionName)
Transaction
protected Transaction(KnowledgeBase kb,
String transactionName,
String applyTo)
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.
getResult
public X getResult()
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-2010 Stanford University.