001    package org.omg.CosTransactions;
002    
003    
004    /**
005    * org/omg/CosTransactions/_SubtransactionAwareResourceStub.java .
006    * Generated by the IDL-to-Java compiler (portable), version "3.2"
007    * from /home/iurt/rpm/BUILD/geronimo-spec-corba/src/main/idl/CosTransactions.idl
008    * Saturday, November 26, 2011 9:53:36 PM UTC
009    */
010    
011    public class _SubtransactionAwareResourceStub extends org.omg.CORBA.portable.ObjectImpl implements org.omg.CosTransactions.SubtransactionAwareResource
012    {
013    
014      public void commit_subtransaction (org.omg.CosTransactions.Coordinator parent)
015      {
016                org.omg.CORBA.portable.InputStream $in = null;
017                try {
018                    org.omg.CORBA.portable.OutputStream $out = _request ("commit_subtransaction", true);
019                    org.omg.CosTransactions.CoordinatorHelper.write ($out, parent);
020                    $in = _invoke ($out);
021                    return;
022                } catch (org.omg.CORBA.portable.ApplicationException $ex) {
023                    $in = $ex.getInputStream ();
024                    String _id = $ex.getId ();
025                    throw new org.omg.CORBA.MARSHAL (_id);
026                } catch (org.omg.CORBA.portable.RemarshalException $rm) {
027                    commit_subtransaction (parent        );
028                } finally {
029                    _releaseReply ($in);
030                }
031      } // commit_subtransaction
032    
033      public void rollback_subtransaction ()
034      {
035                org.omg.CORBA.portable.InputStream $in = null;
036                try {
037                    org.omg.CORBA.portable.OutputStream $out = _request ("rollback_subtransaction", true);
038                    $in = _invoke ($out);
039                    return;
040                } catch (org.omg.CORBA.portable.ApplicationException $ex) {
041                    $in = $ex.getInputStream ();
042                    String _id = $ex.getId ();
043                    throw new org.omg.CORBA.MARSHAL (_id);
044                } catch (org.omg.CORBA.portable.RemarshalException $rm) {
045                    rollback_subtransaction (        );
046                } finally {
047                    _releaseReply ($in);
048                }
049      } // rollback_subtransaction
050    
051      public org.omg.CosTransactions.Vote prepare () throws org.omg.CosTransactions.HeuristicMixed, org.omg.CosTransactions.HeuristicHazard
052      {
053                org.omg.CORBA.portable.InputStream $in = null;
054                try {
055                    org.omg.CORBA.portable.OutputStream $out = _request ("prepare", true);
056                    $in = _invoke ($out);
057                    org.omg.CosTransactions.Vote $result = org.omg.CosTransactions.VoteHelper.read ($in);
058                    return $result;
059                } catch (org.omg.CORBA.portable.ApplicationException $ex) {
060                    $in = $ex.getInputStream ();
061                    String _id = $ex.getId ();
062                    if (_id.equals ("IDL:CosTransactions/HeuristicMixed:1.0"))
063                        throw org.omg.CosTransactions.HeuristicMixedHelper.read ($in);
064                    else if (_id.equals ("IDL:CosTransactions/HeuristicHazard:1.0"))
065                        throw org.omg.CosTransactions.HeuristicHazardHelper.read ($in);
066                    else
067                        throw new org.omg.CORBA.MARSHAL (_id);
068                } catch (org.omg.CORBA.portable.RemarshalException $rm) {
069                    return prepare (        );
070                } finally {
071                    _releaseReply ($in);
072                }
073      } // prepare
074    
075      public void rollback () throws org.omg.CosTransactions.HeuristicCommit, org.omg.CosTransactions.HeuristicMixed, org.omg.CosTransactions.HeuristicHazard
076      {
077                org.omg.CORBA.portable.InputStream $in = null;
078                try {
079                    org.omg.CORBA.portable.OutputStream $out = _request ("rollback", true);
080                    $in = _invoke ($out);
081                    return;
082                } catch (org.omg.CORBA.portable.ApplicationException $ex) {
083                    $in = $ex.getInputStream ();
084                    String _id = $ex.getId ();
085                    if (_id.equals ("IDL:CosTransactions/HeuristicCommit:1.0"))
086                        throw org.omg.CosTransactions.HeuristicCommitHelper.read ($in);
087                    else if (_id.equals ("IDL:CosTransactions/HeuristicMixed:1.0"))
088                        throw org.omg.CosTransactions.HeuristicMixedHelper.read ($in);
089                    else if (_id.equals ("IDL:CosTransactions/HeuristicHazard:1.0"))
090                        throw org.omg.CosTransactions.HeuristicHazardHelper.read ($in);
091                    else
092                        throw new org.omg.CORBA.MARSHAL (_id);
093                } catch (org.omg.CORBA.portable.RemarshalException $rm) {
094                    rollback (        );
095                } finally {
096                    _releaseReply ($in);
097                }
098      } // rollback
099    
100      public void commit () throws org.omg.CosTransactions.NotPrepared, org.omg.CosTransactions.HeuristicRollback, org.omg.CosTransactions.HeuristicMixed, org.omg.CosTransactions.HeuristicHazard
101      {
102                org.omg.CORBA.portable.InputStream $in = null;
103                try {
104                    org.omg.CORBA.portable.OutputStream $out = _request ("commit", true);
105                    $in = _invoke ($out);
106                    return;
107                } catch (org.omg.CORBA.portable.ApplicationException $ex) {
108                    $in = $ex.getInputStream ();
109                    String _id = $ex.getId ();
110                    if (_id.equals ("IDL:CosTransactions/NotPrepared:1.0"))
111                        throw org.omg.CosTransactions.NotPreparedHelper.read ($in);
112                    else if (_id.equals ("IDL:CosTransactions/HeuristicRollback:1.0"))
113                        throw org.omg.CosTransactions.HeuristicRollbackHelper.read ($in);
114                    else if (_id.equals ("IDL:CosTransactions/HeuristicMixed:1.0"))
115                        throw org.omg.CosTransactions.HeuristicMixedHelper.read ($in);
116                    else if (_id.equals ("IDL:CosTransactions/HeuristicHazard:1.0"))
117                        throw org.omg.CosTransactions.HeuristicHazardHelper.read ($in);
118                    else
119                        throw new org.omg.CORBA.MARSHAL (_id);
120                } catch (org.omg.CORBA.portable.RemarshalException $rm) {
121                    commit (        );
122                } finally {
123                    _releaseReply ($in);
124                }
125      } // commit
126    
127      public void commit_one_phase () throws org.omg.CosTransactions.HeuristicHazard
128      {
129                org.omg.CORBA.portable.InputStream $in = null;
130                try {
131                    org.omg.CORBA.portable.OutputStream $out = _request ("commit_one_phase", true);
132                    $in = _invoke ($out);
133                    return;
134                } catch (org.omg.CORBA.portable.ApplicationException $ex) {
135                    $in = $ex.getInputStream ();
136                    String _id = $ex.getId ();
137                    if (_id.equals ("IDL:CosTransactions/HeuristicHazard:1.0"))
138                        throw org.omg.CosTransactions.HeuristicHazardHelper.read ($in);
139                    else
140                        throw new org.omg.CORBA.MARSHAL (_id);
141                } catch (org.omg.CORBA.portable.RemarshalException $rm) {
142                    commit_one_phase (        );
143                } finally {
144                    _releaseReply ($in);
145                }
146      } // commit_one_phase
147    
148      public void forget ()
149      {
150                org.omg.CORBA.portable.InputStream $in = null;
151                try {
152                    org.omg.CORBA.portable.OutputStream $out = _request ("forget", true);
153                    $in = _invoke ($out);
154                    return;
155                } catch (org.omg.CORBA.portable.ApplicationException $ex) {
156                    $in = $ex.getInputStream ();
157                    String _id = $ex.getId ();
158                    throw new org.omg.CORBA.MARSHAL (_id);
159                } catch (org.omg.CORBA.portable.RemarshalException $rm) {
160                    forget (        );
161                } finally {
162                    _releaseReply ($in);
163                }
164      } // forget
165    
166      // Type-specific CORBA::Object operations
167      private static String[] __ids = {
168        "IDL:CosTransactions/SubtransactionAwareResource:1.0", 
169        "IDL:CosTransactions/Resource:1.0"};
170    
171      public String[] _ids ()
172      {
173        return (String[])__ids.clone ();
174      }
175    
176      private void readObject (java.io.ObjectInputStream s) throws java.io.IOException
177      {
178         String str = s.readUTF ();
179         String[] args = null;
180         java.util.Properties props = null;
181         org.omg.CORBA.Object obj = org.omg.CORBA.ORB.init (args, props).string_to_object (str);
182         org.omg.CORBA.portable.Delegate delegate = ((org.omg.CORBA.portable.ObjectImpl) obj)._get_delegate ();
183         _set_delegate (delegate);
184      }
185    
186      private void writeObject (java.io.ObjectOutputStream s) throws java.io.IOException
187      {
188         String[] args = null;
189         java.util.Properties props = null;
190         String str = org.omg.CORBA.ORB.init (args, props).object_to_string (this);
191         s.writeUTF (str);
192      }
193    } // class _SubtransactionAwareResourceStub