00001 #ifndef IT_BUS_TRANSACTION_MANAGER_
00002 #define IT_BUS_TRANSACTION_MANAGER_
00003
00004
00005
00006
00007 #include <it_bus/ref_counted_base.h>
00008 #include <it_bus/types.h>
00009 #include <it_bus/var.h>
00010 #include <it_bus/transaction_identifier.h>
00011
00012 namespace IT_Bus
00013 {
00014 class TransactionParticipant;
00015 class TransactionNotificationHandler;
00016
00027 class IT_BUS_API TransactionManager : public virtual RefCountedBase
00028 {
00029 public:
00030 virtual ~TransactionManager();
00031
00053 virtual TransactionIdentifier*
00054 detach_thread()=0;
00055
00069 virtual Boolean
00070 attach_thread(
00071 TransactionIdentifier* tx_identifier
00072 ) = 0;
00073
00083 virtual String
00084 get_transaction_type()=0;
00085
00104 virtual TransactionIdentifier*
00105 get_tx_identifier()=0;
00106
00114 virtual void
00115 set_transaction_timeout(
00116 UInt seconds
00117 ) throw((Exception)) =0;
00118
00124 virtual UInt
00125 get_transaction_timeout() throw((Exception)) = 0;
00126
00142 virtual Boolean
00143 enlist(
00144 TransactionParticipant* tx_participant,
00145 Boolean is_durable
00146 )=0;
00147
00154 virtual Boolean
00155 enlist_for_notification(
00156 TransactionNotificationHandler* completion_handler
00157 ) throw((Exception)) = 0;
00158
00173 virtual Boolean
00174 commit_transaction(
00175 Boolean report_heuristics
00176 ) throw((Exception)) = 0;
00177
00186 virtual void
00187 rollback_transaction() throw((Exception)) = 0;
00188
00197 virtual void
00198 include_tx_identifier(
00199 TransactionIdentifierMap & tx_map
00200 )=0;
00201
00217 virtual Boolean
00218 recreate_transaction(
00219 String & encoded_transaction_state
00220 )=0;
00221
00232 virtual String
00233 get_encoded_transaction_state()=0;
00234
00235 protected:
00236
00237 TransactionManager();
00238
00239 private:
00240 TransactionManager(const TransactionManager&);
00241 TransactionManager& operator=(const TransactionManager&);
00242 };
00243 typedef Var<TransactionManager> TransactionManager_var;
00244 typedef TransactionManager* TransactionManager_ptr;
00245 }
00246 #endif