Class JtaLookupService

java.lang.Object
com.jsgalactic.axiom.jta.JtaLookupService
All Implemented Interfaces:
JtaTransactionLookup

public final class JtaLookupService extends Object implements JtaTransactionLookup
The service-loaded implementation of JtaTransactionLookup.

It consults the Jta instances built in this class loader, each of which answers only for the request context it was given. Applications normally use Jta.context(Context) directly; integrations that must not depend on this module can load this service by name and call it with JDK types only. The service never begins, completes or mutates a transaction.

  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates the service instance used by ServiceLoader.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    active(Object context)
    Reports whether a transaction is currently associated with the request represented by context.
    boolean
    Reports whether the request's active transaction has been marked rollback-only.
    status(Object context)
    Returns the request's transaction status as a plain name: ACTIVE, MARKED_ROLLBACK, COMMITTED, ROLLED_BACK, INACTIVE or UNKNOWN.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • JtaLookupService

      public JtaLookupService()
      Creates the service instance used by ServiceLoader.
  • Method Details

    • active

      public boolean active(Object context)
      Description copied from interface: JtaTransactionLookup
      Reports whether a transaction is currently associated with the request represented by context.
      Specified by:
      active in interface JtaTransactionLookup
      Parameters:
      context - the request's Axiom context, or any object to answer false
      Returns:
      true while a transaction is active for that request
    • status

      public String status(Object context)
      Description copied from interface: JtaTransactionLookup
      Returns the request's transaction status as a plain name: ACTIVE, MARKED_ROLLBACK, COMMITTED, ROLLED_BACK, INACTIVE or UNKNOWN.
      Specified by:
      status in interface JtaTransactionLookup
      Parameters:
      context - the request's Axiom context
      Returns:
      one of the six status names
    • rollbackOnly

      public boolean rollbackOnly(Object context)
      Description copied from interface: JtaTransactionLookup
      Reports whether the request's active transaction has been marked rollback-only.
      Specified by:
      rollbackOnly in interface JtaTransactionLookup
      Parameters:
      context - the request's Axiom context
      Returns:
      true when rollback-only was set by the handler or the provider