ehcache

net.sf.ehcache.transaction
Class AbstractTransactionIDFactory

java.lang.Object
  extended by net.sf.ehcache.transaction.AbstractTransactionIDFactory
All Implemented Interfaces:
TransactionIDFactory
Direct Known Subclasses:
TransactionIDFactoryImpl

public abstract class AbstractTransactionIDFactory
extends Object
implements TransactionIDFactory

An abstract map backed transaction id factory.

Author:
Chris Dennis

Constructor Summary
AbstractTransactionIDFactory()
           
 
Method Summary
 void clear(TransactionID transactionID)
          Clear this transaction's state representation.
 Set<TransactionID> getAllTransactionIDs()
          Get the set of all known transactions.
 Set<XidTransactionID> getAllXidTransactionIDsFor(Ehcache cache)
          Get the set of all XID transactions of a cache.
protected abstract  ConcurrentMap<TransactionID,Decision> getTransactionStates()
          Return the map of transaction states.
 boolean isDecisionCommit(TransactionID transactionID)
          Check if the given transaction should be committed or not
 void markForCommit(TransactionID transactionID)
          Mark that this transaction's decision is commit
 void markForRollback(XidTransactionID transactionID)
          Mark this transaction ID for rollback
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface net.sf.ehcache.transaction.TransactionIDFactory
createTransactionID, createXidTransactionID, isExpired, isPersistent, restoreTransactionID, restoreXidTransactionID
 

Constructor Detail

AbstractTransactionIDFactory

public AbstractTransactionIDFactory()
Method Detail

getTransactionStates

protected abstract ConcurrentMap<TransactionID,Decision> getTransactionStates()
Return the map of transaction states.

Returns:
the map of transaction states

markForCommit

public void markForCommit(TransactionID transactionID)
Mark that this transaction's decision is commit

Specified by:
markForCommit in interface TransactionIDFactory
Parameters:
transactionID - transaction to be marked

markForRollback

public void markForRollback(XidTransactionID transactionID)
Mark this transaction ID for rollback

Specified by:
markForRollback in interface TransactionIDFactory

isDecisionCommit

public boolean isDecisionCommit(TransactionID transactionID)
Check if the given transaction should be committed or not

Specified by:
isDecisionCommit in interface TransactionIDFactory
Parameters:
transactionID - transaction to be queried
Returns:
true if the transaction should be committed

clear

public void clear(TransactionID transactionID)
Clear this transaction's state representation.

Specified by:
clear in interface TransactionIDFactory
Parameters:
transactionID - transaction to be cleared

getAllXidTransactionIDsFor

public Set<XidTransactionID> getAllXidTransactionIDsFor(Ehcache cache)
Get the set of all XID transactions of a cache.

Specified by:
getAllXidTransactionIDsFor in interface TransactionIDFactory
Returns:
the set of transactions

getAllTransactionIDs

public Set<TransactionID> getAllTransactionIDs()
Get the set of all known transactions.

Specified by:
getAllTransactionIDs in interface TransactionIDFactory
Returns:
the set of transactions

ehcache

Copyright 2001-2014, Terracotta, Inc.