00001 #ifndef IT_BUS_TRANSACTION_SYSTEM_
00002 #define IT_BUS_TRANSACTION_SYSTEM_
00003
00004
00005
00006 #include <it_bus/api_defines.h>
00007
00008 #include <it_bus/ref_counted_base.h>
00009 #include <it_bus/transaction_manager.h>
00010
00011 namespace IT_Bus
00012 {
00013 class TransactionParticipant;
00014
00023 class IT_BUS_API TransactionSystem : public virtual RefCountedBase
00024 {
00025 public:
00026 virtual ~TransactionSystem();
00027
00054 virtual void
00055 begin_transaction() throw((Exception)) = 0;
00056
00077 virtual Boolean
00078 commit_transaction(
00079 Boolean report_heuristics
00080 ) throw((Exception)) = 0;
00081
00096 virtual void
00097 rollback_transaction() throw((Exception)) = 0;
00098
00128 virtual TransactionManager&
00129 get_transaction_manager(
00130 const String& tx_manager_type = DEFAULT_TRANSACTION_TYPE
00131 ) throw((Exception)) = 0;
00132
00142 virtual Boolean
00143 within_transaction() = 0;
00144
00148 virtual TransactionParticipant*
00149 get_interposition_participant()=0;
00150
00154 static const String DEFAULT_TRANSACTION_TYPE;
00155 static const String WSAT_TRANSACTION_TYPE;
00156 static const String OTS_TRANSACTION_TYPE;
00157 static const String XA_TRANSACTION_TYPE;
00158
00159 protected:
00160
00161 TransactionSystem();
00162
00163 private:
00164 TransactionSystem(const TransactionSystem&);
00165 TransactionSystem& operator=(const TransactionSystem&);
00166 };
00167 typedef Var<TransactionSystem> TransactionSystem_var;
00168 typedef TransactionSystem* TransactionSystem_ptr;
00169 }
00170
00171 #endif