org.jbpm.tx
Class StandardTransaction
java.lang.Object
org.jbpm.util.DefaultObservable
org.jbpm.tx.StandardTransaction
- All Implemented Interfaces:
- java.io.Serializable, Transaction, Listener, Observable
public class StandardTransaction
- extends DefaultObservable
- implements Transaction, java.io.Serializable, Listener
simple 2 phase commit transaction.
no logging or recovery.
non thread safe (which is ok).
- Author:
- Tom Baeyens
- See Also:
- Serialized Form
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
STATE_ACTIVE
public static final java.lang.String STATE_ACTIVE
- See Also:
- Constant Field Values
STATE_COMMITTING
public static final java.lang.String STATE_COMMITTING
- See Also:
- Constant Field Values
STATE_COMMITTED
public static final java.lang.String STATE_COMMITTED
- See Also:
- Constant Field Values
STATE_MARKED_ROLLBACK
public static final java.lang.String STATE_MARKED_ROLLBACK
- See Also:
- Constant Field Values
STATE_ROLLING_BACK
public static final java.lang.String STATE_ROLLING_BACK
- See Also:
- Constant Field Values
STATE_ROLLEDBACK
public static final java.lang.String STATE_ROLLEDBACK
- See Also:
- Constant Field Values
environment
protected Environment environment
resources
protected java.util.List<Resource> resources
state
protected java.lang.String state
StandardTransaction
public StandardTransaction()
setRollbackOnly
public void setRollbackOnly()
- Description copied from interface:
Transaction
- marks a transaction for rollback only.
The transaction will be rolled back upon closing the environment.
- Specified by:
setRollbackOnly
in interface Transaction
isRollbackOnly
public boolean isRollbackOnly()
- Specified by:
isRollbackOnly
in interface Transaction
isCommitted
public boolean isCommitted()
- Specified by:
isCommitted
in interface Transaction
isRolledBack
public boolean isRolledBack()
- Specified by:
isRolledBack
in interface Transaction
enlistResource
public void enlistResource(Resource resource)
event
public void event(java.lang.Object source,
java.lang.String eventName,
java.lang.Object info)
- This transaction will always listen to the close of the block context.
If the transaction is still active at that time, it will be committed.
If it is marked for rollback it will be rolled back.
- Specified by:
event
in interface Listener
- Parameters:
source
- Observable
that fired the event.eventName
- name of the event.info
- informations about the fired event.
commit
public void commit()
- implements simplest two phase commit.
rollback
public void rollback()
rollback
public void rollback(boolean fireBeforeCompletionEvent)
setEnvironment
public void setEnvironment(Environment environment)
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object