Author: adc Date: Sat Mar 12 05:04:49 2005 New Revision: 157254 URL: http://svn.apache.org/viewcvs?view=rev&rev=157254 Log: Transaction IDL.
Unable to get CosTSPortability to compile. Added: geronimo/trunk/modules/interop/src/idl/CosTSInteroperation.idl geronimo/trunk/modules/interop/src/idl/CosTSPortability.idl geronimo/trunk/modules/interop/src/idl/CosTransactions.idl Modified: geronimo/trunk/modules/interop/maven.xml geronimo/trunk/modules/interop/src/idl/orb.idl Modified: geronimo/trunk/modules/interop/maven.xml URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/interop/maven.xml?view=diff&r1=157253&r2=157254 ============================================================================== --- geronimo/trunk/modules/interop/maven.xml (original) +++ geronimo/trunk/modules/interop/maven.xml Sat Mar 12 05:04:49 2005 @@ -378,7 +378,78 @@ <goal name="interop:idlj:costxn"> <!-- Are there any CosTransaction IDL files that require generation? --> + <j:set var="pkg.prefix" value="org.apache.geronimo.interop"/> <ant:echo message="Interop :: idlj :: CosTransactions"/> + <ant:exec dir="${basedir}" executable="idlj"> + <ant:arg value="-td"/> + <ant:arg value="${maven.build.src}"/> + <ant:arg value="-i"/> + <ant:arg file="${java.home}/lib"/> + <ant:arg value="-i"/> + <ant:arg file="${maven.src.dir}/idl"/> + <ant:arg value="-verbose"/> + <ant:arg value="-pkgPrefix"/> + <ant:arg value="IOP"/> + <ant:arg value="${pkg.prefix}"/> + <ant:arg value="-pkgPrefix"/> + <ant:arg value="IIOP"/> + <ant:arg value="${pkg.prefix}"/> + <ant:arg value="-pkgPrefix"/> + <ant:arg value="GIOP"/> + <ant:arg value="${pkg.prefix}"/> + <ant:arg value="-pkgPrefix"/> + <ant:arg value="CosNaming"/> + <ant:arg value="${pkg.prefix}"/> + <ant:arg value="-pkgPrefix"/> + <ant:arg value="TimeBase"/> + <ant:arg value="${pkg.prefix}"/> + <ant:arg value="-pkgPrefix"/> + <ant:arg value="CosTransactions"/> + <ant:arg value="${pkg.prefix}"/> + <ant:arg value="-pkgPrefix"/> + <ant:arg value="CosTSInteroperation"/> + <ant:arg value="${pkg.prefix}"/> + <ant:arg value="-pkgPrefix"/> + <ant:arg value="CosTSPortability"/> + <ant:arg value="${pkg.prefix}"/> + <ant:arg file="${maven.src.dir}/idl/CosTransactions.idl"/> + </ant:exec> + + <ant:echo message="Interop :: idlj :: CosTSInteroperation"/> + <ant:exec dir="${basedir}" executable="idlj"> + <ant:arg value="-td"/> + <ant:arg value="${maven.build.src}"/> + <ant:arg value="-i"/> + <ant:arg file="${java.home}/lib"/> + <ant:arg value="-i"/> + <ant:arg file="${maven.src.dir}/idl"/> + <ant:arg value="-verbose"/> + <ant:arg value="-pkgPrefix"/> + <ant:arg value="IOP"/> + <ant:arg value="${pkg.prefix}"/> + <ant:arg value="-pkgPrefix"/> + <ant:arg value="IIOP"/> + <ant:arg value="${pkg.prefix}"/> + <ant:arg value="-pkgPrefix"/> + <ant:arg value="GIOP"/> + <ant:arg value="${pkg.prefix}"/> + <ant:arg value="-pkgPrefix"/> + <ant:arg value="CosNaming"/> + <ant:arg value="${pkg.prefix}"/> + <ant:arg value="-pkgPrefix"/> + <ant:arg value="TimeBase"/> + <ant:arg value="${pkg.prefix}"/> + <ant:arg value="-pkgPrefix"/> + <ant:arg value="CosTransactions"/> + <ant:arg value="${pkg.prefix}"/> + <ant:arg value="-pkgPrefix"/> + <ant:arg value="CosTSInteroperation"/> + <ant:arg value="${pkg.prefix}"/> + <ant:arg value="-pkgPrefix"/> + <ant:arg value="CosTSPortability"/> + <ant:arg value="${pkg.prefix}"/> + <ant:arg file="${maven.src.dir}/idl/CosTSInteroperation.idl"/> + </ant:exec> </goal> <goal name="interop:java:compile"> @@ -395,6 +466,7 @@ <attainGoal name="interop:idlj:interop-rmi-iiop"/> <attainGoal name="interop:idlj:csi"/> <attainGoal name="interop:idlj:security-service"/> + <attainGoal name="interop:idlj:costxn"/> </goal> <preGoal name="java:compile"> Added: geronimo/trunk/modules/interop/src/idl/CosTSInteroperation.idl URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/interop/src/idl/CosTSInteroperation.idl?view=auto&rev=157254 ============================================================================== --- geronimo/trunk/modules/interop/src/idl/CosTSInteroperation.idl (added) +++ geronimo/trunk/modules/interop/src/idl/CosTSInteroperation.idl Sat Mar 12 05:04:49 2005 @@ -0,0 +1,20 @@ +// PIDL for CosTSInteroperation Module, p 10-59 +// CORBAservices, Transaction Service V1.0, 3/94 + +#include <orb.idl> +#include <IOP.idl> +#include <CosTransactions.idl> + +#pragma prefix "omg.org" + + +module CosTSInteroperation { + const IOP::ComponentId TAG_TRANSACTION_POLICY=26; + + struct TransactionPolicyComponent { + CosTransactions::TransactionPolicyValue tpv; + }; + + const IOP::ComponentId TAG_OTS_POLICY= 31; + const IOP::ComponentId TAG_INV_POLICY= 32; +}; Added: geronimo/trunk/modules/interop/src/idl/CosTSPortability.idl URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/interop/src/idl/CosTSPortability.idl?view=auto&rev=157254 ============================================================================== --- geronimo/trunk/modules/interop/src/idl/CosTSPortability.idl (added) +++ geronimo/trunk/modules/interop/src/idl/CosTSPortability.idl Sat Mar 12 05:04:49 2005 @@ -0,0 +1,32 @@ +//File: CosTSPortability.idl +//Part of the Transaction Service + +#ifndef _COS_TS_PORTABILITY_IDL_ +#define _COS_TS_PORTABILITY_IDL_ + +//Note Even though this module is marked PIDL, it compiles with +// an IDL compiler. + +#include <CosTransactions.idl> + +#pragma prefix "omg.org" + +module CosTSPortability { // PIDL + typedef long ReqId; + + interface Sender { + void sending_request(in ReqId id, + out CosTransactions::PropagationContext ctx); + void received_reply(in ReqId id, + in CosTransactions::PropagationContext ctx, + in CORBA::Environment env); + }; + + interface Receiver { + void received_request(in ReqId id, + in CosTransactions::PropagationContext ctx); + void sending_reply(in ReqId id, + out CosTransactions::PropagationContext ctx); + }; +}; +#endif /* ifndef _COS_TS_PORTABILITY_IDL_ */ \ No newline at end of file Added: geronimo/trunk/modules/interop/src/idl/CosTransactions.idl URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/interop/src/idl/CosTransactions.idl?view=auto&rev=157254 ============================================================================== --- geronimo/trunk/modules/interop/src/idl/CosTransactions.idl (added) +++ geronimo/trunk/modules/interop/src/idl/CosTransactions.idl Sat Mar 12 05:04:49 2005 @@ -0,0 +1,247 @@ +#include <orb.idl> + +module CosTransactions { +// DATATYPES +enum Status { + StatusActive, + StatusMarkedRollback, + StatusPrepared, + StatusCommitted, + StatusRolledBack, + StatusUnknown, + StatusNoTransaction, + StatusPreparing, + StatusCommitting, + StatusRollingBack +}; + +enum Vote { + VoteCommit, + VoteRollback, + VoteReadOnly +}; + +typedef unsigned short TransactionPolicyValue; + +// TransactionPolicyValue definitions are deprecated and replaced // +// with new InvocationPolicy and OTSPolicy definitions. They are // +// retained for backward compatibility. // +const TransactionPolicyValue Allows_shared = 0; +const TransactionPolicyValue Allows_none = 1; +const TransactionPolicyValue Requires_shared = 2; +const TransactionPolicyValue Allows_unshared = 3; +const TransactionPolicyValue Allows_either = 4; +const TransactionPolicyValue Requires_unshared = 5; +const TransactionPolicyValue Requires_either = 6; + +// Forward references for interfaces defined later in module +interface Current; +interface TransactionFactory; +interface Control; +interface Terminator; +interface Coordinator; +interface RecoveryCoordinator; +interface Resource; +interface Synchronization; +interface SubtransactionAwareResource; + +// 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; +}; + +// TransactionalObject has been deprecated. See 10.3.10. +interface TransactionalObject; + +// Heuristic exceptions +exception HeuristicRollback {}; +exception HeuristicCommit {}; +exception HeuristicMixed {}; +exception HeuristicHazard {}; + +// Other transaction-specific exceptions +exception SubtransactionsUnavailable {}; +exception NotSubtransaction {}; +exception Inactive {}; +exception NotPrepared {}; +exception NoTransaction {}; +exception InvalidControl {}; +exception Unavailable {}; +exception SynchronizationUnavailable {}; + +// Current transaction +interface Current : CORBA::Current { + void begin() + raises(SubtransactionsUnavailable); + void commit(in boolean report_heuristics) + raises( + NoTransaction, + HeuristicMixed, + HeuristicHazard + ); + void rollback() + raises(NoTransaction); + void rollback_only() + raises(NoTransaction); + Status get_status(); + string get_transaction_name(); + void set_timeout(in unsigned long seconds); + unsigned long get_timeout (); + Control get_control(); + Control suspend(); + void resume(in Control which) + raises(InvalidControl); +}; + +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 + ); + void forget(); +}; + +// TransactionalObject has been deprecated. See 10.3.10. +interface TransactionalObject { +}; + +// TransactionalObject has been deprecated // +// and replaced by the OTSPolicy component // +// Synchronization will use the OTSPolicy of ADAPTS // +// Inheritance from TransactionalObject is for backward compatability // + +interface Synchronization :TransactionalObject { + void before_completion(); + void after_completion(in Status s); +}; + +interface SubtransactionAwareResource : Resource { + void commit_subtransaction(in Coordinator parent); + void rollback_subtransaction(); +}; + +// TransactionPolicyType is deprecated and replaced // +// by InvocationPolicyType and OTSPolicyType // +// It is retained for backward compatibility. // +const CORBA::PolicyType TransactionPolicyType = 46; +interface TransactionPolicy : CORBA::Policy { + readonly attribute TransactionPolicyValue tpv; +}; +typedef unsigned short InvocationPolicyValue; +const InvocationPolicyValue EITHER = 0; +const InvocationPolicyValue SHARED = 1; +const InvocationPolicyValue UNSHARED =2; +typedef unsigned short OTSPolicyValue; +const OTSPolicyValue REQUIRES = 1; +const OTSPolicyValue FORBIDS =2; +const OTSPolicyValue ADAPTS =3; +typedef unsigned short NonTxTargetPolicyValue; +const NonTxTargetPolicyValue PREVENT = 0; +const NonTxTargetPolicyValue PERMIT = 1; +const CORBA::PolicyType INVOCATION_POLICY_TYPE = 55; +interface InvocationPolicy : CORBA::Policy { +readonly attribute InvocationPolicyValue ipv; +}; +const CORBA::PolicyType OTS_POLICY_TYPE = 56; +interface OTSPolicy : CORBA::Policy { +readonly attribute OTSPolicyValue tpv; +}; +const CORBA::PolicyType NON_TX_TARGET_POLICY_TYPE = 57; +interface NonTxTargetPolicy : CORBA::Policy { +readonly attribute NonTxTargetPolicyValue tpv; +}; +}; // End of CosTransactions Module \ No newline at end of file Modified: geronimo/trunk/modules/interop/src/idl/orb.idl URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/interop/src/idl/orb.idl?view=diff&r1=157253&r2=157254 ============================================================================== --- geronimo/trunk/modules/interop/src/idl/orb.idl (original) +++ geronimo/trunk/modules/interop/src/idl/orb.idl Sat Mar 12 05:04:49 2005 @@ -1,10 +1,25 @@ #ifndef _ORB_IDL_ #define _ORB_IDL_ + +// Some definitions from the CORBA module as needed +// by other modules. This file is for declaration +// purposes only!! + module CORBA { - typedef unsigned long ServiceOption; - typedef unsigned long ServiceDetailType; + typedef unsigned long ServiceOption; + typedef unsigned long ServiceDetailType; + + typedef unsigned long PolicyType; - typedef unsigned long PolicyType; + // actually, Current is pseudo, but we need it this way so everything compiles + interface Current {}; + + interface Policy + { + readonly attribute PolicyType policy_type; + Policy copy(); + void destroy(); + }; }; #endif // _ORB_IDL_