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 voidprotected voidaddParticipants(ID[] ids) protected voidprotected voidprotected ISharedObjectContextprotected IDprotected intprotected BaseSharedObjectprotected intbyteGet state of transaction.protected voidprotected voidprotected voidprotected voidprotected voidhandlePostCommitFailure(ID fromID, Throwable e, long identifier1) protected voidprotected voidprotected voidhandleVotingCompletedCreateResponse(ID fromID, Throwable e, long identifier1) protected booleanprotected booleanprotected voidbooleanprocessEvent(Event event) Process given Eventprotected voidremoveParticipant(ID id) protected voidreplicateTo(ID[] remotes) protected voidprotected voidsetTransactionState(byte state) protected voidprotected voidtraceStack(String msg, Throwable t) voidMethod 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:IEventProcessorProcess given Event- Specified by:
processEventin 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:ISharedObjectContainerTransactionGet state of transaction. Returns one of 'ACTIVE', 'VOTING', 'PREPARED', 'COMMITTED', or 'ABORTED'.- Specified by:
getTransactionStatein interfaceISharedObjectContainerTransaction- Returns:
- byte code. Returns one of 'ACTIVE', 'VOTING', 'PREPARED', 'COMMITTED', or 'ABORTED'.
-
setTransactionState
protected void setTransactionState(byte state) -
waitToCommit
Description copied from interface:ISharedObjectContainerTransactionMethod called to wait for a transaction to complete.- Specified by:
waitToCommitin interfaceISharedObjectContainerTransaction- Throws:
SharedObjectAddAbortException
-
doTMAbort
- Throws:
SharedObjectAddAbortException
-
doTMCommit
- Throws:
SharedObjectAddAbortException
-
localCommitted
protected void localCommitted() -
isVotingCompleted
- Throws:
SharedObjectAddAbortException
-