org.openorb.ots.Impl
Class SubTransListener

java.lang.Object
  extended by org.omg.PortableServer.Servant
      extended by org.omg.CosTransactions.SubtransactionAwareResourcePOA
          extended by org.openorb.ots.Impl.SubTransListener
All Implemented Interfaces:
org.omg.CORBA.portable.InvokeHandler, ResourceOperations, SubtransactionAwareResourceOperations

public class SubTransListener
extends SubtransactionAwareResourcePOA

This class is a listener for sub transaction completion.

Author:
Jerome Daniel

Constructor Summary
SubTransListener(Coordinator coord, Control ctrl, org.omg.PortableServer.POA poa)
          Constructor
 
Method Summary
 void commit_one_phase()
          If possible, the resource should commit all changes made as part of the transaction.
 void commit_pending()
           
 void commit_subtransaction(Coordinator coord)
          This operation is invoked only if the resource has been registered with a subtransaction and the subtransaction has been committed.
 void commit()
          If necessary, the resource should commit all changes made as part of the transaction.
 void forget()
          This operation is performed only if the resource raised a heuristic outcome exception to rollback, commit, or commit_one_phase.
 Vote prepare()
          This operation is invoked to begin the two-phase commit protocol on the resource.
 void remove()
          This operation is used to remove this object from the POA
 void rollback_pending()
           
 void rollback_subtransaction()
          This operation is invoked only if the resource has been registered with a subtransaction and notifies the resource that the subtransaction has rolled back.
 void rollback()
          If necessary, the resource should rollback all changes made as part of the transaction.
 
Methods inherited from class org.omg.CosTransactions.SubtransactionAwareResourcePOA
_all_interfaces, _invoke, _this, _this
 
Methods inherited from class org.omg.PortableServer.Servant
_default_POA, _get_delegate, _get_interface_def, _is_a, _non_existent, _object_id, _orb, _poa, _set_delegate, _this_object, _this_object
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SubTransListener

public SubTransListener(Coordinator coord,
                        Control ctrl,
                        org.omg.PortableServer.POA poa)
Constructor

Method Detail

commit_pending

public void commit_pending()

rollback_pending

public void rollback_pending()

prepare

public Vote prepare()
             throws HeuristicMixed,
                    HeuristicHazard
Description copied from interface: ResourceOperations
This operation is invoked to begin the two-phase commit protocol on the resource. The resource can respond in several ways, represented by the Vote result. If no persistent data associated with the resource has been modified by the transaction, the resource can return VoteReadOnly. After receiving this response, the Transaction Service is not required to perform any additional operations on this resource. Furthermore, the resource can forget all knowledge of the transaction. If the resource is able to write (or has already written) all the data needed to commit the transaction to stable storage, as well as an indication that it has prepared the transaction, it can return VoteCommit. After receiving this response, the Transaction Service is required to eventually perform either the commit or the rollback operation on this object. To support recovery, the resource should store the RecoveryCoordinator object reference in stable storage. The resource can return VoteRollback under any circumstances, including not having any knowledge about the transaction (which might happen after a crash). If this response is returned, the transaction must be rolled back. Furthermore, the Transaction Service is not required to perform any additional operations on this resource. After returning this response, the resource can forget all knowledge of the transaction. The resource reports inconsistent outcomes using the HeuristicMixed and HeuristicHazard exceptions. Heuristic outcomes occur when a resource acts as a sub-coordinator and at least one of its resources takes a heuristic decision after a VoteCommit return.

Throws:
HeuristicMixed
HeuristicHazard

rollback

public void rollback()
              throws HeuristicCommit,
                     HeuristicMixed,
                     HeuristicHazard
Description copied from interface: ResourceOperations
If necessary, the resource should rollback all changes made as part of the transaction. If the resource has forgotten the transaction, it should do nothing. The heuristic outcome exceptions are used to report heuristic decisions related to the resource. If a heuristic outcome exception is raised, the resource must remember this outcome until the forget operation is performed so that it can return the same outcome in case rollback is performed again. Otherwise, the resource can immediately forget all knowledge of the transaction.

Throws:
HeuristicCommit
HeuristicMixed
HeuristicHazard

commit

public void commit()
            throws NotPrepared,
                   HeuristicRollback,
                   HeuristicMixed,
                   HeuristicHazard
Description copied from interface: ResourceOperations
If necessary, the resource should commit all changes made as part of the transaction. If the resource has forgotten the transaction, it should do nothing. The heuristic outcome exceptions are used to report heuristic decisions related to the resource. If a heuristic outcome exception is raised, the resource must remember this outcome until the forget operation is performed so that it can return the same outcome in case commit is performed again. Otherwise, the resource can immediately forget all knowledge of the transaction. The NotPrepared exception is raised if the commit operation is performed without first performing the prepare operation.

Throws:
NotPrepared
HeuristicRollback
HeuristicMixed
HeuristicHazard

commit_one_phase

public void commit_one_phase()
                      throws HeuristicHazard
Description copied from interface: ResourceOperations
If possible, the resource should commit all changes made as part of the transaction. If it cannot, it should raise the TRANSACTION_ROLLEDBACK standard exception. If a failure occurs during commit_one_phase, it must be retried when the failure is repaired. Since their can only be a single resource, the HeuristicHazard exception is used to report heuristic decisions related to that resource. If a heuristic exception is raised, the resource must remember this outcome until the forget operation is performed so that it can return the same outcome in case commit_one_phase is performed again. Otherwise, the resource can immediately forget all knowledge of the transaction.

Throws:
HeuristicHazard

forget

public void forget()
Description copied from interface: ResourceOperations
This operation is performed only if the resource raised a heuristic outcome exception to rollback, commit, or commit_one_phase. Once the coordinator has determined that the heuristic situation has been addressed, it should issue forget on the resource. The resource can forget all knowledge of the transaction.


commit_subtransaction

public void commit_subtransaction(Coordinator coord)
Description copied from interface: SubtransactionAwareResourceOperations
This operation is invoked only if the resource has been registered with a subtransaction and the subtransaction has been committed. The Resource object is provided with a Coordinator that represents the parent transaction. This operation may raise a standard exception such as TRANSACTION_ROLLEDBACK. Note that the results of a committed subtransaction are relative to the completion of its ancestor transactions, that is, these results can be undone if any ancestor transaction is rolled back.


rollback_subtransaction

public void rollback_subtransaction()
Description copied from interface: SubtransactionAwareResourceOperations
This operation is invoked only if the resource has been registered with a subtransaction and notifies the resource that the subtransaction has rolled back.


remove

public void remove()
This operation is used to remove this object from the POA