00001 #ifndef IT_BUS_TRANSACTION_SYSTEM_
00002 #define IT_BUS_TRANSACTION_SYSTEM_
00003
00004
00005
00006 #include <it_bus/api_defines.h>
00007 #include <it_bus/var.h>
00008 #include <it_bus/ref_counted_base.h>
00009 #include <it_bus/types.h>
00010 #ifndef IT_MINIMISE_INCLUDES
00011 #include <it_bus/transaction_manager.h>
00012 #endif
00013
00014 namespace IT_Bus
00015 {
00016 class TransactionParticipant;
00017 class TransactionManager;
00018
00027 class IT_BUS_API TransactionSystem : public virtual RefCountedBase
00028 {
00029 public:
00030 virtual ~TransactionSystem();
00031
00058 virtual void
00059 begin_transaction() IT_THROW_DECL((Exception)) = 0;
00060
00081 virtual Boolean
00082 commit_transaction(
00083 Boolean report_heuristics
00084 ) IT_THROW_DECL((Exception)) = 0;
00085
00100 virtual void
00101 rollback_transaction() IT_THROW_DECL((Exception)) = 0;
00102
00132 virtual TransactionManager&
00133 get_transaction_manager(
00134 const String& tx_manager_type = DEFAULT_TRANSACTION_TYPE
00135 ) IT_THROW_DECL((Exception)) = 0;
00136
00146 virtual Boolean
00147 within_transaction() = 0;
00148
00152 virtual TransactionParticipant*
00153 get_interposition_participant()=0;
00154
00158 static const String DEFAULT_TRANSACTION_TYPE;
00159 static const String WSAT_TRANSACTION_TYPE;
00160 static const String OTS_TRANSACTION_TYPE;
00161 static const String XA_TRANSACTION_TYPE;
00162
00163 protected:
00164
00165 TransactionSystem();
00166
00167 private:
00168 TransactionSystem(const TransactionSystem&);
00169 TransactionSystem& operator=(const TransactionSystem&);
00170 };
00171 typedef Var<TransactionSystem> TransactionSystem_var;
00172 typedef TransactionSystem* TransactionSystem_ptr;
00173 }
00174
00175 #endif