Class Selector

  • Direct Known Subclasses:
    ClassSelector, FactorySelector, JndiSelector, NullSelector

    public abstract class Selector
    extends java.lang.Object
    Abstract class which is used to do various things related to JTA transaction managers, like looking them up, registering XAResources for recovery...
    Author:
    Ludovic Orban
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected Selector​(java.lang.String vendor)
      Constructor
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      protected abstract javax.transaction.TransactionManager doLookup()
      Lookup the transaction manager.
      javax.transaction.TransactionManager getTransactionManager()
      Get the transaction manager, looking it up if necessary.
      java.lang.String getVendor()
      Get the vendor name
      void registerResource​(EhcacheXAResource ehcacheXAResource, boolean forRecovery)
      Register an XAResource with the transaction manager.
      void unregisterResource​(EhcacheXAResource ehcacheXAResource, boolean forRecovery)
      Unregister an XAResource from the transaction manager.
      • Methods inherited from class java.lang.Object

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

      • Selector

        protected Selector​(java.lang.String vendor)
        Constructor
        Parameters:
        vendor - an indicative transaction manager vendor name this selector is working with.
    • Method Detail

      • getVendor

        public java.lang.String getVendor()
        Get the vendor name
        Returns:
        the vendor name
      • getTransactionManager

        public javax.transaction.TransactionManager getTransactionManager()
        Get the transaction manager, looking it up if necessary. Once the transaction manager has been looked up, its reference is cached.
        Returns:
        the transaction manager
      • registerResource

        public void registerResource​(EhcacheXAResource ehcacheXAResource,
                                     boolean forRecovery)
        Register an XAResource with the transaction manager.
        Parameters:
        ehcacheXAResource - the XAResource
        forRecovery - true if this XAResource is being registered purely for recovery purpose
      • unregisterResource

        public void unregisterResource​(EhcacheXAResource ehcacheXAResource,
                                       boolean forRecovery)
        Unregister an XAResource from the transaction manager.
        Parameters:
        ehcacheXAResource - the XAResource
        forRecovery - true if this XAResource was registered purely for recovery purpose
      • doLookup

        protected abstract javax.transaction.TransactionManager doLookup()
        Lookup the transaction manager.
        Returns:
        the transaction manager, or null if it could not be looked up.