001 package org.omg.CosTransactions; 002 003 004 /** 005 * Generated from IDL interface "Resource". 006 * 007 * @author JacORB IDL compiler V 2.3.0 (JBoss patch 6), 06-Jun-2007 008 * @version generated at Jun 18, 2012 10:37:00 AM 009 */ 010 011 public class _ResourceStub 012 extends org.omg.CORBA.portable.ObjectImpl 013 implements org.omg.CosTransactions.Resource 014 { 015 private String[] ids = {"IDL:CosTransactions/Resource:1.0"}; 016 public String[] _ids() 017 { 018 return ids; 019 } 020 021 public final static java.lang.Class _opsClass = org.omg.CosTransactions.ResourceOperations.class; 022 public void rollback() throws org.omg.CosTransactions.HeuristicHazard,org.omg.CosTransactions.HeuristicMixed,org.omg.CosTransactions.HeuristicCommit 023 { 024 while(true) 025 { 026 if(! this._is_local()) 027 { 028 org.omg.CORBA.portable.InputStream _is = null; 029 try 030 { 031 org.omg.CORBA.portable.OutputStream _os = _request( "rollback", true); 032 _is = _invoke(_os); 033 return; 034 } 035 catch( org.omg.CORBA.portable.RemarshalException _rx ){} 036 catch( org.omg.CORBA.portable.ApplicationException _ax ) 037 { 038 String _id = _ax.getId(); 039 if( _id.equals("IDL:CosTransactions/HeuristicHazard:1.0")) 040 { 041 throw org.omg.CosTransactions.HeuristicHazardHelper.read(_ax.getInputStream()); 042 } 043 else if( _id.equals("IDL:CosTransactions/HeuristicMixed:1.0")) 044 { 045 throw org.omg.CosTransactions.HeuristicMixedHelper.read(_ax.getInputStream()); 046 } 047 else if( _id.equals("IDL:CosTransactions/HeuristicCommit:1.0")) 048 { 049 throw org.omg.CosTransactions.HeuristicCommitHelper.read(_ax.getInputStream()); 050 } 051 throw new RuntimeException("Unexpected exception " + _id ); 052 } 053 finally 054 { 055 this._releaseReply(_is); 056 } 057 } 058 else 059 { 060 org.omg.CORBA.portable.ServantObject _so = _servant_preinvoke( "rollback", _opsClass ); 061 if( _so == null ) 062 throw new org.omg.CORBA.UNKNOWN("local invocations not supported!"); 063 ResourceOperations _localServant = (ResourceOperations)_so.servant; 064 try 065 { 066 _localServant.rollback(); 067 } 068 finally 069 { 070 _servant_postinvoke(_so); 071 } 072 return; 073 } 074 075 } 076 077 } 078 079 public void commit() throws org.omg.CosTransactions.NotPrepared,org.omg.CosTransactions.HeuristicHazard,org.omg.CosTransactions.HeuristicMixed,org.omg.CosTransactions.HeuristicRollback 080 { 081 while(true) 082 { 083 if(! this._is_local()) 084 { 085 org.omg.CORBA.portable.InputStream _is = null; 086 try 087 { 088 org.omg.CORBA.portable.OutputStream _os = _request( "commit", true); 089 _is = _invoke(_os); 090 return; 091 } 092 catch( org.omg.CORBA.portable.RemarshalException _rx ){} 093 catch( org.omg.CORBA.portable.ApplicationException _ax ) 094 { 095 String _id = _ax.getId(); 096 if( _id.equals("IDL:CosTransactions/NotPrepared:1.0")) 097 { 098 throw org.omg.CosTransactions.NotPreparedHelper.read(_ax.getInputStream()); 099 } 100 else if( _id.equals("IDL:CosTransactions/HeuristicHazard:1.0")) 101 { 102 throw org.omg.CosTransactions.HeuristicHazardHelper.read(_ax.getInputStream()); 103 } 104 else if( _id.equals("IDL:CosTransactions/HeuristicMixed:1.0")) 105 { 106 throw org.omg.CosTransactions.HeuristicMixedHelper.read(_ax.getInputStream()); 107 } 108 else if( _id.equals("IDL:CosTransactions/HeuristicRollback:1.0")) 109 { 110 throw org.omg.CosTransactions.HeuristicRollbackHelper.read(_ax.getInputStream()); 111 } 112 throw new RuntimeException("Unexpected exception " + _id ); 113 } 114 finally 115 { 116 this._releaseReply(_is); 117 } 118 } 119 else 120 { 121 org.omg.CORBA.portable.ServantObject _so = _servant_preinvoke( "commit", _opsClass ); 122 if( _so == null ) 123 throw new org.omg.CORBA.UNKNOWN("local invocations not supported!"); 124 ResourceOperations _localServant = (ResourceOperations)_so.servant; 125 try 126 { 127 _localServant.commit(); 128 } 129 finally 130 { 131 _servant_postinvoke(_so); 132 } 133 return; 134 } 135 136 } 137 138 } 139 140 public org.omg.CosTransactions.Vote prepare() throws org.omg.CosTransactions.HeuristicHazard,org.omg.CosTransactions.HeuristicMixed 141 { 142 while(true) 143 { 144 if(! this._is_local()) 145 { 146 org.omg.CORBA.portable.InputStream _is = null; 147 try 148 { 149 org.omg.CORBA.portable.OutputStream _os = _request( "prepare", true); 150 _is = _invoke(_os); 151 org.omg.CosTransactions.Vote _result = org.omg.CosTransactions.VoteHelper.read(_is); 152 return _result; 153 } 154 catch( org.omg.CORBA.portable.RemarshalException _rx ){} 155 catch( org.omg.CORBA.portable.ApplicationException _ax ) 156 { 157 String _id = _ax.getId(); 158 if( _id.equals("IDL:CosTransactions/HeuristicHazard:1.0")) 159 { 160 throw org.omg.CosTransactions.HeuristicHazardHelper.read(_ax.getInputStream()); 161 } 162 else if( _id.equals("IDL:CosTransactions/HeuristicMixed:1.0")) 163 { 164 throw org.omg.CosTransactions.HeuristicMixedHelper.read(_ax.getInputStream()); 165 } 166 throw new RuntimeException("Unexpected exception " + _id ); 167 } 168 finally 169 { 170 this._releaseReply(_is); 171 } 172 } 173 else 174 { 175 org.omg.CORBA.portable.ServantObject _so = _servant_preinvoke( "prepare", _opsClass ); 176 if( _so == null ) 177 throw new org.omg.CORBA.UNKNOWN("local invocations not supported!"); 178 ResourceOperations _localServant = (ResourceOperations)_so.servant; 179 org.omg.CosTransactions.Vote _result; 180 try 181 { 182 _result = _localServant.prepare(); 183 } 184 finally 185 { 186 _servant_postinvoke(_so); 187 } 188 return _result; 189 } 190 191 } 192 193 } 194 195 public void forget() 196 { 197 while(true) 198 { 199 if(! this._is_local()) 200 { 201 org.omg.CORBA.portable.InputStream _is = null; 202 try 203 { 204 org.omg.CORBA.portable.OutputStream _os = _request( "forget", true); 205 _is = _invoke(_os); 206 return; 207 } 208 catch( org.omg.CORBA.portable.RemarshalException _rx ){} 209 catch( org.omg.CORBA.portable.ApplicationException _ax ) 210 { 211 String _id = _ax.getId(); 212 throw new RuntimeException("Unexpected exception " + _id ); 213 } 214 finally 215 { 216 this._releaseReply(_is); 217 } 218 } 219 else 220 { 221 org.omg.CORBA.portable.ServantObject _so = _servant_preinvoke( "forget", _opsClass ); 222 if( _so == null ) 223 throw new org.omg.CORBA.UNKNOWN("local invocations not supported!"); 224 ResourceOperations _localServant = (ResourceOperations)_so.servant; 225 try 226 { 227 _localServant.forget(); 228 } 229 finally 230 { 231 _servant_postinvoke(_so); 232 } 233 return; 234 } 235 236 } 237 238 } 239 240 public void commit_one_phase() throws org.omg.CosTransactions.HeuristicHazard 241 { 242 while(true) 243 { 244 if(! this._is_local()) 245 { 246 org.omg.CORBA.portable.InputStream _is = null; 247 try 248 { 249 org.omg.CORBA.portable.OutputStream _os = _request( "commit_one_phase", true); 250 _is = _invoke(_os); 251 return; 252 } 253 catch( org.omg.CORBA.portable.RemarshalException _rx ){} 254 catch( org.omg.CORBA.portable.ApplicationException _ax ) 255 { 256 String _id = _ax.getId(); 257 if( _id.equals("IDL:CosTransactions/HeuristicHazard:1.0")) 258 { 259 throw org.omg.CosTransactions.HeuristicHazardHelper.read(_ax.getInputStream()); 260 } 261 throw new RuntimeException("Unexpected exception " + _id ); 262 } 263 finally 264 { 265 this._releaseReply(_is); 266 } 267 } 268 else 269 { 270 org.omg.CORBA.portable.ServantObject _so = _servant_preinvoke( "commit_one_phase", _opsClass ); 271 if( _so == null ) 272 throw new org.omg.CORBA.UNKNOWN("local invocations not supported!"); 273 ResourceOperations _localServant = (ResourceOperations)_so.servant; 274 try 275 { 276 _localServant.commit_one_phase(); 277 } 278 finally 279 { 280 _servant_postinvoke(_so); 281 } 282 return; 283 } 284 285 } 286 287 } 288 289 }