org.objectweb.jotm.core.transaction
Class PrepareEvent
java.lang.Object
|
+--org.objectweb.jotm.core.transaction.PrepareEvent
- All Implemented Interfaces:
- Event, TransactionalEvent, TwoPhaseCommitEvent
- public class PrepareEvent
- extends java.lang.Object
- implements TwoPhaseCommitEvent
Prepare event. This class provides a simple helper implementation
of the prepare transactional event. I.e., it corresponds to the
TwoPhaseCommitEvent.TYPE_PREPARE event type.
It allows an event listener to set the event vote which can be later
determined by the event source.
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
VOTE_COMMIT
public static final int VOTE_COMMIT
- See Also:
- Constant Field Values
VOTE_ABORT
public static final int VOTE_ABORT
- See Also:
- Constant Field Values
VOTE_READ_ONLY
public static final int VOTE_READ_ONLY
- See Also:
- Constant Field Values
PrepareEvent
public PrepareEvent(BasicTransaction iTx)
getType
public int getType()
- Description copied from interface:
TransactionalEvent
- Get transactional event type. The value is one of the constants
defined in
TransactionalEvent.
- Specified by:
getType in interface TransactionalEvent
- Returns:
- type of this event
getTransaction
public BasicTransaction getTransaction()
- Description copied from interface:
TransactionalEvent
- Get corresponding transaction. A transaction is the event source
of
TransactionalEvent.
- Specified by:
getTransaction in interface TransactionalEvent
- Returns:
- transaction that is the source of this transactional event
setVote
public void setVote(int iVote)
throws InvalidVoteException
- Set preapre vote. The method allows the event listener to set the
preapre vote that can be later determined by the event source
transaction. The default value is
VOTE_COMMIT, i.e., if the
value is not set, the listener implicitly votes by this value.
- Parameters:
iVote - prepare vote
- Throws:
InvalidVoteException - vote value is invalid
getVote
public int getVote()
- Get prepare vote.
- Returns:
- prepare vote value