org.openorb.ots.Impl
Class Coordinator
public
class
Coordinator
extends CoordinatorPOA
This class is the coordinator interface implementation.
Author: Jerome Daniel
Method Summary |
void | commit_sub_transactions()
This operation is used by the terminator to commit all transactions. |
Control | create_subtransaction()
A new subtransaction is created whose parent is the transaction associated with the
target object. |
void | desynchronize()
This operation is used to desyncrhonize all registered synchronizations |
XID | getXID() |
Status | get_parent_status()
If the transaction associated with the target object is a top-level transaction, then this
operation is equivalent to the get_status operation. |
Status | get_status()
This operation returns the status of the transaction associated with the target object:
StatusActive - A transaction is associated with the target object and it is in the active
state. |
Status | get_top_level_status()
This operation returns the status of the top-level ancestor of the transaction associated
with the target object. |
String | get_transaction_name()
This operation returns a printable string describing the transaction associated with the
target object. |
PropagationContext | get_txcontext()
The get_txcontext operation returns a PropagationContext object, which is used by one
Transaction Service domain to export the current transaction to a new Transaction
Service domain. |
int | hash_top_level_tran()
This operation returns the hash code for the top-level ancestor of the transaction
associated with the target object. |
int | hash_transaction()
This operation returns a hash code for the transaction associated with the target object.
|
boolean | is_ancestor_transaction(Coordinator tc)
This operation returns true if, and only if, the transaction associated with the target
object is a descendant of the transaction associated with the parameter object. |
boolean | is_descendant_transaction(Coordinator tc)
This operation returns true if, and only if, the transaction associated with the target
object is related to the transaction associated with the parameter object. |
boolean | is_related_transaction(Coordinator tc)
This operation returns true if, and only if, the transaction associated with the target
object is an ancestor of the transaction associated with the parameter object. |
boolean | is_same_transaction(Coordinator tc)
This operation returns true if, and only if, the target object and the parameter object
both refer to the same transaction. |
boolean | is_top_level_transaction()
This operation returns true if, and only if, the transaction associated with the target
object is a top-level transaction. |
RecoveryCoordinator | register_resource(Resource r)
This operation registers the specified resource as a participant in the transaction
associated with the target object. |
void | register_subtran_aware(SubtransactionAwareResource r)
This operation registers the specified subtransaction aware resource such that it will be
notified when the subtransaction has committed or rolled back. |
void | register_synchronization(Synchronization sync)
This operation registers the specified Synchronization object such that it will be
notified to perform necessary processing prior to prepare being driven to resources
registered with this Coordinator. |
void | removeItself()
This operation is used to remove this object from the POA |
void | remove_subtran_listener(SubTransListener listener)
This operation is used to remove a sub transaction completion listener when the transaction
has been completed. |
Resource[] | resources()
This operation returns all registered resources. |
void | rollback_only()
The transaction associated with the target object is modified so that the only possible
outcome is to rollback the transaction. |
void | rollback_sub_transactions()
This operation is used by the terminator to rollback all transactions. |
void | setStatus(Status status)
This operation is used to set the transaction status |
void | setTerminator(Terminator terminator)
This operation is used to set the terminator reference for the trans identity |
SubtransactionAwareResource[] | subtran_resources()
This operation returns all registered resources. |
void | synchronize()
This operation is used to syncrhonize all registered synchronizations |
void | updatePropagationContext(Control ctrl)
This operation is used to update the progation context |
public Coordinator(
Manager manager,
XID xid, int time_out, POA poa, POA recovery_poa, Logger logger)
Constructor
public void commit_sub_transactions()
This operation is used by the terminator to commit all transactions.
public
Control create_subtransaction()
A new subtransaction is created whose parent is the transaction associated with the
target object. The Inactive exception is raised if the target transaction has already been
prepared. An implementation of the Transaction Service is not required to support
nested transactions. If nested transactions are not supported, the exception
SubtransactionsUnavailable is raised.
The create_subtransaction operation returns a Control object, which enables the
subtransaction to be terminated and allows recoverable objects to participate in the
subtransaction. An implementation of the Transaction Service may restrict the ability
for the Control object to be transmitted to or used in other execution environments.
public void desynchronize()
This operation is used to desyncrhonize all registered synchronizations
public
Status get_parent_status()
If the transaction associated with the target object is a top-level transaction, then this
operation is equivalent to the get_status operation. Otherwise, this operation returns the
status of the parent of the transaction associated with the target object.
This operation returns the status of the transaction associated with the target object:
StatusActive - A transaction is associated with the target object and it is in the active
state. An implementation returns this status after a transaction has been started and
prior to a coordinator issuing any prepares unless it has been marked for rollback.
StatusMarkedRollback - A transaction is associated with the target object and has been
marked for rollback, perhaps as the result of a rollback_only operation.
StatusPrepared - A transaction is associated with the target object and has been
prepared (i.e., all subordinates have responded VoteCommit). The target object may
be waiting for a superior?s instructions as to how to proceed.
StatusCommitted - A transaction is associated with the target object and it has
completed commitment. It is likely that heuristics exists; otherwise, the transaction
would have been destroyed and StatusNoTransaction returned.
StatusRolledBack - A transaction is associated with the target object and the outcome
has been determined as rollback. It is likely that heuristics exists, otherwise the
transaction would have been destroyed and StatusNoTransaction returned.
StatusUnknown - A transaction is associated with the target object, but the
Transaction Service cannot determine its current status. This is a transient
condition, and a subsequent invocation will ultimately return a different status.
StatusNoTransaction - No transaction is currently associated with the target object.
This will occur after a transaction has completed.
StatusPreparing - A transaction is associated with the target object and it is the
process of preparing. An implementation returns this status if it has started
preparing, but has not yet completed the process, probably because it is waiting for
responses to prepare from one or more resources.
StatusCommitting - A transaction is associated with the target object and is in the
process of committing. An implementation returns this status if it has decided to
commit, but has not yet completed the process, probably because it is waiting for
responses from one or more resources.
StatusRollingBack - A transaction is associated with the target object and it is in the
process of rolling back. An implementation returns this status if it has decided to
rollback, but has not yet completed the process, probably because it is waiting for
responses from one or more resources.
public
Status get_top_level_status()
This operation returns the status of the top-level ancestor of the transaction associated
with the target object. If the transaction is a top-level transaction, then this operation is
equivalent to the get_status operation.
public String get_transaction_name()
This operation returns a printable string describing the transaction associated with the
target object. The returned string is intended to support debugging.
The get_txcontext operation returns a PropagationContext object, which is used by one
Transaction Service domain to export the current transaction to a new Transaction
Service domain. An implementation of the Transaction Service may also use the
PropagationContext to assist in the implementation of the is_same_transaction operation
when the input Coordinator has been generated by a different Transaction Service
implementation.
The Unavailable exception is raised if the Transaction Service implementation chooses
to restrict the availability of the PropagationContext.
public int hash_top_level_tran()
This operation returns the hash code for the top-level ancestor of the transaction
associated with the target object. This operation is equivalent to the hash_transaction
operation when the transaction associated with the target object is a top-level
transaction.
public int hash_transaction()
This operation returns a hash code for the transaction associated with the target object.
Each transaction has a single hash code. Hash codes for transactions should be
uniformly distributed.
This operation returns true if, and only if, the transaction associated with the target
object is a descendant of the transaction associated with the parameter object.
public boolean is_descendant_transaction(
Coordinator tc)
This operation returns true if, and only if, the transaction associated with the target
object is related to the transaction associated with the parameter object.
This operation returns true if, and only if, the transaction associated with the target
object is an ancestor of the transaction associated with the parameter object.
This operation returns true if, and only if, the target object and the parameter object
both refer to the same transaction.
public boolean is_top_level_transaction()
This operation returns true if, and only if, the transaction associated with the target
object is a top-level transaction. A transaction is a top-level transaction if it has no
parent.
This operation registers the specified resource as a participant in the transaction
associated with the target object. When the transaction is terminated, the resource will
receive requests to commit or rollback the updates performed as part of the transaction.
These requests are described in the description of the Resource interface. The Inactive
exception is raised if the transaction has already been prepared. The standard exception
TRANSACTION_ROLLEDBACK may be raised if the transaction has been marked
rollback only.
If the resource is a subtransaction aware resource (it supports the
SubtransactionAwareResource interface) and the transaction associated with the target
object is a subtransaction, then this operation registers the specified resource with the
subtransaction and indirectly with the top-level transaction when the subtransaction?s
ancestors have completed. Otherwise, the resource is registered as a participant in the
current transaction. If the current transaction is a subtransaction, the resource will not
receive prepare or commit requests until the top-level ancestor terminates.
This operation returns a RecoveryCoordinator that can be used by this resource during
recovery.
This operation registers the specified subtransaction aware resource such that it will be
notified when the subtransaction has committed or rolled back. These requests are
described in the description of the SubtransactionAwareResource interface.
Note that this operation registers the specified resource only with the subtransaction.
This operation cannot be used to register the resource as a participant in the
transaction.
The NotSubtransaction exception is raised if the current transaction is not a
subtransaction. The Inactive exception is raised if the subtransaction (or any ancestor)
has already been terminated. The standard exception TRANSACTION_ROLLEDBACK
may be raised if the subtransaction (or any ancestor) has been marked rollback only.
This operation registers the specified Synchronization object such that it will be
notified to perform necessary processing prior to prepare being driven to resources
registered with this Coordinator. These requests are described in the description of the
Synchronization interface. The Inactive exception is raised if the transaction has already
been prepared. The SynchronizationUnavailable exception is raised if the Coordinator
does not support synchronization. The standard exception
TRANSACTION_ROLLEDBACK may be raised if the transaction has been marked
rollback only.
public void removeItself()
This operation is used to remove this object from the POA
This operation is used to remove a sub transaction completion listener when the transaction
has been completed.
This operation returns all registered resources.
public void rollback_only()
The transaction associated with the target object is modified so that the only possible
outcome is to rollback the transaction. The Inactive exception is raised if the transaction
has already been prepared.
public void rollback_sub_transactions()
This operation is used by the terminator to rollback all transactions.
public void setStatus(
Status status)
This operation is used to set the transaction status
This operation is used to set the terminator reference for the trans identity
This operation returns all registered resources.
public void synchronize()
This operation is used to syncrhonize all registered synchronizations
public void updatePropagationContext(
Control ctrl)
This operation is used to update the progation context