FileDocCategorySizeDatePackage
CoordinatorImpl.javaAPI DocGlassfish v2 API18446Wed Jun 13 23:03:46 BST 2007com.sun.jts.CosTransactions

CoordinatorImpl

public abstract class CoordinatorImpl extends JCoordinatorPOA implements JCoordinator
The CoordinatorImpl interface is an extension to the standard Coordinator interface that provides the common operations for top-level transactions and subtransactions. It is used as a common superclass for the TopCoordinator and SubCoordinator classes, and has no implementation.
version
0.01
author
Simon Holdsworth, IBM Corporation
see

Fields Summary
static final int
doNothing
Reply action value indicating nothing should be done to the transaction.
static final int
forgetMe
Reply action value indicating that the transaction should be forgotten.
static final int
activeChildren
Reply action value indicating that the transaction has active children.
static Logger
_logger
private static POA
poa
private Coordinator
thisRef
private static NO_IMPLEMENT
no_implement
Constructors Summary
Methods Summary
public org.omg.CORBA.Request_create_request(org.omg.CORBA.Context ctx, java.lang.String operation, org.omg.CORBA.NVList arg_list, org.omg.CORBA.NamedValue result)

        throw no_implement;
    
public org.omg.CORBA.Request_create_request(org.omg.CORBA.Context ctx, java.lang.String operation, org.omg.CORBA.NVList arg_list, org.omg.CORBA.NamedValue result, org.omg.CORBA.ExceptionList exceptions, org.omg.CORBA.ContextList contexts)

        throw no_implement;
    
public org.omg.CORBA.Object_duplicate()



       
        throw no_implement;
    
public org.omg.CORBA.DomainManager[]_get_domain_managers()

        throw no_implement;
    
public org.omg.CORBA.Object_get_interface_def()

        throw no_implement;
    
public org.omg.CORBA.Policy_get_policy(int policy_type)

        throw no_implement;
    
public int_hash(int maximum)

        throw no_implement;
    
public boolean_is_a(java.lang.String repository_id)

        throw no_implement;
    
public boolean_is_equivalent(org.omg.CORBA.Object that)

        throw no_implement;
    
public boolean_non_existent()

        throw no_implement;
    
public void_release()

        throw no_implement;
    
public org.omg.CORBA.Request_request(java.lang.String operation)

        throw no_implement;
    
public org.omg.CORBA.Object_set_policy_override(org.omg.CORBA.Policy[] policies, org.omg.CORBA.SetOverrideType set_add)

        throw no_implement;
    
abstract booleanaddChild(com.sun.jts.CosTransactions.CoordinatorImpl child)
Add the given Coordinator reference to the set of children of the target object.

abstract voidcleanUpEmpty(com.sun.jts.CosTransactions.CoordinatorImpl forgetParent)
Cleans up an empty Coordinator object which was created temporarily for a read-only transactional request.

abstract voidcommit()
Direct the CoordinatorImpl to commit. The CoordinatorImpl directs all registered Resources to commit. Those Resources that raised heuristic exceptions are subsequently told to forget the transaction. If there are no registered Synchronization objects, and the CoordinatorImpl is not the root, it removes itself from the TransactionManager associations and destroys itself before returning.

exception
HeuristicMixed Indicates that heuristic decisions have been taken which have resulted in part of the transaction being rolled back.
exception
HeuristicHazard Indicates that heuristic decisions may have been taken which have resulted in part of the transaction being rolled back.
exception
NotPrepared Indicates that the transaction has not been prepared.

abstract booleancommitOnePhase()
Direct the CoordinatorImpl to commit in one phase if possible. If the coordinator has a single resource registered it will flow the commit_one_phase mehtod to it, if it has >1 resource the method will return false indicating two phase commit is required. Other than that the method behaves as commit.

exception
HeuristicMixed Indicates that heuristic decisions have been taken which have resulted in part of the transaction being rolled back.
exception
HeuristicHazard Indicates that heuristic decisions may have been taken which have resulted in part of the transaction being rolled back.

