[Enterprise Extensions only]

Control::get_coordinator

Overview

Returns an object that supports the Coordinator Interface for the transaction represented by the Control object.

Original interface CosTransactions::Control Interface
Exceptions TransactionRolledBack
Unavailable


Intended Usage

The Coordinator object can be used to register resources for the transaction associated with the Control. The Unavailable exception is raised if the Control cannot provide the requested object. The TransactionRolledBack standard exception is raised if the Control object represents a transaction that has rolled back.

IDL Syntax

  Coordinator get_coordinator() 
    raises (Unavailable);

Input parameters

None.

Return values

Coordinator
An object that supports the Coordinator Interface for the transaction represented by the Control object. The caller should not free this object; the Transaction Service retains ownership of it.

Examples

The following examples demonstrate the usage of CosTransactions::Control::get_coordinator.

C++ Example

#include <CosTransactions.hh>
{
   CosTransactions::Current_ptr my_current;
   CosTransactions::Control_ptr control;
   CosTransactions::Coordinator_ptr coord;
   ...
   // Access the CosTransactions::Current object.
   CORBA::Object_ptr orbCurrentPtr = 
     CBSeriesGlobal::orb()->resolve_initial_references("TransactionCurrent");
      my_current = CosTransactions::Current::_narrow(orbCurrentPtr);
   my_current->begin();
   control = my_current->get_control();
   coord = control->get_coordinator();
   ...
}
 

Java Example

import org.omg.CosTransactions.*;
{
   org.omg.CosTransactions.Current my_current;
   org.omg.CosTransactions.Control control;
   org.omg.CosTransactions.Coordinator coord;
   ...
   // Access the org.omg.CosTransactions.Current object.
   org.omg.CORBA.Object orbCurrentPtr =
       com.ibm.CBCUtil.CBSeriesGlobal.orb().resolve_initial_references(
         "TransactionCurrent");
     my_current = org.omg.CosTransactions.CurrentHelper.narrow(orbCurrentPtr);
   my_current.begin();
   control = my_current.get_control();
   coord = control.get_coordinator();
   ...
}