Top Description Fields Constructors Methods
net.sf.ehcache.transaction.manager.selector

public abstract Class Selector

extends Object
Class Inheritance
Known Direct Subclasses
net.sf.ehcache.transaction.manager.selector.ClassSelector, net.sf.ehcache.transaction.manager.selector.FactorySelector, net.sf.ehcache.transaction.manager.selector.JndiSelector, net.sf.ehcache.transaction.manager.selector.NullSelector
Imports
net.sf.ehcache.transaction.xa.EhcacheXAResource, javax.transaction.TransactionManager

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

Field Summary

Modifier and TypeField and Description
private volatile TransactionManager
private final String

Constructor Summary

AccessConstructor and Description
protected
Selector(String
an indicative transaction manager vendor name this selector is working with.
vendor
)

Constructor

Method Summary

Modifier and TypeMethod and Description
protected abstract TransactionManager

Returns:

the transaction manager, or null if it could not be looked up.
doLookup
()

Lookup the transaction manager.

public TransactionManager

Returns:

the transaction manager
getTransactionManager
()

Get the transaction manager, looking it up if necessary.

public String

Returns:

the vendor name
getVendor
()

Get the vendor name

public void
registerResource(EhcacheXAResource
the XAResource
ehcacheXAResource
,
boolean
true if this XAResource is being registered purely for recovery purpose
forRecovery
)

Register an XAResource with the transaction manager.

public void
unregisterResource(EhcacheXAResource
the XAResource
ehcacheXAResource
,
boolean
true if this XAResource was registered purely for recovery purpose
forRecovery
)

Unregister an XAResource from the transaction manager.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

transactionManagerback to summary
private volatile TransactionManager transactionManager
vendorback to summary
private final String vendor

Constructor Detail

Selectorback to summary
protected Selector(String vendor)

Constructor

Parameters
vendor:String

an indicative transaction manager vendor name this selector is working with.

Method Detail

doLookupback to summary
protected abstract TransactionManager doLookup()

Lookup the transaction manager.

Returns:TransactionManager

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

getTransactionManagerback to summary
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:TransactionManager

the transaction manager

getVendorback to summary
public String getVendor()

Get the vendor name

Returns:String

the vendor name

registerResourceback to summary
public void registerResource(EhcacheXAResource ehcacheXAResource, boolean forRecovery)

Register an XAResource with the transaction manager.

Parameters
ehcacheXAResource:EhcacheXAResource

the XAResource

forRecovery:boolean

true if this XAResource is being registered purely for recovery purpose

unregisterResourceback to summary
public void unregisterResource(EhcacheXAResource ehcacheXAResource, boolean forRecovery)

Unregister an XAResource from the transaction manager.

Parameters
ehcacheXAResource:EhcacheXAResource

the XAResource

forRecovery:boolean

true if this XAResource was registered purely for recovery purpose