001    package org.omg.CosTransactions;
002    
003    
004    /**
005     * Generated from IDL interface "SubtransactionAwareResource".
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 abstract class SubtransactionAwareResourcePOA
012            extends org.omg.PortableServer.Servant
013            implements org.omg.CORBA.portable.InvokeHandler, org.omg.CosTransactions.SubtransactionAwareResourceOperations
014    {
015            static private final java.util.Hashtable m_opsHash = new java.util.Hashtable();
016            static
017            {
018                    m_opsHash.put ( "rollback_subtransaction", new java.lang.Integer(0));
019                    m_opsHash.put ( "rollback", new java.lang.Integer(1));
020                    m_opsHash.put ( "commit_subtransaction", new java.lang.Integer(2));
021                    m_opsHash.put ( "commit", new java.lang.Integer(3));
022                    m_opsHash.put ( "prepare", new java.lang.Integer(4));
023                    m_opsHash.put ( "commit_one_phase", new java.lang.Integer(5));
024                    m_opsHash.put ( "forget", new java.lang.Integer(6));
025            }
026            private String[] ids = {"IDL:CosTransactions/SubtransactionAwareResource:1.0","IDL:CosTransactions/Resource:1.0"};
027            public org.omg.CosTransactions.SubtransactionAwareResource _this()
028            {
029                    return org.omg.CosTransactions.SubtransactionAwareResourceHelper.narrow(_this_object());
030            }
031            public org.omg.CosTransactions.SubtransactionAwareResource _this(org.omg.CORBA.ORB orb)
032            {
033                    return org.omg.CosTransactions.SubtransactionAwareResourceHelper.narrow(_this_object(orb));
034            }
035            public org.omg.CORBA.portable.OutputStream _invoke(String method, org.omg.CORBA.portable.InputStream _input, org.omg.CORBA.portable.ResponseHandler handler)
036                    throws org.omg.CORBA.SystemException
037            {
038                    org.omg.CORBA.portable.OutputStream _out = null;
039                    // do something
040                    // quick lookup of operation
041                    java.lang.Integer opsIndex = (java.lang.Integer)m_opsHash.get ( method );
042                    if ( null == opsIndex )
043                            throw new org.omg.CORBA.BAD_OPERATION(method + " not found");
044                    switch ( opsIndex.intValue() )
045                    {
046                            case 0: // rollback_subtransaction
047                            {
048                                    _out = handler.createReply();
049                                    rollback_subtransaction();
050                                    break;
051                            }
052                            case 1: // rollback
053                            {
054                            try
055                            {
056                                    _out = handler.createReply();
057                                    rollback();
058                            }
059                            catch(org.omg.CosTransactions.HeuristicHazard _ex0)
060                            {
061                                    _out = handler.createExceptionReply();
062                                    org.omg.CosTransactions.HeuristicHazardHelper.write(_out, _ex0);
063                            }
064                            catch(org.omg.CosTransactions.HeuristicMixed _ex1)
065                            {
066                                    _out = handler.createExceptionReply();
067                                    org.omg.CosTransactions.HeuristicMixedHelper.write(_out, _ex1);
068                            }
069                            catch(org.omg.CosTransactions.HeuristicCommit _ex2)
070                            {
071                                    _out = handler.createExceptionReply();
072                                    org.omg.CosTransactions.HeuristicCommitHelper.write(_out, _ex2);
073                            }
074                                    break;
075                            }
076                            case 2: // commit_subtransaction
077                            {
078                                    org.omg.CosTransactions.Coordinator _arg0=org.omg.CosTransactions.CoordinatorHelper.read(_input);
079                                    _out = handler.createReply();
080                                    commit_subtransaction(_arg0);
081                                    break;
082                            }
083                            case 3: // commit
084                            {
085                            try
086                            {
087                                    _out = handler.createReply();
088                                    commit();
089                            }
090                            catch(org.omg.CosTransactions.NotPrepared _ex0)
091                            {
092                                    _out = handler.createExceptionReply();
093                                    org.omg.CosTransactions.NotPreparedHelper.write(_out, _ex0);
094                            }
095                            catch(org.omg.CosTransactions.HeuristicHazard _ex1)
096                            {
097                                    _out = handler.createExceptionReply();
098                                    org.omg.CosTransactions.HeuristicHazardHelper.write(_out, _ex1);
099                            }
100                            catch(org.omg.CosTransactions.HeuristicMixed _ex2)
101                            {
102                                    _out = handler.createExceptionReply();
103                                    org.omg.CosTransactions.HeuristicMixedHelper.write(_out, _ex2);
104                            }
105                            catch(org.omg.CosTransactions.HeuristicRollback _ex3)
106                            {
107                                    _out = handler.createExceptionReply();
108                                    org.omg.CosTransactions.HeuristicRollbackHelper.write(_out, _ex3);
109                            }
110                                    break;
111                            }
112                            case 4: // prepare
113                            {
114                            try
115                            {
116                                    _out = handler.createReply();
117                                    org.omg.CosTransactions.VoteHelper.write(_out,prepare());
118                            }
119                            catch(org.omg.CosTransactions.HeuristicHazard _ex0)
120                            {
121                                    _out = handler.createExceptionReply();
122                                    org.omg.CosTransactions.HeuristicHazardHelper.write(_out, _ex0);
123                            }
124                            catch(org.omg.CosTransactions.HeuristicMixed _ex1)
125                            {
126                                    _out = handler.createExceptionReply();
127                                    org.omg.CosTransactions.HeuristicMixedHelper.write(_out, _ex1);
128                            }
129                                    break;
130                            }
131                            case 5: // commit_one_phase
132                            {
133                            try
134                            {
135                                    _out = handler.createReply();
136                                    commit_one_phase();
137                            }
138                            catch(org.omg.CosTransactions.HeuristicHazard _ex0)
139                            {
140                                    _out = handler.createExceptionReply();
141                                    org.omg.CosTransactions.HeuristicHazardHelper.write(_out, _ex0);
142                            }
143                                    break;
144                            }
145                            case 6: // forget
146                            {
147                                    _out = handler.createReply();
148                                    forget();
149                                    break;
150                            }
151                    }
152                    return _out;
153            }
154    
155            public String[] _all_interfaces(org.omg.PortableServer.POA poa, byte[] obj_id)
156            {
157                    return ids;
158            }
159    }