Class TwoPhaseCommitEventProcessor
java.lang.Object
org.eclipse.ecf.core.sharedobject.TwoPhaseCommitEventProcessor
- All Implemented Interfaces:
ISharedObjectContainerTransaction
,IEventProcessor
public class TwoPhaseCommitEventProcessor
extends Object
implements IEventProcessor, ISharedObjectContainerTransaction
Implementation of two-phase commit for transactional replication of shared
objects.
-
Field Summary
-
Constructor Summary
ConstructorsConstructorDescription -
Method Summary
Modifier and TypeMethodDescriptionprotected void
protected void
addParticipants
(ID[] ids) protected void
protected void
protected ISharedObjectContext
protected ID
protected int
protected BaseSharedObject
protected int
byte
Get state of transaction.protected void
protected void
protected void
protected void
protected void
handlePostCommitFailure
(ID fromID, Throwable e, long identifier1) protected void
protected void
protected void
handleVotingCompletedCreateResponse
(ID fromID, Throwable e, long identifier1) protected boolean
protected boolean
protected void
boolean
processEvent
(Event event) Process given Eventprotected void
removeParticipant
(ID id) protected void
replicateTo
(ID[] remotes) protected void
protected void
setTransactionState
(byte state) protected void
protected void
traceStack
(String msg, Throwable t) void
Method called to wait for a transaction to complete.
-
Constructor Details
-
Method Details
-
trace
-
traceStack
-
getTimeout
protected int getTimeout() -
getMinFailedToAbort
protected int getMinFailedToAbort() -
isPrimary
protected boolean isPrimary() -
getHomeID
-
addParticipants
-
removeParticipant
-
addFailed
-
getContext
-
processEvent
Description copied from interface:IEventProcessor
Process given Event- Specified by:
processEvent
in interfaceIEventProcessor
- Parameters:
event
- the Event to process- Returns:
- true if the event has been successfully processed and no further processing should occur. False if the event should receive further processing by another event processor (e.g. in a chain)
-
replicateTo
-
handleJoined
-
handleDeparted
-
handleVotingCompletedCreateResponse
-
handlePostCommitFailure
-
sendCommit
- Throws:
SharedObjectAddAbortException
-
getTransactionState
public byte getTransactionState()Description copied from interface:ISharedObjectContainerTransaction
Get state of transaction. Returns one of 'ACTIVE', 'VOTING', 'PREPARED', 'COMMITTED', or 'ABORTED'.- Specified by:
getTransactionState
in interfaceISharedObjectContainerTransaction
- Returns:
- byte code. Returns one of 'ACTIVE', 'VOTING', 'PREPARED', 'COMMITTED', or 'ABORTED'.
-
setTransactionState
protected void setTransactionState(byte state) -
waitToCommit
Description copied from interface:ISharedObjectContainerTransaction
Method called to wait for a transaction to complete.- Specified by:
waitToCommit
in interfaceISharedObjectContainerTransaction
- Throws:
SharedObjectAddAbortException
-
doTMAbort
- Throws:
SharedObjectAddAbortException
-
doTMCommit
- Throws:
SharedObjectAddAbortException
-
localCommitted
protected void localCommitted() -
isVotingCompleted
- Throws:
SharedObjectAddAbortException
-