1 23 24 28 package com.sun.jts.otsidl; 29 30 31 37 38 39 public abstract class CoordinatorResourcePOA extends org.omg.PortableServer.Servant 41 implements com.sun.jts.otsidl.CoordinatorResourceOperations, org.omg.CORBA.portable.InvokeHandler 42 { 43 44 46 private static java.util.Hashtable _methods = new java.util.Hashtable (); 47 static 48 { 49 _methods.put ("commit_subtransaction", new java.lang.Integer (0)); 50 _methods.put ("rollback_subtransaction", new java.lang.Integer (1)); 51 _methods.put ("prepare", new java.lang.Integer (2)); 52 _methods.put ("rollback", new java.lang.Integer (3)); 53 _methods.put ("commit", new java.lang.Integer (4)); 54 _methods.put ("commit_one_phase", new java.lang.Integer (5)); 55 _methods.put ("forget", new java.lang.Integer (6)); 56 } 57 58 public org.omg.CORBA.portable.OutputStream _invoke (String $method, 59 org.omg.CORBA.portable.InputStream in, 60 org.omg.CORBA.portable.ResponseHandler $rh) 61 { 62 org.omg.CORBA.portable.OutputStream out = null; 63 java.lang.Integer __method = (java.lang.Integer )_methods.get ($method); 64 if (__method == null) 65 throw new org.omg.CORBA.BAD_OPERATION (0, org.omg.CORBA.CompletionStatus.COMPLETED_MAYBE); 66 67 switch (__method.intValue ()) 68 { 69 case 0: { 71 org.omg.CosTransactions.Coordinator parent = org.omg.CosTransactions.CoordinatorHelper.read (in); 72 this.commit_subtransaction (parent); 73 out = $rh.createReply(); 74 break; 75 } 76 77 case 1: { 79 this.rollback_subtransaction (); 80 out = $rh.createReply(); 81 break; 82 } 83 84 case 2: { 86 try { 87 org.omg.CosTransactions.Vote $result = null; 88 $result = this.prepare (); 89 out = $rh.createReply(); 90 org.omg.CosTransactions.VoteHelper.write (out, $result); 91 } catch (org.omg.CosTransactions.HeuristicMixed $ex) { 92 out = $rh.createExceptionReply (); 93 org.omg.CosTransactions.HeuristicMixedHelper.write (out, $ex); 94 } catch (org.omg.CosTransactions.HeuristicHazard $ex) { 95 out = $rh.createExceptionReply (); 96 org.omg.CosTransactions.HeuristicHazardHelper.write (out, $ex); 97 } 98 break; 99 } 100 101 case 3: { 103 try { 104 this.rollback (); 105 out = $rh.createReply(); 106 } catch (org.omg.CosTransactions.HeuristicCommit $ex) { 107 out = $rh.createExceptionReply (); 108 org.omg.CosTransactions.HeuristicCommitHelper.write (out, $ex); 109 } catch (org.omg.CosTransactions.HeuristicMixed $ex) { 110 out = $rh.createExceptionReply (); 111 org.omg.CosTransactions.HeuristicMixedHelper.write (out, $ex); 112 } catch (org.omg.CosTransactions.HeuristicHazard $ex) { 113 out = $rh.createExceptionReply (); 114 org.omg.CosTransactions.HeuristicHazardHelper.write (out, $ex); 115 } 116 break; 117 } 118 119 case 4: { 121 try { 122 this.commit (); 123 out = $rh.createReply(); 124 } catch (org.omg.CosTransactions.NotPrepared $ex) { 125 out = $rh.createExceptionReply (); 126 org.omg.CosTransactions.NotPreparedHelper.write (out, $ex); 127 } catch (org.omg.CosTransactions.HeuristicRollback $ex) { 128 out = $rh.createExceptionReply (); 129 org.omg.CosTransactions.HeuristicRollbackHelper.write (out, $ex); 130 } catch (org.omg.CosTransactions.HeuristicMixed $ex) { 131 out = $rh.createExceptionReply (); 132 org.omg.CosTransactions.HeuristicMixedHelper.write (out, $ex); 133 } catch (org.omg.CosTransactions.HeuristicHazard $ex) { 134 out = $rh.createExceptionReply (); 135 org.omg.CosTransactions.HeuristicHazardHelper.write (out, $ex); 136 } 137 break; 138 } 139 140 case 5: { 142 try { 143 this.commit_one_phase (); 144 out = $rh.createReply(); 145 } catch (org.omg.CosTransactions.HeuristicHazard $ex) { 146 out = $rh.createExceptionReply (); 147 org.omg.CosTransactions.HeuristicHazardHelper.write (out, $ex); 148 } 149 break; 150 } 151 152 case 6: { 154 this.forget (); 155 out = $rh.createReply(); 156 break; 157 } 158 159 default: 160 throw new org.omg.CORBA.BAD_OPERATION (0, org.omg.CORBA.CompletionStatus.COMPLETED_MAYBE); 161 } 162 163 return out; 164 } 166 private static String [] __ids = { 168 "IDL:otsidl/CoordinatorResource:1.0", 169 "IDL:omg.org/CosTransactions/SubtransactionAwareResource:1.0", 170 "IDL:omg.org/CosTransactions/Resource:1.0"}; 171 172 public String [] _all_interfaces (org.omg.PortableServer.POA poa, byte[] objectId) 173 { 174 return (String [])__ids.clone (); 175 } 176 177 public CoordinatorResource _this() 178 { 179 return CoordinatorResourceHelper.narrow( 180 super._this_object()); 181 } 182 183 public CoordinatorResource _this(org.omg.CORBA.ORB orb) 184 { 185 return CoordinatorResourceHelper.narrow( 186 super._this_object(orb)); 187 } 188 189 190 } | Popular Tags |