aboutsummaryrefslogtreecommitdiffstats
path: root/lib/cosTransactions/src/CosTransactions.idl
diff options
context:
space:
mode:
authorErlang/OTP <[email protected]>2009-11-20 14:54:40 +0000
committerErlang/OTP <[email protected]>2009-11-20 14:54:40 +0000
commit84adefa331c4159d432d22840663c38f155cd4c1 (patch)
treebff9a9c66adda4df2106dfd0e5c053ab182a12bd /lib/cosTransactions/src/CosTransactions.idl
downloadotp-84adefa331c4159d432d22840663c38f155cd4c1.tar.gz
otp-84adefa331c4159d432d22840663c38f155cd4c1.tar.bz2
otp-84adefa331c4159d432d22840663c38f155cd4c1.zip
The R13B03 release.OTP_R13B03
Diffstat (limited to 'lib/cosTransactions/src/CosTransactions.idl')
-rw-r--r--lib/cosTransactions/src/CosTransactions.idl193
1 files changed, 193 insertions, 0 deletions
diff --git a/lib/cosTransactions/src/CosTransactions.idl b/lib/cosTransactions/src/CosTransactions.idl
new file mode 100644
index 0000000000..11ec5cbf5b
--- /dev/null
+++ b/lib/cosTransactions/src/CosTransactions.idl
@@ -0,0 +1,193 @@
+#ifndef _COSTRANSACTIONS_IDL
+#define _COSTRANSACTIONS_IDL
+
+#pragma prefix "omg.org"
+
+module CosTransactions {
+
+// DATATYPES
+ enum Status {
+ StatusActive,
+ StatusMarkedRollback,
+ StatusPrepared,
+ StatusCommitted,
+ StatusRolledBack,
+ StatusUnknown,
+ StatusNoTransaction,
+ StatusPreparing,
+ StatusCommitting,
+ StatusRollingBack
+ };
+
+ enum Vote {
+ VoteCommit,
+ VoteRollback,
+ VoteReadOnly
+ };
+
+ // Forward references for interfaces defined later in module
+ interface Control;
+ interface Terminator;
+ interface Coordinator;
+ interface Resource;
+ interface RecoveryCoordinator;
+ interface SubtransactionAwareResource;
+ interface TransactionFactory;
+ interface TransactionalObject;
+ // interface Synchronization;
+
+ // Structure definitions
+ struct otid_t {
+ long formatID; /*format identifier. 0 is OSI TP */
+ long bqual_length;
+ sequence <octet> tid;
+ };
+ struct TransIdentity {
+ Coordinator coord;
+ Terminator term;
+ otid_t otid;
+ };
+ struct PropagationContext {
+ unsigned long timeout;
+ TransIdentity current;
+ sequence <TransIdentity> parents;
+ any implementation_specific_data;
+ };
+ // interface Current;
+
+ // Standard exceptions
+ // Defined in orber/include/corba.hrl
+ // exception TransactionRequired {};
+ // exception TransactionRolledBack {};
+ // exception InvalidTransaction {};
+
+ // Heuristic exceptions
+ exception HeuristicRollback {};
+ exception HeuristicCommit {};
+ exception HeuristicMixed {};
+ exception HeuristicHazard {};
+
+ // Exception from Orb operations
+ exception WrongTransaction {};
+
+ // Other transaction-specific exceptions
+ exception SubtransactionsUnavailable {};
+ exception NotSubtransaction {};
+ exception Inactive {};
+ exception NotPrepared {};
+ exception NoTransaction {};
+ exception InvalidControl {};
+ exception Unavailable {};
+ exception SynchronizationUnavailable {};
+
+ interface TransactionFactory {
+ Control create(in unsigned long time_out);
+ Control recreate(in PropagationContext ctx);
+ };
+
+ interface Control {
+ Terminator get_terminator()
+ raises(Unavailable);
+ Coordinator get_coordinator()
+ raises(Unavailable);
+ };
+
+ interface Terminator {
+ void commit(in boolean report_heuristics)
+ raises( HeuristicMixed,
+ HeuristicHazard );
+ void rollback();
+ };
+
+ interface Coordinator {
+
+ Status get_status();
+ Status get_parent_status();
+ Status get_top_level_status();
+
+ boolean is_same_transaction(in Coordinator tc);
+ boolean is_related_transaction(in Coordinator tc);
+ boolean is_ancestor_transaction(in Coordinator tc);
+ boolean is_descendant_transaction(in Coordinator tc);
+ boolean is_top_level_transaction();
+
+ unsigned long hash_transaction();
+ unsigned long hash_top_level_tran();
+
+ RecoveryCoordinator register_resource(in Resource r)
+ raises(Inactive);
+
+// void register_synchronization (in Synchronization sync)
+// raises(Inactive, SynchronizationUnavailable);
+
+ void register_subtran_aware(in SubtransactionAwareResource r)
+ raises(Inactive, NotSubtransaction);
+
+ void rollback_only()
+ raises(Inactive);
+
+ string get_transaction_name();
+ Control create_subtransaction()
+ raises(SubtransactionsUnavailable, Inactive);
+
+ PropagationContext get_txcontext ()
+ raises(Unavailable);
+ };
+
+
+ interface RecoveryCoordinator {
+ Status replay_completion(in Resource r)
+ raises(NotPrepared);
+ };
+
+ interface Resource {
+ Vote prepare()
+ raises(HeuristicMixed,
+ HeuristicHazard);
+ void rollback()
+ raises( HeuristicCommit,
+ HeuristicMixed,
+ HeuristicHazard );
+ void commit()
+ raises( NotPrepared,
+ HeuristicRollback,
+ HeuristicMixed,
+ HeuristicHazard );
+ void commit_one_phase()
+ raises( HeuristicHazard,
+ HeuristicRollback,
+ HeuristicMixed);
+ void forget();
+ };
+
+// interface TransactionalObject {
+// };
+
+// interface Synchronization : TransactionalObject {
+// void before_completion();
+// void after_completion(in CosTransactions::Status status);
+// };
+
+ interface SubtransactionAwareResource : Resource {
+ void commit_subtransaction(in Coordinator parent);
+ void rollback_subtransaction();
+ };
+
+}; // End of CosTransactions Module
+
+module ETraP {
+
+ // interface Server
+ interface Server :
+ CosTransactions::Coordinator, CosTransactions::Resource,
+ CosTransactions::RecoveryCoordinator, CosTransactions::Control {
+ };
+// interface Server :
+// CosTransactions::Coordinator, CosTransactions::Resource,
+// CosTransactions::RecoveryCoordinator, CosTransactions::Control,
+// CosTransactions::Synchronization {
+// };
+
+}; // End of ETraP Module
+
+#endif