Class Transactor<O extends Objectify>

java.lang.Object
com.googlecode.objectify.impl.Transactor<O>
Direct Known Subclasses:
TransactorNo, TransactorYes

public abstract class Transactor<O extends Objectify>
extends Object
Determines the transactional behavior of an ObjectifyImpl instance. There are transactional and non-transactional subclasses.
Author:
Jeff Schnitzer
  • Field Details

    • session

      protected Session session
      Our session
    • deferrer

      protected Deferrer deferrer
      Any deferred operations
  • Constructor Details

    • Transactor

      public Transactor(Objectify ofy)
      Construct a transactor with a fresh session
    • Transactor

      public Transactor(Objectify ofy, Session session)
      Construct a transactor with an explicit session
  • Method Details

    • getSession

      public Session getSession()
      Returns:
      the session associated with this transaction state
    • getDeferrer

      public Deferrer getDeferrer()
      Returns:
      the deferred operations in this context
    • getTransaction

      public abstract TransactionImpl getTransaction()
      Returns:
      the transaction appropriate to this transaction state, or null if there is no transaction.
    • transactionless

      public abstract ObjectifyImpl<O> transactionless(ObjectifyImpl<O> parent)
      Parameters:
      parent - is the parent objectify instance; the one being transitioned from
      Returns:
      an Objectify instance that is suitable for transactionless execution. In the case of a transactor which is not in a transaction, probably this is the same as getObjectify().
    • execute

      public abstract <R> R execute(ObjectifyImpl<O> parent, TxnType txnType, Work<R> work)
      See Also:
      Objectify.execute(TxnType, Work)
    • transact

      public abstract <R> R transact(ObjectifyImpl<O> parent, Work<R> work)
      See Also:
      Objectify.transact(Work)
    • transactNew

      public abstract <R> R transactNew(ObjectifyImpl<O> parent, int limitTries, Work<R> work)
      See Also:
      Objectify.transactNew(int, Work)