public abstract Controlcreate_subtransaction()
OMG Coordinator operation required of all subclasses.

exception
Inactive The Coordinator is completing the transaction and cannot create a new child.
exception
SubtransactionsUnavailable Subtransactions are not available.

final synchronized voiddestroy()
Destroys the CoordinatorImpl object reference.

        if( poa != null && thisRef != null )
            try {
                poa.deactivate_object(poa.reference_to_id(thisRef));
                thisRef = null;
            } catch( Exception exc ) {
				_logger.log(Level.WARNING,"jts.object_destroy_error","Coordinator"); 
            }
    
public abstract voiddoFinalize()
Clean up the state of the object.

public abstract TransIdentity[]getAncestors()
IDL JCoordinator operation required of all subclasses.

public abstract otid_tgetGlobalTID()
IDL JCoordinator operation required of all subclasses.

exception
Unavailable The global transaction identifier is not available.

public abstract longgetLocalTID()
IDL JCoordinator operation required of all subclasses.

abstract CoordinatorgetParent()
Return the parent coordinator.

abstract CoordinatorgetSuperior()
Return the superior coordinator.

abstract CompletionHandlergetTerminator()
Returns the object normally responsible for terminating the transaction.

public abstract Statusget_parent_status()
OMG Coordinator operation required of all subclasses.

public abstract Statusget_status()
OMG Coordinator operation required of all subclasses.

public abstract Statusget_top_level_status()
OMG Coordinator operation required of all subclasses.

public abstract java.lang.Stringget_transaction_name()
OMG Coordinator operation required of all subclasses.

public abstract PropagationContextget_txcontext()
OMG Coordinator operation required of all subclasses.

exception
Inactive The Coordinator is completing the transaction.

abstract booleanhasRegistered()
Return a boolean value indicating whether the CoordinatorImpl has registered with its superior (if any).

public abstract inthash_top_level_tran()
OMG Coordinator operation required of all subclasses.

public abstract inthash_transaction()
OMG Coordinator operation required of all subclasses.

abstract booleanisActive()
Return a boolean value indicating whether the CoordinatorImpl is in an active state (i.e. not preparing or later states).

public abstract booleanisRollbackOnly()
IDL JCoordinator operation required of all subclasses.

public abstract booleanis_ancestor_transaction(Coordinator other)
OMG Coordinator operation required of all subclasses.

public abstract booleanis_descendant_transaction(Coordinator other)
OMG Coordinator operation required of all subclasses.

public abstract booleanis_related_transaction(Coordinator other)
OMG Coordinator operation required of all subclasses.

public abstract booleanis_same_transaction(Coordinator other)
OMG Coordinator operation required of all subclasses.

public abstract booleanis_top_level_transaction()
OMG Coordinator operation required of all subclasses.

final synchronized Coordinatorobject()
Returns a CORBA object which represents the transaction.


                
        
        if( thisRef == null ) {
            if( poa == null )
                poa = Configuration.getPOA("Coordinator"/*#Frozen*/);

            try {
                poa.activate_object(this);
                thisRef = CoordinatorHelper.narrow(poa.servant_to_reference(this));
            } catch( Exception exc ) {
                _logger.log(Level.SEVERE,"jts.create_coordinator_object_error",exc);
				String msg = LogFormatter.getLocalizedMessage(_logger,
						    			"jts.create_coordinator_object_error");
				throw  new org.omg.CORBA.INTERNAL(msg);
            }
        }

        return thisRef;
    
abstract Voteprepare()
Direct the CoordinatorImpl to prepare to commit. If there are active subtransactions, the operation raises the INVALID_TRANSACTION standard exception. Otherwise the CoordinatorImpl directs all registered Resources to prepare, and returns the consolidated result to the caller. The CoordinatorImpl must guarantee that each Resource object registered with it receives at most one prepare request (This includes the case where the Recoverable Server registers the same Resource twice).

