ehcache

net.sf.ehcache.transaction.manager.selector
Class Selector

java.lang.Object
  extended by net.sf.ehcache.transaction.manager.selector.Selector
Direct Known Subclasses:
ClassSelector, FactorySelector, JndiSelector, NullSelector

public abstract class Selector
extends 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
protected Selector(String vendor)
          Constructor
 
Method Summary
protected abstract  TransactionManager doLookup()
          Lookup the transaction manager.
 TransactionManager getTransactionManager()
          Get the transaction manager, looking it up if necessary.
 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(String vendor)
Constructor

Parameters:
vendor - an indicative transaction manager vendor name this selector is working with.
Method Detail

getVendor

public String getVendor()
Get the vendor name

Returns:
the vendor name

getTransactionManager

public 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 TransactionManager doLookup()
Lookup the transaction manager.

Returns:
the transaction manager, or null if it could not be looked up.

ehcache

Copyright 2001-2014, Terracotta, Inc.