bitronix.tm.twopc
Class Committer

java.lang.Object
  extended by bitronix.tm.twopc.AbstractPhaseEngine
      extended by bitronix.tm.twopc.Committer

public final class Committer
extends AbstractPhaseEngine

Phase 2 Commit logic engine.

Author:
lorban

Constructor Summary
Committer(Executor executor)
           
 
Method Summary
 void commit(BitronixTransaction transaction, List<XAResourceHolderState> interestedResources)
          Execute phase 2 commit.
protected  Job createJob(XAResourceHolderState resourceHolder)
          Create a Job that is going to execute the phase command on the given resource.
protected  boolean isParticipating(XAResourceHolderState xaResourceHolderState)
          Determine if a resource is participating in the phase or not.
 
Methods inherited from class bitronix.tm.twopc.AbstractPhaseEngine
collectNotInterestedResources, collectResourcesUniqueNames, executePhase, logFailedResources
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Committer

public Committer(Executor executor)
Method Detail

commit

public void commit(BitronixTransaction transaction,
                   List<XAResourceHolderState> interestedResources)
            throws HeuristicMixedException,
                   HeuristicRollbackException,
                   BitronixSystemException,
                   BitronixRollbackException
Execute phase 2 commit.

Parameters:
transaction - the transaction wanting to commit phase 2
interestedResources - a map of phase 1 prepared resources wanting to participate in phase 2 using Xids as keys
Throws:
HeuristicRollbackException - when all resources committed instead.
HeuristicMixedException - when some resources committed and some rolled back.
BitronixSystemException - when an internal error occured.
BitronixRollbackException - during 1PC when resource fails to commit

createJob

protected Job createJob(XAResourceHolderState resourceHolder)
Description copied from class: AbstractPhaseEngine
Create a Job that is going to execute the phase command on the given resource.

Specified by:
createJob in class AbstractPhaseEngine
Parameters:
resourceHolder - the resource that is going to receive a command.
Returns:
the Job that is going to execute the command.

isParticipating

protected boolean isParticipating(XAResourceHolderState xaResourceHolderState)
Description copied from class: AbstractPhaseEngine
Determine if a resource is participating in the phase or not. A participating resource gets a job created to execute the phase's command on it.

Specified by:
isParticipating in class AbstractPhaseEngine
Parameters:
xaResourceHolderState - the resource to check for its participation.
Returns:
true if the resource must participate in the phase.


Copyright © 2006-2013 Bitronix Software. All Rights Reserved.