Package org.jboss.tm.iiop

Source Code of org.jboss.tm.iiop.TransactionServicePOA

/*     */ package org.jboss.tm.iiop;
/*     */
/*     */ import java.util.Hashtable;
/*     */ import org.omg.CORBA.BAD_OPERATION;
/*     */ import org.omg.CORBA.ORB;
/*     */ import org.omg.CORBA.SystemException;
/*     */ import org.omg.CORBA.portable.InputStream;
/*     */ import org.omg.CORBA.portable.InvokeHandler;
/*     */ import org.omg.CORBA.portable.OutputStream;
/*     */ import org.omg.CORBA.portable.ResponseHandler;
/*     */ import org.omg.CosTransactions.ControlHelper;
/*     */ import org.omg.CosTransactions.Coordinator;
/*     */ import org.omg.CosTransactions.CoordinatorHelper;
/*     */ import org.omg.CosTransactions.HeuristicHazard;
/*     */ import org.omg.CosTransactions.HeuristicHazardHelper;
/*     */ import org.omg.CosTransactions.HeuristicMixed;
/*     */ import org.omg.CosTransactions.HeuristicMixedHelper;
/*     */ import org.omg.CosTransactions.Inactive;
/*     */ import org.omg.CosTransactions.InactiveHelper;
/*     */ import org.omg.CosTransactions.NotPrepared;
/*     */ import org.omg.CosTransactions.NotPreparedHelper;
/*     */ import org.omg.CosTransactions.NotSubtransaction;
/*     */ import org.omg.CosTransactions.NotSubtransactionHelper;
/*     */ import org.omg.CosTransactions.PropagationContext;
/*     */ import org.omg.CosTransactions.PropagationContextHelper;
/*     */ import org.omg.CosTransactions.RecoveryCoordinatorHelper;
/*     */ import org.omg.CosTransactions.Resource;
/*     */ import org.omg.CosTransactions.ResourceHelper;
/*     */ import org.omg.CosTransactions.StatusHelper;
/*     */ import org.omg.CosTransactions.SubtransactionAwareResource;
/*     */ import org.omg.CosTransactions.SubtransactionAwareResourceHelper;
/*     */ import org.omg.CosTransactions.SubtransactionsUnavailable;
/*     */ import org.omg.CosTransactions.SubtransactionsUnavailableHelper;
/*     */ import org.omg.CosTransactions.Synchronization;
/*     */ import org.omg.CosTransactions.SynchronizationHelper;
/*     */ import org.omg.CosTransactions.SynchronizationUnavailable;
/*     */ import org.omg.CosTransactions.SynchronizationUnavailableHelper;
/*     */ import org.omg.CosTransactions.TerminatorHelper;
/*     */ import org.omg.CosTransactions.Unavailable;
/*     */ import org.omg.CosTransactions.UnavailableHelper;
/*     */ import org.omg.PortableServer.POA;
/*     */ import org.omg.PortableServer.Servant;
/*     */
/*     */ public abstract class TransactionServicePOA extends Servant
/*     */   implements InvokeHandler, TransactionServiceOperations
/*     */ {
/*  15 */   private static final Hashtable m_opsHash = new Hashtable();
/*     */
/*  45 */   private String[] ids = { "IDL:org/jboss/tm/iiop/TransactionService:1.0", "IDL:omg.org/CosTransactions/Control:1.0", "IDL:org/jboss/tm/iiop/CoordinatorExt:1.0", "IDL:omg.org/CosTransactions/Terminator:1.0", "IDL:org/jboss/tm/iiop/TransactionFactoryExt:1.0", "IDL:omg.org/CosTransactions/TransactionFactory:1.0", "IDL:omg.org/CosTransactions/RecoveryCoordinator:1.0", "IDL:omg.org/CosTransactions/Coordinator:1.0" };
/*     */
/*     */   public TransactionService _this() {
/*  48 */     return TransactionServiceHelper.narrow(_this_object());
/*     */   }
/*     */
/*     */   public TransactionService _this(ORB orb) {
/*  52 */     return TransactionServiceHelper.narrow(_this_object(orb));
/*     */   }
/*     */
/*     */   public OutputStream _invoke(String method, InputStream _input, ResponseHandler handler) throws SystemException
/*     */   {
/*  57 */     OutputStream _out = null;
/*     */
/*  60 */     Integer opsIndex = (Integer)m_opsHash.get(method);
/*  61 */     if (null == opsIndex)
/*  62 */       throw new BAD_OPERATION(method + " not found");
/*  63 */     switch (opsIndex.intValue())
/*     */     {
/*     */     case 0:
/*  67 */       _out = handler.createReply();
/*  68 */       StatusHelper.write(_out, get_top_level_status());
/*  69 */       break;
/*     */     case 1:
/*     */       try
/*     */       {
/*  75 */         Resource _arg0 = ResourceHelper.read(_input);
/*  76 */         _out = handler.createReply();
/*  77 */         RecoveryCoordinatorHelper.write(_out, register_resource(_arg0));
/*     */       }
/*     */       catch (Inactive _ex0)
/*     */       {
/*  81 */         _out = handler.createExceptionReply();
/*  82 */         InactiveHelper.write(_out, _ex0);
/*     */       }
/*     */
/*     */     case 2:
/*     */       try
/*     */       {
/*  90 */         Resource _arg0 = ResourceHelper.read(_input);
/*  91 */         _out = handler.createReply();
/*  92 */         StatusHelper.write(_out, replay_completion(_arg0));
/*     */       }
/*     */       catch (NotPrepared _ex0)
/*     */       {
/*  96 */         _out = handler.createExceptionReply();
/*  97 */         NotPreparedHelper.write(_out, _ex0);
/*     */       }
/*     */
/*     */     case 3:
/*     */       try
/*     */       {
/* 105 */         _out = handler.createReply();
/* 106 */         ControlHelper.write(_out, create_subtransaction());
/*     */       }
/*     */       catch (SubtransactionsUnavailable _ex0)
/*     */       {
/* 110 */         _out = handler.createExceptionReply();
/* 111 */         SubtransactionsUnavailableHelper.write(_out, _ex0);
/*     */       }
/*     */       catch (Inactive _ex1)
/*     */       {
/* 115 */         _out = handler.createExceptionReply();
/* 116 */         InactiveHelper.write(_out, _ex1);
/*     */       }
/*     */
/*     */     case 4:
/*     */       try
/*     */       {
/* 124 */         boolean _arg0 = _input.read_boolean();
/* 125 */         _out = handler.createReply();
/* 126 */         commit(_arg0);
/*     */       }
/*     */       catch (HeuristicHazard _ex0)
/*     */       {
/* 130 */         _out = handler.createExceptionReply();
/* 131 */         HeuristicHazardHelper.write(_out, _ex0);
/*     */       }
/*     */       catch (HeuristicMixed _ex1)
/*     */       {
/* 135 */         _out = handler.createExceptionReply();
/* 136 */         HeuristicMixedHelper.write(_out, _ex1);
/*     */       }
/*     */
/*     */     case 5:
/* 142 */       Coordinator _arg0 = CoordinatorHelper.read(_input);
/* 143 */       _out = handler.createReply();
/* 144 */       _out.write_boolean(is_related_transaction(_arg0));
/* 145 */       break;
/*     */     case 6:
/*     */       try
/*     */       {
/* 151 */         _out = handler.createReply();
/* 152 */         rollback_only();
/*     */       }
/*     */       catch (Inactive _ex0)
/*     */       {
/* 156 */         _out = handler.createExceptionReply();
/* 157 */         InactiveHelper.write(_out, _ex0);
/*     */       }
/*     */
/*     */     case 7:
/* 163 */       Coordinator _arg0 = CoordinatorHelper.read(_input);
/* 164 */       _out = handler.createReply();
/* 165 */       _out.write_boolean(is_ancestor_transaction(_arg0));
/* 166 */       break;
/*     */     case 8:
/* 170 */       Coordinator _arg0 = CoordinatorHelper.read(_input);
/* 171 */       _out = handler.createReply();
/* 172 */       _out.write_boolean(is_same_transaction(_arg0));
/* 173 */       break;
/*     */     case 9:
/*     */       try
/*     */       {
/* 179 */         _out = handler.createReply();
/* 180 */         TerminatorHelper.write(_out, get_terminator());
/*     */       }
/*     */       catch (Unavailable _ex0)
/*     */       {
/* 184 */         _out = handler.createExceptionReply();
/* 185 */         UnavailableHelper.write(_out, _ex0);
/*     */       }
/*     */
/*     */     case 10:
/* 191 */       _out = handler.createReply();
/* 192 */       _out.write_ulong(hash_transaction());
/* 193 */       break;
/*     */     case 11:
/* 197 */       _out = handler.createReply();
/* 198 */       StatusHelper.write(_out, get_status());
/* 199 */       break;
/*     */     case 12:
/* 203 */       _out = handler.createReply();
/* 204 */       _out.write_ulong(hash_top_level_tran());
/* 205 */       break;
/*     */     case 13:
/*     */       try
/*     */       {
/* 211 */         _out = handler.createReply();
/* 212 */         CoordinatorHelper.write(_out, get_coordinator());
/*     */       }
/*     */       catch (Unavailable _ex0)
/*     */       {
/* 216 */         _out = handler.createExceptionReply();
/* 217 */         UnavailableHelper.write(_out, _ex0);
/*     */       }
/*     */
/*     */     case 14:
/*     */       try
/*     */       {
/* 225 */         Synchronization _arg0 = SynchronizationHelper.read(_input);
/* 226 */         _out = handler.createReply();
/* 227 */         register_synchronization(_arg0);
/*     */       }
/*     */       catch (SynchronizationUnavailable _ex0)
/*     */       {
/* 231 */         _out = handler.createExceptionReply();
/* 232 */         SynchronizationUnavailableHelper.write(_out, _ex0);
/*     */       }
/*     */       catch (Inactive _ex1)
/*     */       {
/* 236 */         _out = handler.createExceptionReply();
/* 237 */         InactiveHelper.write(_out, _ex1);
/*     */       }
/*     */
/*     */     case 15:
/* 243 */       _out = handler.createReply();
/* 244 */       _out.write_boolean(is_top_level_transaction());
/* 245 */       break;
/*     */     case 16:
/* 249 */       _out = handler.createReply();
/* 250 */       StatusHelper.write(_out, get_parent_status());
/* 251 */       break;
/*     */     case 17:
/* 255 */       int _arg0 = _input.read_ulong();
/* 256 */       _out = handler.createReply();
/* 257 */       TransactionDescHelper.write(_out, create_transaction(_arg0));
/* 258 */       break;
/*     */     case 18:
/*     */       try
/*     */       {
/* 264 */         _out = handler.createReply();
/* 265 */         PropagationContextHelper.write(_out, get_txcontext());
/*     */       }
/*     */       catch (Unavailable _ex0)
/*     */       {
/* 269 */         _out = handler.createExceptionReply();
/* 270 */         UnavailableHelper.write(_out, _ex0);
/*     */       }
/*     */
/*     */     case 19:
/* 276 */       _out = handler.createReply();
/* 277 */       _out.write_string(get_transaction_name());
/* 278 */       break;
/*     */     case 20:
/* 282 */       _out = handler.createReply();
/* 283 */       TransactionIdHelper.write(_out, get_transaction_id());
/* 284 */       break;
/*     */     case 21:
/* 288 */       PropagationContext _arg0 = PropagationContextHelper.read(_input);
/* 289 */       _out = handler.createReply();
/* 290 */       ControlHelper.write(_out, recreate(_arg0));
/* 291 */       break;
/*     */     case 22:
/* 295 */       int _arg0 = _input.read_ulong();
/* 296 */       _out = handler.createReply();
/* 297 */       ControlHelper.write(_out, create(_arg0));
/* 298 */       break;
/*     */     case 23:
/*     */       try
/*     */       {
/* 304 */         SubtransactionAwareResource _arg0 = SubtransactionAwareResourceHelper.read(_input);
/* 305 */         _out = handler.createReply();
/* 306 */         register_subtran_aware(_arg0);
/*     */       }
/*     */       catch (NotSubtransaction _ex0)
/*     */       {
/* 310 */         _out = handler.createExceptionReply();
/* 311 */         NotSubtransactionHelper.write(_out, _ex0);
/*     */       }
/*     */       catch (Inactive _ex1)
/*     */       {
/* 315 */         _out = handler.createExceptionReply();
/* 316 */         InactiveHelper.write(_out, _ex1);
/*     */       }
/*     */
/*     */     case 24:
/* 322 */       Coordinator _arg0 = CoordinatorHelper.read(_input);
/* 323 */       _out = handler.createReply();
/* 324 */       _out.write_boolean(is_descendant_transaction(_arg0));
/* 325 */       break;
/*     */     case 25:
/* 329 */       _out = handler.createReply();
/* 330 */       rollback();
/*     */     }
/*     */
/* 334 */     return _out;
/*     */   }
/*     */
/*     */   public String[] _all_interfaces(POA poa, byte[] obj_id)
/*     */   {
/* 339 */     return this.ids;
/*     */   }
/*     */
/*     */   static
/*     */   {
/*  18 */     m_opsHash.put("get_top_level_status", new Integer(0));
/*  19 */     m_opsHash.put("register_resource", new Integer(1));
/*  20 */     m_opsHash.put("replay_completion", new Integer(2));
/*  21 */     m_opsHash.put("create_subtransaction", new Integer(3));
/*  22 */     m_opsHash.put("commit", new Integer(4));
/*  23 */     m_opsHash.put("is_related_transaction", new Integer(5));
/*  24 */     m_opsHash.put("rollback_only", new Integer(6));
/*  25 */     m_opsHash.put("is_ancestor_transaction", new Integer(7));
/*  26 */     m_opsHash.put("is_same_transaction", new Integer(8));
/*  27 */     m_opsHash.put("get_terminator", new Integer(9));
/*  28 */     m_opsHash.put("hash_transaction", new Integer(10));
/*  29 */     m_opsHash.put("get_status", new Integer(11));
/*  30 */     m_opsHash.put("hash_top_level_tran", new Integer(12));
/*  31 */     m_opsHash.put("get_coordinator", new Integer(13));
/*  32 */     m_opsHash.put("register_synchronization", new Integer(14));
/*  33 */     m_opsHash.put("is_top_level_transaction", new Integer(15));
/*  34 */     m_opsHash.put("get_parent_status", new Integer(16));
/*  35 */     m_opsHash.put("create_transaction", new Integer(17));
/*  36 */     m_opsHash.put("get_txcontext", new Integer(18));
/*  37 */     m_opsHash.put("get_transaction_name", new Integer(19));
/*  38 */     m_opsHash.put("get_transaction_id", new Integer(20));
/*  39 */     m_opsHash.put("recreate", new Integer(21));
/*  40 */     m_opsHash.put("create", new Integer(22));
/*  41 */     m_opsHash.put("register_subtran_aware", new Integer(23));
/*  42 */     m_opsHash.put("is_descendant_transaction", new Integer(24));
/*  43 */     m_opsHash.put("rollback", new Integer(25));
/*     */   }
/*     */ }

/* Location:           /home/mnovotny/projects/EMBEDDED_JBOSS_BETA3_COMMUNITY/embedded/output/lib/embedded-jboss/lib/jboss-embedded-all.jar
* Qualified Name:     org.jboss.tm.iiop.TransactionServicePOA
* JD-Core Version:    0.6.0
*/
TOP

Related Classes of org.jboss.tm.iiop.TransactionServicePOA

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.