Interface ExtendedTransactionManager

All Superinterfaces:
TransactionManager

public interface ExtendedTransactionManager extends TransactionManager
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    begin(int timeout)
    Adds a begin method allowing a timeout to be specified.
    boolean
    delist(XAResource xaRes, int flag)
    Delist the resource specified from the current JTA Transaction associated with the calling thread.
    boolean
    enlist(XAResource xaRes, int recoveryId)
    enlist XAResouce object in the current JTA Transaction associated with current thread.
    int
    registerResourceInfo(String xaResFactoryClassName, Serializable xaResInfo)
    Register XAResouceFactory and XAResourceInfo with the transaction service so that it will be logged and can be used in recovery on a server restart.
    int
    registerResourceInfo(String xaResFactoryClassName, Serializable xaResInfo, int priority)
    Register XAResouceFactory and XAResourceInfo with the transaction service so that it will be logged and can be used in recovery on a server restart.
  • Method Details

    • begin

      void begin(int timeout) throws NotSupportedException, SystemException
      Adds a begin method allowing a timeout to be specified.
      Parameters:
      timeout -
      Throws:
      NotSupportedException
      SystemException
    • enlist

      boolean enlist(XAResource xaRes, int recoveryId) throws RollbackException, IllegalStateException, SystemException
      enlist XAResouce object in the current JTA Transaction associated with current thread. This interface is supposed to be used with JTA XAResource providers who want to participate in distributed transactions managed by JTA TM or JTS. This is a modified form of enlist call that may be used after a previous registerResourceInfo call.
      Parameters:
      xaRes - The XAResource object representing the resource to enlist.
      recoveryId - The identifier returned from a call to registerResourceInfo associating the appropriate xaResFactoryClassName/xaResInfo necessary for produce a XAResource object.
      Returns:
      true if the resource was enlisted successfully; otherwise false.
      Throws:
      RollbackException
      IllegalStateException
      SystemException
    • delist

      boolean delist(XAResource xaRes, int flag)
      Delist the resource specified from the current JTA Transaction associated with the calling thread. XAResources delisted using this method will receive prepare, commit callbacks etc.
      Parameters:
      xaRes - The XAResource object representing the resource to delist
      flag - One of the values of TMSUCCESS, TMSUSPEND, or TMFAIL.
      Returns:
      true if the resource was delisted successfully; otherwise false.
    • registerResourceInfo

      int registerResourceInfo(String xaResFactoryClassName, Serializable xaResInfo)
      Register XAResouceFactory and XAResourceInfo with the transaction service so that it will be logged and can be used in recovery on a server restart. The token returned is an identifier which should be passed on future enlist calls to associate an enlist with the registered resource information.
      Parameters:
      xaResFactoryClassName - The class name of XAResourceFactory.
      xaResInfo - Information necessary for producing an XAResource object using XAResourceFactory.
      Returns:
      a resource recoveryId value associate with the factory/info which can be used on resource enlistment otherwise -1 if an error occurs.
    • registerResourceInfo

      int registerResourceInfo(String xaResFactoryClassName, Serializable xaResInfo, int priority)
      Register XAResouceFactory and XAResourceInfo with the transaction service so that it will be logged and can be used in recovery on a server restart. A priority can be defined which will define the order resources are prepared and committed relative to other resources enlisted in a transaction. The token returned is an identifier which should be passed on future enlist calls to associate an enlist with the registered resource information.
      Parameters:
      xaResFactoryClassName - The class name of XAResourceFactory.
      xaResInfo - Information necessary for producing an XAResource object using XAResourceFactory.
      priority - The priority associated with resources for this factory and xa resource information. Priorities may be assigned values in the range Integer.MAX_VALUE through Integer.MIN_VALUE with 0 as the default priority if unassigned. Priority values will determine the order of prepare and commit during the completion phase; the higher the priority, the earlier the resource will be prepared or committed. Resources with the same priority value may be prepared or committed in any order. Priority ordering will be maintained over failures or retries - higher priority resources must complete before lower priority resources are committed.
      Returns:
      a resource recoveryId value associate with the factory/info which can be used on resource enlistment otherwise -1 if an error occurs.