exception
INVALID_TRANSACTION Indicates that the transaction may not be committed due to outstanding work.
exception
HeuristicMixed Indicates that a participant voted to roll the transaction back, but one or more others have already heuristically committed.
exception
HeuristicHazard Indicates that a participant voted to roll the transaction back, but one or more others may have already heuristically committed.

public abstract RecoveryCoordinatorregister_resource(Resource res)
OMG Coordinator operation required of all subclasses.

exception
Inactive The Coordinator is completing the transaction and cannot accept this registration.

public abstract voidregister_subtran_aware(SubtransactionAwareResource sares)
OMG Coordinator operation required of all subclasses.

exception
NotSubtransaction The Coordinator represents a top-level transaction and cannot accept the registration.
exception
Inactive The Coordinator is completing the transaction and cannot accept this registration.

public abstract voidregister_synchronization(Synchronization sync)
OMG Coordinator operation required of all subclasses.

exception
Inactive The Coordinator is completing the transaction and cannot accept the registration.
exception
SynchronizationUnavailable Synchronization is not supported.

abstract booleanremoveChild(com.sun.jts.CosTransactions.CoordinatorImpl child)
Remove the given Coordinator reference from the set of children. If the target object is temporary, and no longer has any children or registered resources, it destroys itself before returning.

abstract com.sun.jts.CosTransactions.CoordinatorImplreplyAction(int[] action)
Inform the CoordinatorImpl of an imminent reply. If the CoordinatorImpl has active children, it returns activeChildren. If the CoordinatorImpl has already been registered, the operation returns doNothing. Otherwise the CoordinatorImpl returns forgetMe, and the output parameter is set to the parent CoordinatorImpl, if any.

abstract voidrollback(boolean force)
Direct the CoordinatorImpl to rollback the transaction. It directs every registered Resource to rollback. Those Resources that raised heuristic exceptions are subsequently told to forget the transaction. If there are no registered Synchronization objects, the CoordinatorImpl removes itself from the TransactionManager associations and destroys itself before returning. If force is TRUE, the coordinator is rolled back even if this could compromise data integrity (i.e. even if the coordinator is prepared). If force is FALSE, no attempt is made to roll back the coordinator if it is prepared and FALSE is returned from the method.

exception
HeuristicMixed Indicates that heuristic decisions have been taken which have resulted in part of the transaction being rolled back.
exception
HeuristicHazard Indicates that heuristic decisions may have been taken which have resulted in part of the transaction being rolled back.

public abstract voidrollback_only()
OMG Coordinator operation required of all subclasses.

exception
Inactive The Coordinator is already completing the transaction.

static final synchronized com.sun.jts.CosTransactions.CoordinatorImplservant(Coordinator coord)
Returns the CoordinatorImpl which serves the given object.

        CoordinatorImpl result = null;

        if( coord instanceof CoordinatorImpl )
            result = (CoordinatorImpl)coord;
        else if( poa != null ) {
            JCoordinator jcoord = JCoordinatorHelper.narrow(coord);
            if( jcoord != null )
                try {
                    result = (CoordinatorImpl)poa.reference_to_servant(jcoord);
                    if( result.thisRef == null )
                        result.thisRef = jcoord;
                } catch( Exception exc ) {
					_logger.log(Level.WARNING,"jts.cannot_locate_servant","Coordinator");
                }
        }

        return result;
    
abstract java.lang.LongsetPermanent()
Inform the CoordinatorImpl that it is no longer a temporary construct. This is used when a request is received for an CoordinatorImpl that was created as a temporary ancestor of a subtransaction.

abstract voidsetTerminator(CompletionHandler terminator)
Record the object that is normally responsible for directing the CoordinatorImpl through termination. For a root CoordinatorImpl, this is a CoordinatorTerm object; for a subordinate it is a CoordinatorResource.