Package org.omg.CosTransactions

Examples of org.omg.CosTransactions.Control


    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

        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

      Transaction tx = tm.getTransaction();
      log.debug("have arjuna tx");
      TransactionImple atx = (TransactionImple) tx;
      ControlWrapper cw = atx.getControlWrapper();
      log.debug("lookup control");
      Control c = cw.get_control();
      String ior = ORBManager.getORB().orb().object_to_string(c);
      log.debug("getTransactionIOR: ior: " + ior);
      return ior;
    } else {
      return null;
View Full Code Here

  private static ControlWrapper createControlWrapper(String ior) {
    org.omg.CORBA.Object obj = ORBManager.getORB().orb()
        .string_to_object(ior);

    Control control = org.omg.CosTransactions.ControlHelper.narrow(obj);
    if (control == null)
      log.warn("createProxy: ior not a control");

    return new ControlWrapper(control);
  }
View Full Code Here

  private static ControlWrapper createControlWrapper(String ior) {
    org.omg.CORBA.Object obj = ORBManager.getORB().orb()
        .string_to_object(ior);

    Control control = org.omg.CosTransactions.ControlHelper.narrow(obj);
    if (control == null)
      log.warn("createProxy: ior not a control");

    return new ControlWrapper(control);
  }
View Full Code Here

      Transaction tx = tm.getTransaction();
      log.debug("have arjuna tx");
      TransactionImple atx = (TransactionImple) tx;
      ControlWrapper cw = atx.getControlWrapper();
      log.debug("lookup control");
      Control c = cw.get_control();
      String ior = ORBManager.getORB().orb().object_to_string(c);
      log.debug("getTransactionIOR: ior: " + ior);
      return ior;
    } else {
      return null;
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.