Class ControlImpl

  • All Implemented Interfaces:
    JControlOperations, Serializable, org.omg.CORBA.Object, org.omg.CORBA.portable.IDLEntity, org.omg.CORBA.portable.InvokeHandler, org.omg.CosTransactions.Control, org.omg.CosTransactions.ControlOperations

    public class ControlImpl
    extends JControlPOA
    implements org.omg.CosTransactions.Control
    The ControlImpl interface is our implementation of the standard Control interface. It provides operations to set and subsequently obtain the Terminator and Coordinator objects from the given context. Our implementation also provides a method to obtain the corresponding transaction identifiers, and stacking methods.
    Version:
    0.01
    Author:
    Simon Holdsworth, IBM Corporation
    See Also:
    Serialized Form
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      org.omg.CORBA.Request _create_request​(org.omg.CORBA.Context ctx, String operation, org.omg.CORBA.NVList arg_list, org.omg.CORBA.NamedValue result)  
      org.omg.CORBA.Request _create_request​(org.omg.CORBA.Context ctx, String operation, org.omg.CORBA.NVList arg_list, org.omg.CORBA.NamedValue result, org.omg.CORBA.ExceptionList exceptions, org.omg.CORBA.ContextList contexts)  
      org.omg.CORBA.Object _duplicate()  
      org.omg.CORBA.DomainManager[] _get_domain_managers()  
      org.omg.CORBA.Object _get_interface_def()  
      org.omg.CORBA.Policy _get_policy​(int policy_type)  
      int _hash​(int maximum)  
      boolean _is_a​(String repository_id)  
      boolean _is_equivalent​(org.omg.CORBA.Object that)  
      boolean _non_existent()  
      void _release()  
      org.omg.CORBA.Request _request​(String operation)  
      org.omg.CORBA.Object _set_policy_override​(org.omg.CORBA.Policy[] policies, org.omg.CORBA.SetOverrideType set_add)  
      void doFinalize()
      Cleans up the state of the object.
      boolean equals​(Object o)
      Added to prevent null delegate problem.
      org.omg.CosTransactions.Coordinator get_coordinator()
      Returns the Coordinator for the transaction.
      org.omg.CosTransactions.Coordinator get_localCoordinator()
      Returns the Coordinator for the transaction.
      org.omg.CosTransactions.Terminator get_localTerminator()  
      org.omg.CosTransactions.Terminator get_terminator()
      Returns the Terminator object for the transaction.
      GlobalTID getGlobalTID()
      Returns the identifier that globally represents the transaction
      org.omg.CosTransactions.otid_t getGlobalTID​(org.omg.CosTransactions.StatusHolder status)
      Returns the identifier that globally represents the transaction, and a value that indicates the state of the transaction.
      long getLocalTID​(org.omg.CosTransactions.StatusHolder status)
      Returns the identifier that locally represents the transaction, and a value that indicates the state of the transaction.
      org.omg.CosTransactions.Status getTranState()
      Returns the state of the transaction as the Control object knows it.
      int hashCode()
      Added because this class overrides equals() method.
      static ControlImpl servant​(JControl control)
      Returns the ControlImpl which serves the given object.
      void setTranState​(org.omg.CosTransactions.Status newState)
      Sets the state of the transaction as the Control object knows it.
      • Methods inherited from class org.omg.PortableServer.Servant

        _default_POA, _get_delegate, _object_id, _orb, _poa, _set_delegate, _this_object, _this_object
    • Field Detail

      • temporary

        protected boolean temporary
      • inSuspended

        protected boolean inSuspended
      • tranState

        protected org.omg.CosTransactions.Status tranState
      • coord

        protected com.sun.jts.CosTransactions.CoordinatorImpl coord
      • coordRef

        protected org.omg.CosTransactions.Coordinator coordRef
      • term

        protected com.sun.jts.CosTransactions.TerminatorImpl term
      • termRef

        protected org.omg.CosTransactions.Terminator termRef
      • localTID

        protected Long localTID
      • representsRemote

        protected boolean representsRemote
      • cachedContext

        protected org.omg.CosTransactions.PropagationContext cachedContext
      • outgoing

        protected int outgoing
      • association

        protected int association
    • Method Detail

      • doFinalize

        public void doFinalize()
        Cleans up the state of the object.
      • getGlobalTID

        public GlobalTID getGlobalTID()
        Returns the identifier that globally represents the transaction
        Returns:
        The global identifier.
      • getGlobalTID

        public org.omg.CosTransactions.otid_t getGlobalTID​(org.omg.CosTransactions.StatusHolder status)
                                                    throws org.omg.CORBA.SystemException
        Returns the identifier that globally represents the transaction, and a value that indicates the state of the transaction.
        Specified by:
        getGlobalTID in interface JControlOperations
        Parameters:
        status - An object to hold the status value, or null.
        Returns:
        The global identifier.
        Throws:
        org.omg.CORBA.SystemException - An error occurred. The minor code indicates the reason for the exception.
      • getLocalTID

        public long getLocalTID​(org.omg.CosTransactions.StatusHolder status)
                         throws org.omg.CORBA.SystemException
        Returns the identifier that locally represents the transaction, and a value that indicates the state of the transaction.

        If the transaction represented by the Control object has been completed, the identifier is still returned if possible.

        Specified by:
        getLocalTID in interface JControlOperations
        Parameters:
        status - An object to hold the status value, or null.
        Returns:
        The local transaction identifier.
        Throws:
        org.omg.CORBA.SystemException - An error occurred. The minor code indicates the reason for the exception.
      • get_terminator

        public org.omg.CosTransactions.Terminator get_terminator()
                                                          throws org.omg.CosTransactions.Unavailable,
                                                                 org.omg.CORBA.SystemException
        Returns the Terminator object for the transaction. We raise the Unavailable exception when there is no Terminator. If the transaction has been completed, an appropriate exception is raised. This operation is part of the OMG interface and must not return any exceptions other than those defined in the OMG interface.
        Specified by:
        get_terminator in interface org.omg.CosTransactions.ControlOperations
        Returns:
        The Terminator for the transaction.
        Throws:
        org.omg.CosTransactions.Unavailable - The Terminator object is not available.
        org.omg.CORBA.SystemException - The operation failed.
      • get_localTerminator

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

        public org.omg.CosTransactions.Coordinator get_coordinator()
                                                            throws org.omg.CosTransactions.Unavailable,
                                                                   org.omg.CORBA.SystemException
        Returns the Coordinator for the transaction. If the transaction has been completed, an appropriate exception is raised. This operation is part of the OMG interface and must not return any exceptions other than those defined in the OMG interface.
        Specified by:
        get_coordinator in interface org.omg.CosTransactions.ControlOperations
        Returns:
        The Coordinator for the transaction.
        Throws:
        org.omg.CosTransactions.Unavailable - The Coordinator is not available.
        org.omg.CORBA.SystemException - The operation failed.
      • get_localCoordinator

        public org.omg.CosTransactions.Coordinator get_localCoordinator()
                                                                 throws org.omg.CosTransactions.Unavailable,
                                                                        org.omg.CORBA.SystemException
        Returns the Coordinator for the transaction. If the transaction has been completed, an appropriate exception is raised. This operation is part of the OMG interface and must not return any exceptions other than those defined in the OMG interface.
        Returns:
        The Coordinator for the transaction.
        Throws:
        org.omg.CosTransactions.Unavailable - The Coordinator is not available.
        org.omg.CORBA.SystemException - The operation failed.
      • getTranState

        public org.omg.CosTransactions.Status getTranState()
        Returns the state of the transaction as the Control object knows it.
        Specified by:
        getTranState in interface JControlOperations
        Returns:
        The transaction state.
      • setTranState

        public void setTranState​(org.omg.CosTransactions.Status newState)
        Sets the state of the transaction as the Control object knows it. No checking is done to verify the state change is valid.
        Specified by:
        setTranState in interface JControlOperations
        Parameters:
        int - The new state.
      • servant

        public static final ControlImpl servant​(JControl control)
        Returns the ControlImpl which serves the given object.
        Parameters:
        The - CORBA Object.
        Returns:
        The ControlImpl object which serves it.
      • equals

        public boolean equals​(Object o)
        Added to prevent null delegate problem.
        Overrides:
        equals in class Object
        Returns:
      • hashCode

        public int hashCode()
        Added because this class overrides equals() method.
        Overrides:
        hashCode in class Object
      • _duplicate

        public org.omg.CORBA.Object _duplicate()
        Specified by:
        _duplicate in interface org.omg.CORBA.Object
      • _release

        public void _release()
        Specified by:
        _release in interface org.omg.CORBA.Object
      • _is_a

        public boolean _is_a​(String repository_id)
        Specified by:
        _is_a in interface org.omg.CORBA.Object
        Overrides:
        _is_a in class org.omg.PortableServer.Servant
      • _is_equivalent

        public boolean _is_equivalent​(org.omg.CORBA.Object that)
        Specified by:
        _is_equivalent in interface org.omg.CORBA.Object
      • _non_existent

        public boolean _non_existent()
        Specified by:
        _non_existent in interface org.omg.CORBA.Object
        Overrides:
        _non_existent in class org.omg.PortableServer.Servant
      • _hash

        public int _hash​(int maximum)
        Specified by:
        _hash in interface org.omg.CORBA.Object
      • _request

        public org.omg.CORBA.Request _request​(String operation)
        Specified by:
        _request in interface org.omg.CORBA.Object
      • _create_request

        public org.omg.CORBA.Request _create_request​(org.omg.CORBA.Context ctx,
                                                     String operation,
                                                     org.omg.CORBA.NVList arg_list,
                                                     org.omg.CORBA.NamedValue result)
        Specified by:
        _create_request in interface org.omg.CORBA.Object
      • _create_request

        public org.omg.CORBA.Request _create_request​(org.omg.CORBA.Context ctx,
                                                     String operation,
                                                     org.omg.CORBA.NVList arg_list,
                                                     org.omg.CORBA.NamedValue result,
                                                     org.omg.CORBA.ExceptionList exceptions,
                                                     org.omg.CORBA.ContextList contexts)
        Specified by:
        _create_request in interface org.omg.CORBA.Object
      • _get_interface_def

        public org.omg.CORBA.Object _get_interface_def()
        Specified by:
        _get_interface_def in interface org.omg.CORBA.Object
        Overrides:
        _get_interface_def in class org.omg.PortableServer.Servant
      • _get_policy

        public org.omg.CORBA.Policy _get_policy​(int policy_type)
        Specified by:
        _get_policy in interface org.omg.CORBA.Object
      • _get_domain_managers

        public org.omg.CORBA.DomainManager[] _get_domain_managers()
        Specified by:
        _get_domain_managers in interface org.omg.CORBA.Object
      • _set_policy_override

        public org.omg.CORBA.Object _set_policy_override​(org.omg.CORBA.Policy[] policies,
                                                         org.omg.CORBA.SetOverrideType set_add)
        Specified by:
        _set_policy_override in interface org.omg.CORBA.Object