Package org.omg.CosTransactions

Examples of org.omg.CosTransactions.Control


      boolean correct = true;

      for (int index = 0; correct && (index < numberOfControls); index++)
      {
        Control control = transactionFactory.create(0);

        correct = correct && (control.get_coordinator().get_status() == Status.StatusActive);

        control.get_terminator().rollback();
      }

      if (correct)
      {
        System.out.println("Passed");
View Full Code Here


    {
      try
      {
        for (int index = 0; _correct && (index < _numberOfControls); index++)
        {
          Control control = _transactionFactory.create(0);

          _correct = _correct && (control.get_coordinator().get_status() == Status.StatusActive);

          int option = index % 3;

          if (option == 0)
          {
            control.get_terminator().commit(true);
          }
          else if (option == 1)
          {
            control.get_terminator().commit(false);
          }
          else
          {
            control.get_terminator().rollback();
          }
        }
      }
      catch (Exception exception)
      {
View Full Code Here

      transactionFactory = TransactionFactoryHelper.narrow(ORBServices.getService(ORBServices.transactionService, transactionFactoryParams));


      boolean correct;
      Control control = transactionFactory.create(4);

      Thread.sleep(8000);

      try
      {
        control.get_terminator().rollback();
        correct = false;
      }
      catch (INVALID_TRANSACTION invalidTransaction)
      {
        correct = true;
View Full Code Here

      transactionFactory = TransactionFactoryHelper.narrow(ORBServices.getService(ORBServices.transactionService, transactionFactoryParams));


      boolean correct = true;
      Control control = transactionFactory.create(0);

      correct = correct && (control.get_coordinator().get_status() == Status.StatusActive);

      control.get_terminator().commit(true);

      if (correct)
      {
        System.out.println("Passed");
      }
View Full Code Here

      boolean correct = true;

      for (int index = 0; correct && (index < numberOfControls); index++)
      {
        Control control = transactionFactory.create(0);

        correct = correct && (control.get_coordinator().get_status() == Status.StatusActive);

        control.get_terminator().commit(true);
      }

      if (correct)
      {
        System.out.println("Passed");
View Full Code Here

      Current current = OTS.get_current();

      current.begin();
      current.commit(false);

      Control control = current.suspend();

      correct = (control == null);

      if (correct)
      {
View Full Code Here

    orb.resolve_initial_references("PICurrent");

            PropagationContext context = PropagationContextHelper.extract
                (pi_current.get_slot(slot_id));

            Control control = ControlHelper.extract(context.implementation_specific_data);
            ts_current.resume(control);
        }
        catch(Exception e)
        {
            if (logger.isDebugEnabled())
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

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

            removeContext(current);
        }
        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.