1 23 24 28 package com.sun.jts.jtsxa; 29 30 31 37 38 39 public abstract class OTSResourcePOA extends org.omg.PortableServer.Servant 41 implements com.sun.jts.jtsxa.OTSResourceOperations, 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 ("getGlobalTID", new java.lang.Integer (0)); 50 _methods.put ("prepare", new java.lang.Integer (1)); 51 _methods.put ("rollback", new java.lang.Integer (2)); 52 _methods.put ("commit", new java.lang.Integer (3)); 53 _methods.put ("commit_one_phase", new java.lang.Integer (4)); 54 _methods.put ("forget", new java.lang.Integer (5)); 55 } 56 57 public org.omg.CORBA.portable.OutputStream _invoke (String $method, 58 org.omg.CORBA.portable.InputStream in, 59 org.omg.CORBA.portable.ResponseHandler $rh) 60 { 61 org.omg.CORBA.portable.OutputStream out = null; 62 java.lang.Integer __method = (java.lang.Integer )_methods.get ($method); 63 if (__method == null) 64 throw new org.omg.CORBA.BAD_OPERATION (0, org.omg.CORBA.CompletionStatus.COMPLETED_MAYBE); 65 66 switch (__method.intValue ()) 67 { 68 case 0: { 70 org.omg.CosTransactions.otid_t $result = null; 71 $result = this.getGlobalTID (); 72 out = $rh.createReply(); 73 org.omg.CosTransactions.otid_tHelper.write (out, $result); 74 break; 75 } 76 77 case 1: { 79 try { 80 org.omg.CosTransactions.Vote $result = null; 81 $result = this.prepare (); 82 out = $rh.createReply(); 83 org.omg.CosTransactions.VoteHelper.write (out, $result); 84 } catch (org.omg.CosTransactions.HeuristicMixed $ex) { 85 out = $rh.createExceptionReply (); 86 org.omg.CosTransactions.HeuristicMixedHelper.write (out, $ex); 87 } catch (org.omg.CosTransactions.HeuristicHazard $ex) { 88 out = $rh.createExceptionReply (); 89 org.omg.CosTransactions.HeuristicHazardHelper.write (out, $ex); 90 } 91 break; 92 } 93 94 case 2: { 96 try { 97 this.rollback (); 98 out = $rh.createReply(); 99 } catch (org.omg.CosTransactions.HeuristicCommit $ex) { 100 out = $rh.createExceptionReply (); 101 org.omg.CosTransactions.HeuristicCommitHelper.write (out, $ex); 102 } catch (org.omg.CosTransactions.HeuristicMixed $ex) { 103 out = $rh.createExceptionReply (); 104 org.omg.CosTransactions.HeuristicMixedHelper.write (out, $ex); 105 } catch (org.omg.CosTransactions.HeuristicHazard $ex) { 106 out = $rh.createExceptionReply (); 107 org.omg.CosTransactions.HeuristicHazardHelper.write (out, $ex); 108 } 109 break; 110 } 111 112 case 3: { 114 try { 115 this.commit (); 116 out = $rh.createReply(); 117 } catch (org.omg.CosTransactions.NotPrepared $ex) { 118 out = $rh.createExceptionReply (); 119 org.omg.CosTransactions.NotPreparedHelper.write (out, $ex); 120 } catch (org.omg.CosTransactions.HeuristicRollback $ex) { 121 out = $rh.createExceptionReply (); 122 org.omg.CosTransactions.HeuristicRollbackHelper.write (out, $ex); 123 } catch (org.omg.CosTransactions.HeuristicMixed $ex) { 124 out = $rh.createExceptionReply (); 125 org.omg.CosTransactions.HeuristicMixedHelper.write (out, $ex); 126 } catch (org.omg.CosTransactions.HeuristicHazard $ex) { 127 out = $rh.createExceptionReply (); 128 org.omg.CosTransactions.HeuristicHazardHelper.write (out, $ex); 129 } 130 break; 131 } 132 133 case 4: { 135 try { 136 this.commit_one_phase (); 137 out = $rh.createReply(); 138 } catch (org.omg.CosTransactions.HeuristicHazard $ex) { 139 out = $rh.createExceptionReply (); 140 org.omg.CosTransactions.HeuristicHazardHelper.write (out, $ex); 141 } 142 break; 143 } 144 145 case 5: { 147 this.forget (); 148 out = $rh.createReply(); 149 break; 150 } 151 152 default: 153 throw new org.omg.CORBA.BAD_OPERATION (0, org.omg.CORBA.CompletionStatus.COMPLETED_MAYBE); 154 } 155 156 return out; 157 } 159 private static String [] __ids = { 161 "IDL:jtsxa/OTSResource:1.0", 162 "IDL:omg.org/CosTransactions/Resource:1.0"}; 163 164 public String [] _all_interfaces (org.omg.PortableServer.POA poa, byte[] objectId) 165 { 166 return (String [])__ids.clone (); 167 } 168 169 public OTSResource _this() 170 { 171 return OTSResourceHelper.narrow( 172 super._this_object()); 173 } 174 175 public OTSResource _this(org.omg.CORBA.ORB orb) 176 { 177 return OTSResourceHelper.narrow( 178 super._this_object(orb)); 179 } 180 181 182 } | Popular Tags |