Class ControlImple

java.lang.Object
org.omg.PortableServer.Servant
com.arjuna.ArjunaOTS.ActionControlPOA
com.arjuna.ats.internal.jts.orbspecific.ControlImple
All Implemented Interfaces:
ActionControlOperations, org.omg.CORBA.portable.InvokeHandler, ControlOperations
Direct Known Subclasses:
ServerControl

public class ControlImple extends ActionControlPOA
An implementation of CosTransactions::Control
Since:
JTS 1.0.
Version:
$Id: ControlImple.java 2342 2006-03-30 13:06:17Z $
Author:
Mark Little (mark@arjuna.com)
  • Field Details

  • Constructor Details

    • ControlImple

      public ControlImple(Control parentCon, ArjunaTransactionImple parentTran)
      Create a new instance with the specified parent.
    • ControlImple

      protected ControlImple(Coordinator coordinator, Terminator terminator)
      This is used for implicit context propagation, and for Current.resume on remote transactions. In both cases we need to create a local control given a remove coordinator and terminator, but we can't create a transaction handle.
    • ControlImple

      protected ControlImple(Coordinator coordinator, Terminator terminator, Uid uid)
    • ControlImple

      protected ControlImple(Coordinator coordinator, Terminator terminator, Control parentControl, Uid uid)
    • ControlImple

      protected ControlImple()
      Protected constructor for inheritance. The derived classes are responsible for setting everything up, including adding the control to the list of controls and assigning the Uid variable.
  • Method Details

    • finalize

      public void finalize() throws Throwable
      Overrides:
      finalize in class Object
      Throws:
      Throwable
    • get_uid

      public Uid get_uid()
      Used for garbage collection so we can keep a list of controls and delete local ones.
    • getImplHandle

      public final ArjunaTransactionImple getImplHandle()
      Returns:
      the transaction implementation.
    • getControl

      public final Control getControl()
      Returns:
      the CORBA Control object.
    • get_terminator

      public Terminator get_terminator() throws org.omg.CORBA.SystemException, Unavailable
      Throws:
      org.omg.CORBA.SystemException
      Unavailable
    • get_coordinator

      public Coordinator get_coordinator() throws org.omg.CORBA.SystemException, Unavailable
      Throws:
      org.omg.CORBA.SystemException
      Unavailable
    • set_terminator

      public void set_terminator(Terminator terminator) throws org.omg.CORBA.SystemException, Unavailable
      Throws:
      org.omg.CORBA.SystemException
      Unavailable
    • set_coordinator

      public void set_coordinator(Coordinator coordinator) throws org.omg.CORBA.SystemException, Unavailable
      Throws:
      org.omg.CORBA.SystemException
      Unavailable
    • getParentControl

      public Control getParentControl() throws Unavailable, org.omg.CORBA.SystemException
      Throws:
      Unavailable
      org.omg.CORBA.SystemException
    • destroy

      public void destroy() throws ActiveTransaction, ActiveThreads, BadControl, Destroyed, org.omg.CORBA.SystemException
      destroy should only be called for remote Control objects. Destroy them locally by calling DESTROY_IMPL. Since we assume that a factory will either be remote or local, we can destroy this object and rely upon the ORB to return an exception to subsequent clients which indicates they no longer have a valid reference.
      Throws:
      ActiveTransaction
      ActiveThreads
      BadControl
      Destroyed
      org.omg.CORBA.SystemException
    • getParentImple

      public ControlImple getParentImple()
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • getFinalStatus

      public Status getFinalStatus() throws IllegalStateException
      In the case that the transaction is terminated by the reaper then it will also be tidied up. This means that the internal handle to the real transaction instance will be nulled out. In that case we cache the status just before removing the handle and this method can be used to obtain it.
      Returns:
      the final termination status of the transaction.
      Throws:
      IllegalStateException - thrown if the transaction is still available.
    • canDestroy

      protected void canDestroy() throws ActiveTransaction, ActiveThreads, BadControl, Destroyed, org.omg.CORBA.SystemException
      Throws:
      ActiveTransaction
      ActiveThreads
      BadControl
      Destroyed
      org.omg.CORBA.SystemException
    • canDestroy

      protected void canDestroy(boolean force) throws ActiveTransaction, ActiveThreads, BadControl, Destroyed, org.omg.CORBA.SystemException
      Generally we do not want to destroy the transaction if it is doing some work, or other threads are still registered with it. However, for some situations (e.g., the transaction reaper) we must terminate the transaction regardless.
      Throws:
      ActiveTransaction
      ActiveThreads
      BadControl
      Destroyed
      org.omg.CORBA.SystemException
    • createTransactionHandle

      protected final void createTransactionHandle()
    • duplicateTransactionHandle

      protected final void duplicateTransactionHandle(Coordinator coord, Terminator term)
    • addControl

      protected boolean addControl()
      Transaction needs to call these methods to enable garbage collection to occur. Note, we assume that one ContorlImple per transaction is maintained per address space, so that overwriting a previously added ControlImple for the same tx is not possible.
    • removeControl

      protected boolean removeControl()
    • tidyup

      protected final void tidyup()
      No need to protect with mutex since only called from destroy (and destructor), which is protected with a mutex. Do not call directly without synchronizing.