001    package org.omg.CosTransactions;
002    
003    
004    /**
005    * org/omg/CosTransactions/_ResourceStub.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 _ResourceStub extends org.omg.CORBA.portable.ObjectImpl implements org.omg.CosTransactions.Resource
012    {
013    
014      public org.omg.CosTransactions.Vote prepare () throws org.omg.CosTransactions.HeuristicMixed, org.omg.CosTransactions.HeuristicHazard
015      {
016                org.omg.CORBA.portable.InputStream $in = null;
017                try {
018                    org.omg.CORBA.portable.OutputStream $out = _request ("prepare", true);
019                    $in = _invoke ($out);
020                    org.omg.CosTransactions.Vote $result = org.omg.CosTransactions.VoteHelper.read ($in);
021                    return $result;
022                } catch (org.omg.CORBA.portable.ApplicationException $ex) {
023                    $in = $ex.getInputStream ();
024                    String _id = $ex.getId ();
025                    if (_id.equals ("IDL:CosTransactions/HeuristicMixed:1.0"))
026                        throw org.omg.CosTransactions.HeuristicMixedHelper.read ($in);
027                    else if (_id.equals ("IDL:CosTransactions/HeuristicHazard:1.0"))
028                        throw org.omg.CosTransactions.HeuristicHazardHelper.read ($in);
029                    else
030                        throw new org.omg.CORBA.MARSHAL (_id);
031                } catch (org.omg.CORBA.portable.RemarshalException $rm) {
032                    return prepare (        );
033                } finally {
034                    _releaseReply ($in);
035                }
036      } // prepare
037    
038      public void rollback () throws org.omg.CosTransactions.HeuristicCommit, org.omg.CosTransactions.HeuristicMixed, org.omg.CosTransactions.HeuristicHazard
039      {
040                org.omg.CORBA.portable.InputStream $in = null;
041                try {
042                    org.omg.CORBA.portable.OutputStream $out = _request ("rollback", true);
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/HeuristicCommit:1.0"))
049                        throw org.omg.CosTransactions.HeuristicCommitHelper.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                    rollback (        );
058                } finally {
059                    _releaseReply ($in);
060                }
061      } // rollback
062    
063      public void commit () throws org.omg.CosTransactions.NotPrepared, org.omg.CosTransactions.HeuristicRollback, org.omg.CosTransactions.HeuristicMixed, org.omg.CosTransactions.HeuristicHazard
064      {
065                org.omg.CORBA.portable.InputStream $in = null;
066                try {
067                    org.omg.CORBA.portable.OutputStream $out = _request ("commit", 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/NotPrepared:1.0"))
074                        throw org.omg.CosTransactions.NotPreparedHelper.read ($in);
075                    else if (_id.equals ("IDL:CosTransactions/HeuristicRollback:1.0"))
076                        throw org.omg.CosTransactions.HeuristicRollbackHelper.read ($in);
077                    else if (_id.equals ("IDL:CosTransactions/HeuristicMixed:1.0"))
078                        throw org.omg.CosTransactions.HeuristicMixedHelper.read ($in);
079                    else if (_id.equals ("IDL:CosTransactions/HeuristicHazard:1.0"))
080                        throw org.omg.CosTransactions.HeuristicHazardHelper.read ($in);
081                    else
082                        throw new org.omg.CORBA.MARSHAL (_id);
083                } catch (org.omg.CORBA.portable.RemarshalException $rm) {
084                    commit (        );
085                } finally {
086                    _releaseReply ($in);
087                }
088      } // commit
089    
090      public void commit_one_phase () throws org.omg.CosTransactions.HeuristicHazard
091      {
092                org.omg.CORBA.portable.InputStream $in = null;
093                try {
094                    org.omg.CORBA.portable.OutputStream $out = _request ("commit_one_phase", true);
095                    $in = _invoke ($out);
096                    return;
097                } catch (org.omg.CORBA.portable.ApplicationException $ex) {
098                    $in = $ex.getInputStream ();
099                    String _id = $ex.getId ();
100                    if (_id.equals ("IDL:CosTransactions/HeuristicHazard:1.0"))
101                        throw org.omg.CosTransactions.HeuristicHazardHelper.read ($in);
102                    else
103                        throw new org.omg.CORBA.MARSHAL (_id);
104                } catch (org.omg.CORBA.portable.RemarshalException $rm) {
105                    commit_one_phase (        );
106                } finally {
107                    _releaseReply ($in);
108                }
109      } // commit_one_phase
110    
111      public void forget ()
112      {
113                org.omg.CORBA.portable.InputStream $in = null;
114                try {
115                    org.omg.CORBA.portable.OutputStream $out = _request ("forget", true);
116                    $in = _invoke ($out);
117                    return;
118                } catch (org.omg.CORBA.portable.ApplicationException $ex) {
119                    $in = $ex.getInputStream ();
120                    String _id = $ex.getId ();
121                    throw new org.omg.CORBA.MARSHAL (_id);
122                } catch (org.omg.CORBA.portable.RemarshalException $rm) {
123                    forget (        );
124                } finally {
125                    _releaseReply ($in);
126                }
127      } // forget
128    
129      // Type-specific CORBA::Object operations
130      private static String[] __ids = {
131        "IDL:CosTransactions/Resource:1.0"};
132    
133      public String[] _ids ()
134      {
135        return (String[])__ids.clone ();
136      }
137    
138      private void readObject (java.io.ObjectInputStream s) throws java.io.IOException
139      {
140         String str = s.readUTF ();
141         String[] args = null;
142         java.util.Properties props = null;
143         org.omg.CORBA.Object obj = org.omg.CORBA.ORB.init (args, props).string_to_object (str);
144         org.omg.CORBA.portable.Delegate delegate = ((org.omg.CORBA.portable.ObjectImpl) obj)._get_delegate ();
145         _set_delegate (delegate);
146      }
147    
148      private void writeObject (java.io.ObjectOutputStream s) throws java.io.IOException
149      {
150         String[] args = null;
151         java.util.Properties props = null;
152         String str = org.omg.CORBA.ORB.init (args, props).object_to_string (this);
153         s.writeUTF (str);
154      }
155    } // class _ResourceStub