Package org.omg.CosTransactions

Examples of org.omg.CosTransactions.Control


        if (! contexts.containsKey(current))
            throw new NoTransaction();
        try
        {
            Control control = (Control) contexts.get(current);
            control.get_coordinator().rollback_only();      
            control._release();

            removeContext(current);
        }
        catch (Exception e){
            if (logger.isDebugEnabled())
View Full Code Here


        timeouts.put(Thread.currentThread(), new Integer(seconds));
    }

    public Control suspend()
    {
        Control result = get_control();
        removeContext(Thread.currentThread());
        return result;
    }
View Full Code Here

/* 127 */       InputStream _is = null;
/*     */       try
/*     */       {
/* 130 */         OutputStream _os = _request("create_subtransaction", true);
/* 131 */         _is = _invoke(_os);
/* 132 */         Control _result = ControlHelper.read(_is);
/* 133 */         Control localControl1 = _result;
/*     */         return localControl1;
/*     */       }
/*     */       catch (RemarshalException _rx)
/*     */       {
/*     */       }
/*     */       catch (ApplicationException _ax)
/*     */       {
/* 138 */         String _id = _ax.getId();
/* 139 */         if (_id.equals("IDL:omg.org/CosTransactions/SubtransactionsUnavailable:1.0"))
/*     */         {
/* 141 */           throw SubtransactionsUnavailableHelper.read(_ax.getInputStream());
/*     */         }
/* 143 */         if (_id.equals("IDL:omg.org/CosTransactions/Inactive:1.0"))
/*     */         {
/* 145 */           throw InactiveHelper.read(_ax.getInputStream());
/*     */         }
/* 147 */         throw new RuntimeException("Unexpected exception " + _id);
/*     */       }
/*     */       finally
/*     */       {
/* 151 */         _releaseReply(_is);
/*     */       }
/*     */
/*     */     }
/*     */
/* 156 */     ServantObject _so = _servant_preinvoke("create_subtransaction", _opsClass);
/* 157 */     if (_so == null)
/* 158 */       throw new UNKNOWN("local invocations not supported!"); CoordinatorExtOperations _localServant = (CoordinatorExtOperations)_so.servant;
/*     */     Control _result;
/*     */     try {
/* 163 */       _result = _localServant.create_subtransaction();
/*     */     }
/*     */     finally
/*     */     {
View Full Code Here

/*  179 */       InputStream _is = null;
/*      */       try
/*      */       {
/*  182 */         OutputStream _os = _request("create_subtransaction", true);
/*  183 */         _is = _invoke(_os);
/*  184 */         Control _result = ControlHelper.read(_is);
/*  185 */         Control localControl1 = _result;
/*      */         return localControl1;
/*      */       }
/*      */       catch (RemarshalException _rx)
/*      */       {
/*      */       }
/*      */       catch (ApplicationException _ax)
/*      */       {
/*  190 */         String _id = _ax.getId();
/*  191 */         if (_id.equals("IDL:omg.org/CosTransactions/SubtransactionsUnavailable:1.0"))
/*      */         {
/*  193 */           throw SubtransactionsUnavailableHelper.read(_ax.getInputStream());
/*      */         }
/*  195 */         if (_id.equals("IDL:omg.org/CosTransactions/Inactive:1.0"))
/*      */         {
/*  197 */           throw InactiveHelper.read(_ax.getInputStream());
/*      */         }
/*  199 */         throw new RuntimeException("Unexpected exception " + _id);
/*      */       }
/*      */       finally
/*      */       {
/*  203 */         _releaseReply(_is);
/*      */       }
/*      */
/*      */     }
/*      */
/*  208 */     ServantObject _so = _servant_preinvoke("create_subtransaction", _opsClass);
/*  209 */     if (_so == null)
/*  210 */       throw new UNKNOWN("local invocations not supported!"); TransactionServiceOperations _localServant = (TransactionServiceOperations)_so.servant;
/*      */     Control _result;
/*      */     try {
/*  215 */       _result = _localServant.create_subtransaction();
/*      */     }
/*      */     finally
/*      */     {
View Full Code Here

/*      */       try
/*      */       {
/* 1068 */         OutputStream _os = _request("recreate", true);
/* 1069 */         PropagationContextHelper.write(_os, ctx);
/* 1070 */         _is = _invoke(_os);
/* 1071 */         Control _result = ControlHelper.read(_is);
/* 1072 */         Control localControl1 = _result;
/*      */         return localControl1;
/*      */       }
/*      */       catch (RemarshalException _rx)
/*      */       {
/*      */       }
/*      */       catch (ApplicationException _ax)
/*      */       {
/* 1077 */         String _id = _ax.getId();
/* 1078 */         throw new RuntimeException("Unexpected exception " + _id);
/*      */       }
/*      */       finally
/*      */       {
/* 1082 */         _releaseReply(_is);
/*      */       }
/*      */
/*      */     }
/*      */
/* 1087 */     ServantObject _so = _servant_preinvoke("recreate", _opsClass);
/* 1088 */     if (_so == null)
/* 1089 */       throw new UNKNOWN("local invocations not supported!"); TransactionServiceOperations _localServant = (TransactionServiceOperations)_so.servant;
/*      */     Control _result;
/*      */     try {
/* 1094 */       _result = _localServant.recreate(ctx);
/*      */     }
/*      */     finally
/*      */     {
View Full Code Here

/*      */       try
/*      */       {
/* 1116 */         OutputStream _os = _request("create", true);
/* 1117 */         _os.write_ulong(time_out);
/* 1118 */         _is = _invoke(_os);
/* 1119 */         Control _result = ControlHelper.read(_is);
/* 1120 */         Control localControl1 = _result;
/*      */         return localControl1;
/*      */       }
/*      */       catch (RemarshalException _rx)
/*      */       {
/*      */       }
/*      */       catch (ApplicationException _ax)
/*      */       {
/* 1125 */         String _id = _ax.getId();
/* 1126 */         throw new RuntimeException("Unexpected exception " + _id);
/*      */       }
/*      */       finally
/*      */       {
/* 1130 */         _releaseReply(_is);
/*      */       }
/*      */
/*      */     }
/*      */
/* 1135 */     ServantObject _so = _servant_preinvoke("create", _opsClass);
/* 1136 */     if (_so == null)
/* 1137 */       throw new UNKNOWN("local invocations not supported!"); TransactionServiceOperations _localServant = (TransactionServiceOperations)_so.servant;
/*      */     Control _result;
/*      */     try {
/* 1142 */       _result = _localServant.create(time_out);
/*      */     }
/*      */     finally
/*      */     {
View Full Code Here

/*     */       try
/*     */       {
/*  31 */         OutputStream _os = _request("create", true);
/*  32 */         _os.write_ulong(time_out);
/*  33 */         _is = _invoke(_os);
/*  34 */         Control _result = ControlHelper.read(_is);
/*  35 */         Control localControl1 = _result;
/*     */         return localControl1;
/*     */       }
/*     */       catch (RemarshalException _rx)
/*     */       {
/*     */       }
/*     */       catch (ApplicationException _ax)
/*     */       {
/*  40 */         String _id = _ax.getId();
/*  41 */         throw new RuntimeException("Unexpected exception " + _id);
/*     */       }
/*     */       finally
/*     */       {
/*  45 */         _releaseReply(_is);
/*     */       }
/*     */
/*     */     }
/*     */
/*  50 */     ServantObject _so = _servant_preinvoke("create", _opsClass);
/*  51 */     if (_so == null)
/*  52 */       throw new UNKNOWN("local invocations not supported!"); TransactionFactoryExtOperations _localServant = (TransactionFactoryExtOperations)_so.servant;
/*     */     Control _result;
/*     */     try {
/*  57 */       _result = _localServant.create(time_out);
/*     */     }
/*     */     finally
/*     */     {
View Full Code Here

/*     */       try
/*     */       {
/*  79 */         OutputStream _os = _request("recreate", true);
/*  80 */         PropagationContextHelper.write(_os, ctx);
/*  81 */         _is = _invoke(_os);
/*  82 */         Control _result = ControlHelper.read(_is);
/*  83 */         Control localControl1 = _result;
/*     */         return localControl1;
/*     */       }
/*     */       catch (RemarshalException _rx)
/*     */       {
/*     */       }
/*     */       catch (ApplicationException _ax)
/*     */       {
/*  88 */         String _id = _ax.getId();
/*  89 */         throw new RuntimeException("Unexpected exception " + _id);
/*     */       }
/*     */       finally
/*     */       {
/*  93 */         _releaseReply(_is);
/*     */       }
/*     */
/*     */     }
/*     */
/*  98 */     ServantObject _so = _servant_preinvoke("recreate", _opsClass);
/*  99 */     if (_so == null)
/* 100 */       throw new UNKNOWN("local invocations not supported!"); TransactionFactoryExtOperations _localServant = (TransactionFactoryExtOperations)_so.servant;
/*     */     Control _result;
/*     */     try {
/* 105 */       _result = _localServant.recreate(ctx);
/*     */     }
/*     */     finally
/*     */     {
View Full Code Here

            throw new SubtransactionsUnavailable();

        int timeout = (timeouts.containsKey(thread))?
            ((Integer) timeouts.get(thread)).intValue() : DEFAULT_TIMEOUT;

        Control control = factory.create(timeout);
        contexts.put(thread, control);
   
        try
        {
            org.omg.PortableInterceptor.Current pi_current =
                (org.omg.PortableInterceptor.Current) orb.resolve_initial_references("PICurrent");

            // the info inserted here is actually never needed and mostly a waste of
            // space/bandwidth, since the control itself is transfered also.
            TransIdentity id = new TransIdentity(control.get_coordinator(),
                                                 control.get_terminator(),
                                                 new otid_t(0, 0, new byte[0]));
     
            Any control_any = orb.create_any();
            ControlHelper.insert(control_any, control);
View Full Code Here

        Thread current = Thread.currentThread();

        if (! contexts.containsKey(current))
            throw new NoTransaction();

  Control control = null;
        try
        {
            control = (Control) contexts.get(current);
            control.get_terminator().commit(report_heuristics);   
            control._release();

            removeContext(current);
  }
        catch (org.omg.CORBA.TRANSACTION_ROLLEDBACK tr)
        {
      // Transaction was rolledback.
            if (logger.isDebugEnabled())
                logger.debug("TRANSACTION_ROLLEDBACK: ", tr);

      control._release();
      removeContext(current);
      throw tr; // re-throw the exception
        }
        catch (Exception e)
        {
View Full Code Here

TOP

Related Classes of org.omg.CosTransactions.Control

Copyright © 2018 www.massapicom. 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.