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