com.atomikos.icatch.imp
Class TransactionServiceImp

java.lang.Object
  extended by com.atomikos.icatch.imp.TransactionServiceImp
All Implemented Interfaces:
FSMEnterListener, TransactionServiceProvider, RecoveryService, SubTxAwareParticipant, TransactionService, AdminLog, EventListener

public class TransactionServiceImp
extends Object
implements TransactionServiceProvider, FSMEnterListener, SubTxAwareParticipant, RecoveryService, AdminLog

General implementation of Transaction Service.


Constructor Summary
TransactionServiceImp(String name, StateRecoveryManager recoverymanager, UniqueIdMgr tidmgr, long maxtimeout, int maxActives, boolean single_threaded_2pc, RecoveryLog recoveryLog)
          Create a new instance, with orphan checking set.
 
Method Summary
 void addTSListener(TransactionServicePlugin listener)
           
 void committed(CompositeTransaction tx)
          Called if a tx is ended successfully.
 CompositeTransaction createCompositeTransaction(long timeout)
           
 void entered(FSMEnterEvent event)
          Called when the FSM has entered a new state.
 void finalize()
           
 CompositeCoordinator getCompositeCoordinator(String root)
           
 CompositeTransaction getCompositeTransaction(String tid)
           
 CoordinatorLogEntry[] getCoordinatorLogEntries()
           
 LogControl getLogControl()
          Get a LogControl for the service.
 String getName()
           
 Participant getParticipant(String root)
           
 RecoveryLog getRecoveryLog()
           
 RecoveryService getRecoveryService()
           
 RecoveryCoordinator getSuperiorRecoveryCoordinator(String root)
           
 void init(Properties properties)
           
 CompositeTransaction recreateCompositeTransaction(Propagation context, boolean orphancheck, boolean heur_commit)
           
 void remove(String coordinatorId)
           
 void removeTSListener(TransactionServicePlugin listener)
           
 void rolledback(CompositeTransaction tx)
          Called if a tx is ended with failure.
 void shutdown(boolean force)
           
 void shutdown(long maxWaitTime)
           
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TransactionServiceImp

public TransactionServiceImp(String name,
                             StateRecoveryManager recoverymanager,
                             UniqueIdMgr tidmgr,
                             long maxtimeout,
                             int maxActives,
                             boolean single_threaded_2pc,
                             RecoveryLog recoveryLog)
Create a new instance, with orphan checking set.

Parameters:
name - The unique name of this TM.
recoverymanager - The recovery manager to use.
tidmgr - The String manager to use.
console - The console to use. Null if none.
maxtimeout - The max timeout for new or imported txs.
maxActives - The max number of active txs, or negative if unlimited.
single_threaded_2pc - Whether 2PC commit should happen in the same thread that started the tx.
Method Detail

getName

public String getName()
Specified by:
getName in interface RecoveryService

getLogControl

public LogControl getLogControl()
Get a LogControl for the service.

Specified by:
getLogControl in interface TransactionServiceProvider
Returns:
LogControl The instance.

getCompositeCoordinator

public CompositeCoordinator getCompositeCoordinator(String root)
                                             throws SysException
Specified by:
getCompositeCoordinator in interface TransactionService
Throws:
SysException
See Also:
TransactionService

addTSListener

public void addTSListener(TransactionServicePlugin listener)
                   throws IllegalStateException
Specified by:
addTSListener in interface TransactionService
Throws:
IllegalStateException
See Also:
TransactionService

removeTSListener

public void removeTSListener(TransactionServicePlugin listener)
Specified by:
removeTSListener in interface TransactionService
See Also:
TransactionService

init

public void init(Properties properties)
          throws SysException
Specified by:
init in interface TransactionServiceProvider
Throws:
SysException
See Also:
TransactionService

getParticipant

public Participant getParticipant(String root)
                           throws SysException
Specified by:
getParticipant in interface TransactionService
Throws:
SysException
See Also:
TransactionService

entered

public void entered(FSMEnterEvent event)
Description copied from interface: FSMEnterListener
Called when the FSM has entered a new state.

Specified by:
entered in interface FSMEnterListener
See Also:
FSMEnterListener.

committed

public void committed(CompositeTransaction tx)
Called if a tx is ended successfully. In order to remove the tx from the mapping.

Specified by:
committed in interface SubTxAwareParticipant
See Also:
SubTxAwareParticipant

rolledback

public void rolledback(CompositeTransaction tx)
Called if a tx is ended with failure. In order to remove tx from mapping.

Specified by:
rolledback in interface SubTxAwareParticipant
See Also:
SubTxAwareParticipant

getCompositeTransaction

public CompositeTransaction getCompositeTransaction(String tid)
Specified by:
getCompositeTransaction in interface TransactionService
See Also:
TransactionService

recreateCompositeTransaction

public CompositeTransaction recreateCompositeTransaction(Propagation context,
                                                         boolean orphancheck,
                                                         boolean heur_commit)
                                                  throws SysException
Specified by:
recreateCompositeTransaction in interface TransactionService
Throws:
SysException
See Also:
TransactionService

shutdown

public void shutdown(boolean force)
Specified by:
shutdown in interface TransactionService
See Also:
TransactionService

shutdown

public void shutdown(long maxWaitTime)
Specified by:
shutdown in interface TransactionServiceProvider

finalize

public void finalize()
              throws Throwable
Overrides:
finalize in class Object
Throws:
Throwable

getSuperiorRecoveryCoordinator

public RecoveryCoordinator getSuperiorRecoveryCoordinator(String root)
See Also:
com.atomikos.icatch.TransactionService#getSuperiorRecoveryCoordinator(java.lang.String)

createCompositeTransaction

public CompositeTransaction createCompositeTransaction(long timeout)
                                                throws SysException
Specified by:
createCompositeTransaction in interface TransactionService
Throws:
SysException

getRecoveryService

public RecoveryService getRecoveryService()
Specified by:
getRecoveryService in interface TransactionServiceProvider

getCoordinatorLogEntries

public CoordinatorLogEntry[] getCoordinatorLogEntries()
Specified by:
getCoordinatorLogEntries in interface AdminLog

remove

public void remove(String coordinatorId)
Specified by:
remove in interface AdminLog

getRecoveryLog

public RecoveryLog getRecoveryLog()
Specified by:
getRecoveryLog in interface RecoveryService


Copyright © 2016. All Rights Reserved.