001 package org.omg.CosTransactions; 002 003 004 /** 005 * org/omg/CosTransactions/_CurrentStub.java . 006 * Generated by the IDL-to-Java compiler (portable), version "3.2" 007 * from /builddir/build/BUILD/geronimo-specs-1.6/geronimo-spec-corba/src/main/idl/CosTransactions.idl 008 * Monday, June 18, 2012 10:36:15 AM CEST 009 */ 010 011 012 // Current transaction 013 public class _CurrentStub extends org.omg.CORBA.portable.ObjectImpl implements org.omg.CosTransactions.Current 014 { 015 016 public void begin () throws org.omg.CosTransactions.SubtransactionsUnavailable 017 { 018 org.omg.CORBA.portable.InputStream $in = null; 019 try { 020 org.omg.CORBA.portable.OutputStream $out = _request ("begin", true); 021 $in = _invoke ($out); 022 return; 023 } catch (org.omg.CORBA.portable.ApplicationException $ex) { 024 $in = $ex.getInputStream (); 025 String _id = $ex.getId (); 026 if (_id.equals ("IDL:CosTransactions/SubtransactionsUnavailable:1.0")) 027 throw org.omg.CosTransactions.SubtransactionsUnavailableHelper.read ($in); 028 else 029 throw new org.omg.CORBA.MARSHAL (_id); 030 } catch (org.omg.CORBA.portable.RemarshalException $rm) { 031 begin ( ); 032 } finally { 033 _releaseReply ($in); 034 } 035 } // begin 036 037 public void commit (boolean report_heuristics) throws org.omg.CosTransactions.NoTransaction, org.omg.CosTransactions.HeuristicMixed, org.omg.CosTransactions.HeuristicHazard 038 { 039 org.omg.CORBA.portable.InputStream $in = null; 040 try { 041 org.omg.CORBA.portable.OutputStream $out = _request ("commit", true); 042 $out.write_boolean (report_heuristics); 043 $in = _invoke ($out); 044 return; 045 } catch (org.omg.CORBA.portable.ApplicationException $ex) { 046 $in = $ex.getInputStream (); 047 String _id = $ex.getId (); 048 if (_id.equals ("IDL:CosTransactions/NoTransaction:1.0")) 049 throw org.omg.CosTransactions.NoTransactionHelper.read ($in); 050 else if (_id.equals ("IDL:CosTransactions/HeuristicMixed:1.0")) 051 throw org.omg.CosTransactions.HeuristicMixedHelper.read ($in); 052 else if (_id.equals ("IDL:CosTransactions/HeuristicHazard:1.0")) 053 throw org.omg.CosTransactions.HeuristicHazardHelper.read ($in); 054 else 055 throw new org.omg.CORBA.MARSHAL (_id); 056 } catch (org.omg.CORBA.portable.RemarshalException $rm) { 057 commit (report_heuristics ); 058 } finally { 059 _releaseReply ($in); 060 } 061 } // commit 062 063 public void rollback () throws org.omg.CosTransactions.NoTransaction 064 { 065 org.omg.CORBA.portable.InputStream $in = null; 066 try { 067 org.omg.CORBA.portable.OutputStream $out = _request ("rollback", true); 068 $in = _invoke ($out); 069 return; 070 } catch (org.omg.CORBA.portable.ApplicationException $ex) { 071 $in = $ex.getInputStream (); 072 String _id = $ex.getId (); 073 if (_id.equals ("IDL:CosTransactions/NoTransaction:1.0")) 074 throw org.omg.CosTransactions.NoTransactionHelper.read ($in); 075 else 076 throw new org.omg.CORBA.MARSHAL (_id); 077 } catch (org.omg.CORBA.portable.RemarshalException $rm) { 078 rollback ( ); 079 } finally { 080 _releaseReply ($in); 081 } 082 } // rollback 083 084 public void rollback_only () throws org.omg.CosTransactions.NoTransaction 085 { 086 org.omg.CORBA.portable.InputStream $in = null; 087 try { 088 org.omg.CORBA.portable.OutputStream $out = _request ("rollback_only", true); 089 $in = _invoke ($out); 090 return; 091 } catch (org.omg.CORBA.portable.ApplicationException $ex) { 092 $in = $ex.getInputStream (); 093 String _id = $ex.getId (); 094 if (_id.equals ("IDL:CosTransactions/NoTransaction:1.0")) 095 throw org.omg.CosTransactions.NoTransactionHelper.read ($in); 096 else 097 throw new org.omg.CORBA.MARSHAL (_id); 098 } catch (org.omg.CORBA.portable.RemarshalException $rm) { 099 rollback_only ( ); 100 } finally { 101 _releaseReply ($in); 102 } 103 } // rollback_only 104 105 public org.omg.CosTransactions.Status get_status () 106 { 107 org.omg.CORBA.portable.InputStream $in = null; 108 try { 109 org.omg.CORBA.portable.OutputStream $out = _request ("get_status", true); 110 $in = _invoke ($out); 111 org.omg.CosTransactions.Status $result = org.omg.CosTransactions.StatusHelper.read ($in); 112 return $result; 113 } catch (org.omg.CORBA.portable.ApplicationException $ex) { 114 $in = $ex.getInputStream (); 115 String _id = $ex.getId (); 116 throw new org.omg.CORBA.MARSHAL (_id); 117 } catch (org.omg.CORBA.portable.RemarshalException $rm) { 118 return get_status ( ); 119 } finally { 120 _releaseReply ($in); 121 } 122 } // get_status 123 124 public String get_transaction_name () 125 { 126 org.omg.CORBA.portable.InputStream $in = null; 127 try { 128 org.omg.CORBA.portable.OutputStream $out = _request ("get_transaction_name", true); 129 $in = _invoke ($out); 130 String $result = $in.read_string (); 131 return $result; 132 } catch (org.omg.CORBA.portable.ApplicationException $ex) { 133 $in = $ex.getInputStream (); 134 String _id = $ex.getId (); 135 throw new org.omg.CORBA.MARSHAL (_id); 136 } catch (org.omg.CORBA.portable.RemarshalException $rm) { 137 return get_transaction_name ( ); 138 } finally { 139 _releaseReply ($in); 140 } 141 } // get_transaction_name 142 143 public void set_timeout (int seconds) 144 { 145 org.omg.CORBA.portable.InputStream $in = null; 146 try { 147 org.omg.CORBA.portable.OutputStream $out = _request ("set_timeout", true); 148 $out.write_ulong (seconds); 149 $in = _invoke ($out); 150 return; 151 } catch (org.omg.CORBA.portable.ApplicationException $ex) { 152 $in = $ex.getInputStream (); 153 String _id = $ex.getId (); 154 throw new org.omg.CORBA.MARSHAL (_id); 155 } catch (org.omg.CORBA.portable.RemarshalException $rm) { 156 set_timeout (seconds ); 157 } finally { 158 _releaseReply ($in); 159 } 160 } // set_timeout 161 162 public int get_timeout () 163 { 164 org.omg.CORBA.portable.InputStream $in = null; 165 try { 166 org.omg.CORBA.portable.OutputStream $out = _request ("get_timeout", true); 167 $in = _invoke ($out); 168 int $result = $in.read_ulong (); 169 return $result; 170 } catch (org.omg.CORBA.portable.ApplicationException $ex) { 171 $in = $ex.getInputStream (); 172 String _id = $ex.getId (); 173 throw new org.omg.CORBA.MARSHAL (_id); 174 } catch (org.omg.CORBA.portable.RemarshalException $rm) { 175 return get_timeout ( ); 176 } finally { 177 _releaseReply ($in); 178 } 179 } // get_timeout 180 181 public org.omg.CosTransactions.Control get_control () 182 { 183 org.omg.CORBA.portable.InputStream $in = null; 184 try { 185 org.omg.CORBA.portable.OutputStream $out = _request ("get_control", true); 186 $in = _invoke ($out); 187 org.omg.CosTransactions.Control $result = org.omg.CosTransactions.ControlHelper.read ($in); 188 return $result; 189 } catch (org.omg.CORBA.portable.ApplicationException $ex) { 190 $in = $ex.getInputStream (); 191 String _id = $ex.getId (); 192 throw new org.omg.CORBA.MARSHAL (_id); 193 } catch (org.omg.CORBA.portable.RemarshalException $rm) { 194 return get_control ( ); 195 } finally { 196 _releaseReply ($in); 197 } 198 } // get_control 199 200 public org.omg.CosTransactions.Control suspend () 201 { 202 org.omg.CORBA.portable.InputStream $in = null; 203 try { 204 org.omg.CORBA.portable.OutputStream $out = _request ("suspend", true); 205 $in = _invoke ($out); 206 org.omg.CosTransactions.Control $result = org.omg.CosTransactions.ControlHelper.read ($in); 207 return $result; 208 } catch (org.omg.CORBA.portable.ApplicationException $ex) { 209 $in = $ex.getInputStream (); 210 String _id = $ex.getId (); 211 throw new org.omg.CORBA.MARSHAL (_id); 212 } catch (org.omg.CORBA.portable.RemarshalException $rm) { 213 return suspend ( ); 214 } finally { 215 _releaseReply ($in); 216 } 217 } // suspend 218 219 public void resume (org.omg.CosTransactions.Control which) throws org.omg.CosTransactions.InvalidControl 220 { 221 org.omg.CORBA.portable.InputStream $in = null; 222 try { 223 org.omg.CORBA.portable.OutputStream $out = _request ("resume", true); 224 org.omg.CosTransactions.ControlHelper.write ($out, which); 225 $in = _invoke ($out); 226 return; 227 } catch (org.omg.CORBA.portable.ApplicationException $ex) { 228 $in = $ex.getInputStream (); 229 String _id = $ex.getId (); 230 if (_id.equals ("IDL:CosTransactions/InvalidControl:1.0")) 231 throw org.omg.CosTransactions.InvalidControlHelper.read ($in); 232 else 233 throw new org.omg.CORBA.MARSHAL (_id); 234 } catch (org.omg.CORBA.portable.RemarshalException $rm) { 235 resume (which ); 236 } finally { 237 _releaseReply ($in); 238 } 239 } // resume 240 241 // Type-specific CORBA::Object operations 242 private static String[] __ids = { 243 "IDL:CosTransactions/Current:1.0", 244 "IDL:CORBA/Current:1.0"}; 245 246 public String[] _ids () 247 { 248 return (String[])__ids.clone (); 249 } 250 251 private void readObject (java.io.ObjectInputStream s) throws java.io.IOException 252 { 253 String str = s.readUTF (); 254 String[] args = null; 255 java.util.Properties props = null; 256 org.omg.CORBA.Object obj = org.omg.CORBA.ORB.init (args, props).string_to_object (str); 257 org.omg.CORBA.portable.Delegate delegate = ((org.omg.CORBA.portable.ObjectImpl) obj)._get_delegate (); 258 _set_delegate (delegate); 259 } 260 261 private void writeObject (java.io.ObjectOutputStream s) throws java.io.IOException 262 { 263 String[] args = null; 264 java.util.Properties props = null; 265 String str = org.omg.CORBA.ORB.init (args, props).object_to_string (this); 266 s.writeUTF (str); 267 } 268 } // class _CurrentStub