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.
- 
- 
Constructor SummaryConstructors Constructor Description TwoPhaseCommitEventProcessor(BaseSharedObject bse, ISharedObjectTransactionConfig config)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddFailed(ID remote, Throwable failure)protected voidaddParticipants(ID[] ids)protected voiddoTMAbort(Throwable except)protected voiddoTMCommit()protected ISharedObjectContextgetContext()protected IDgetHomeID()protected intgetMinFailedToAbort()protected BaseSharedObjectgetSharedObject()protected intgetTimeout()bytegetTransactionState()Get state of transaction.protected voidhandleActivated(ISharedObjectActivatedEvent event)protected voidhandleCreateResponse(ISharedObjectCreateResponseEvent event)protected voidhandleDeparted(IContainerDisconnectedEvent event)protected voidhandleJoined(IContainerConnectedEvent event)protected voidhandlePostCommitFailure(ID fromID, Throwable e, long identifier1)protected voidhandlePrimaryActivated(ISharedObjectActivatedEvent event)protected voidhandleReplicaActivated(ISharedObjectActivatedEvent event)protected voidhandleVotingCompletedCreateResponse(ID fromID, Throwable e, long identifier1)protected booleanisPrimary()protected booleanisVotingCompleted()protected voidlocalCommitted()booleanprocessEvent(Event event)Process given Eventprotected voidremoveParticipant(ID id)protected voidreplicateTo(ID[] remotes)protected voidsendCommit()protected voidsetTransactionState(byte state)protected voidtrace(String msg)protected voidtraceStack(String msg, Throwable t)voidwaitToCommit()Method called to wait for a transaction to complete.
 
- 
- 
- 
Constructor Detail- 
TwoPhaseCommitEventProcessorpublic TwoPhaseCommitEventProcessor(BaseSharedObject bse, ISharedObjectTransactionConfig config) 
 
- 
 - 
Method Detail- 
traceprotected void trace(String msg) 
 - 
getTimeoutprotected int getTimeout() 
 - 
getMinFailedToAbortprotected int getMinFailedToAbort() 
 - 
isPrimaryprotected boolean isPrimary() 
 - 
getSharedObjectprotected BaseSharedObject getSharedObject() 
 - 
getHomeIDprotected ID getHomeID() 
 - 
addParticipantsprotected void addParticipants(ID[] ids) 
 - 
removeParticipantprotected void removeParticipant(ID id) 
 - 
getContextprotected ISharedObjectContext getContext() 
 - 
processEventpublic boolean processEvent(Event event) Description copied from interface:IEventProcessorProcess given Event- Specified by:
- processEventin interface- IEventProcessor
- 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)
 
 - 
handleActivatedprotected void handleActivated(ISharedObjectActivatedEvent event) 
 - 
replicateToprotected void replicateTo(ID[] remotes) 
 - 
handlePrimaryActivatedprotected void handlePrimaryActivated(ISharedObjectActivatedEvent event) 
 - 
handleReplicaActivatedprotected void handleReplicaActivated(ISharedObjectActivatedEvent event) 
 - 
handleJoinedprotected void handleJoined(IContainerConnectedEvent event) 
 - 
handleCreateResponseprotected void handleCreateResponse(ISharedObjectCreateResponseEvent event) 
 - 
handleDepartedprotected void handleDeparted(IContainerDisconnectedEvent event) 
 - 
handleVotingCompletedCreateResponseprotected void handleVotingCompletedCreateResponse(ID fromID, Throwable e, long identifier1) 
 - 
handlePostCommitFailureprotected void handlePostCommitFailure(ID fromID, Throwable e, long identifier1) 
 - 
sendCommitprotected void sendCommit() throws SharedObjectAddAbortException- Throws:
- SharedObjectAddAbortException
 
 - 
getTransactionStatepublic byte getTransactionState() Description copied from interface:ISharedObjectContainerTransactionGet state of transaction. Returns one of 'ACTIVE', 'VOTING', 'PREPARED', 'COMMITTED', or 'ABORTED'.- Specified by:
- getTransactionStatein interface- ISharedObjectContainerTransaction
- Returns:
- byte code. Returns one of 'ACTIVE', 'VOTING', 'PREPARED', 'COMMITTED', or 'ABORTED'.
 
 - 
setTransactionStateprotected void setTransactionState(byte state) 
 - 
waitToCommitpublic void waitToCommit() throws SharedObjectAddAbortExceptionDescription copied from interface:ISharedObjectContainerTransactionMethod called to wait for a transaction to complete.- Specified by:
- waitToCommitin interface- ISharedObjectContainerTransaction
- Throws:
- SharedObjectAddAbortException
 
 - 
doTMAbortprotected void doTMAbort(Throwable except) throws SharedObjectAddAbortException - Throws:
- SharedObjectAddAbortException
 
 - 
doTMCommitprotected void doTMCommit() throws SharedObjectAddAbortException- Throws:
- SharedObjectAddAbortException
 
 - 
localCommittedprotected void localCommitted() 
 - 
isVotingCompletedprotected boolean isVotingCompleted() throws SharedObjectAddAbortException- Throws:
- SharedObjectAddAbortException
 
 
- 
 
-