00001 #ifndef IT_BUS_TRANSACTION_PARTICIPANT_
00002 #define IT_BUS_TRANSACTION_PARTICIPANT_
00003
00004
00005
00006 #include <it_bus/transaction_type_alias.h>
00007 #include <it_bus/ref_counted_base.h>
00008 #include <it_bus/types.h>
00009 #include <it_bus/var.h>
00010
00011 namespace IT_Bus
00012 {
00013 class TransactionManager;
00014
00026 class IT_BUS_API TransactionParticipant : public virtual RefCountedBase
00027 {
00028 public:
00029 virtual ~TransactionParticipant();
00030
00043 enum VoteOutcome {
00044 VoteCommit,
00045 VoteRollback,
00046 VoteReadOnly
00047 };
00048
00053 virtual void
00054 commit_one_phase()=0;
00055
00063 virtual VoteOutcome
00064 prepare()=0;
00065
00070 virtual void
00071 commit()=0;
00072
00078 virtual void
00079 rollback()=0;
00080
00093 virtual void
00094 set_manager(
00095 TransactionManager* tx_manager
00096 )=0;
00097
00121 virtual String
00122 preferred_transaction_manager()=0;
00123
00124 protected:
00125
00126 TransactionParticipant();
00127
00128 private:
00129 TransactionParticipant(const TransactionParticipant&);
00130 TransactionParticipant& operator=(const TransactionParticipant&);
00131 };
00132 }
00133
00134 #endif