org.infinispan.config
Class Configuration.TransactionType

java.lang.Object
  extended by org.infinispan.config.AbstractConfigurationBean
      extended by org.infinispan.config.AbstractNamedCacheConfigurationBean
          extended by org.infinispan.config.Configuration.TransactionType
All Implemented Interfaces:
Serializable, Cloneable, CloneableConfigurationComponent, Configuration.TransactionConfig, JAXBUnmarshallable
Enclosing class:
Configuration

public static class Configuration.TransactionType
extends AbstractNamedCacheConfigurationBean
implements Configuration.TransactionConfig

Defines transactional (JTA) characteristics of the cache.

See Also:
Configuration reference, Serialized Form

Field Summary
protected  Integer cacheStopTimeout
           
protected  Boolean eagerLockSingleNode
           
protected  Boolean syncCommitPhase
           
protected  Boolean syncRollbackPhase
           
protected  TransactionManagerLookup transactionManagerLookup
           
protected  String transactionManagerLookupClass
           
protected  Boolean useEagerLocking
           
 
Fields inherited from class org.infinispan.config.AbstractNamedCacheConfigurationBean
cr
 
Fields inherited from class org.infinispan.config.AbstractConfigurationBean
EMPTY_PROPERTIES, log, overriddenConfigurationElements
 
Constructor Summary
Configuration.TransactionType()
           
Configuration.TransactionType(String transactionManagerLookupClass)
           
 
Method Summary
 void accept(ConfigurationBeanVisitor v)
           
 Configuration.TransactionConfig cacheStopTimeout(Integer cacheStopTimeout)
          If there are any ongoing transactions when a cache is stopped, Infinispan waits for ongoing remote and local transactions to finish.
 Configuration.TransactionConfig eagerLockSingleNode(Boolean eagerLockSingleNode)
          Only has effect for DIST mode and when useEagerLocking is set to true.
 boolean equals(Object o)
           
 int hashCode()
           
 void setCacheStopTimeout(Integer cacheStopTimeout)
           
 Configuration.TransactionConfig setEagerLockSingleNode(Boolean eagerLockSingleNode)
           
 void setSyncCommitPhase(Boolean syncCommitPhase)
           
 void setSyncRollbackPhase(Boolean syncRollbackPhase)
           
 void setTransactionManagerLookupClass(String transactionManagerLookupClass)
           
 void setUseEagerLocking(Boolean useEagerLocking)
           
 Configuration.TransactionConfig syncCommitPhase(Boolean syncCommitPhase)
          If true, the cluster-wide commit phase in two-phase commit (2PC) transactions will be synchronous, so Infinispan will wait for responses from all nodes to which the commit was sent.
 Configuration.TransactionConfig syncRollbackPhase(Boolean syncRollbackPhase)
          If true, the cluster-wide rollback phase in two-phase commit (2PC) transactions will be synchronous, so Infinispan will wait for responses from all nodes to which the rollback was sent.
 Configuration.TransactionConfig transactionManagerLookupClass(Class<? extends TransactionManagerLookup> transactionManagerLookupClass)
          Fully qualified class name of a class that looks up a reference to a TransactionManager.
 Configuration.TransactionConfig useEagerLocking(Boolean useEagerLocking)
          Only has effect for DIST mode and when useEagerLocking is set to true.
 Configuration.TransactionConfig usingTransactionManagerLookup(TransactionManagerLookup transactionManagerLookup)
          Configure Transaction manager lookup directly using an instance of TransactionManagerLookup
 void willUnmarshall(Object parent)
          Indicates that this element is about to be unmarshalled from the XML source that was processed.
 
Methods inherited from class org.infinispan.config.AbstractNamedCacheConfigurationBean
clone, hasComponentStarted, inject
 
Methods inherited from class org.infinispan.config.AbstractConfigurationBean
testImmutability, toTypedProperties, toTypedProperties, uc
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

transactionManagerLookupClass

protected String transactionManagerLookupClass

transactionManagerLookup

protected TransactionManagerLookup transactionManagerLookup

syncCommitPhase

@Dynamic
protected Boolean syncCommitPhase

syncRollbackPhase

@Dynamic
protected Boolean syncRollbackPhase

useEagerLocking

@Dynamic
protected Boolean useEagerLocking

eagerLockSingleNode

@Dynamic
protected Boolean eagerLockSingleNode

cacheStopTimeout

@Dynamic
protected Integer cacheStopTimeout
Constructor Detail

Configuration.TransactionType

public Configuration.TransactionType(String transactionManagerLookupClass)

Configuration.TransactionType

public Configuration.TransactionType()
Method Detail

accept

public void accept(ConfigurationBeanVisitor v)

setTransactionManagerLookupClass

public void setTransactionManagerLookupClass(String transactionManagerLookupClass)

transactionManagerLookupClass

public Configuration.TransactionConfig transactionManagerLookupClass(Class<? extends TransactionManagerLookup> transactionManagerLookupClass)
Description copied from interface: Configuration.TransactionConfig
Fully qualified class name of a class that looks up a reference to a TransactionManager. The default provided is capable of locating the default TransactionManager in most popular Java EE systems, using a JNDI lookup.

Specified by:
transactionManagerLookupClass in interface Configuration.TransactionConfig

setSyncCommitPhase

public void setSyncCommitPhase(Boolean syncCommitPhase)

syncCommitPhase

public Configuration.TransactionConfig syncCommitPhase(Boolean syncCommitPhase)
Description copied from interface: Configuration.TransactionConfig
If true, the cluster-wide commit phase in two-phase commit (2PC) transactions will be synchronous, so Infinispan will wait for responses from all nodes to which the commit was sent. Otherwise, the commit phase will be asynchronous. Keeping it as false improves performance of 2PC transactions, since any remote failures are trapped during the prepare phase anyway and appropriate rollbacks are issued.

Specified by:
syncCommitPhase in interface Configuration.TransactionConfig

setSyncRollbackPhase

public void setSyncRollbackPhase(Boolean syncRollbackPhase)

syncRollbackPhase

public Configuration.TransactionConfig syncRollbackPhase(Boolean syncRollbackPhase)
Description copied from interface: Configuration.TransactionConfig
If true, the cluster-wide rollback phase in two-phase commit (2PC) transactions will be synchronous, so Infinispan will wait for responses from all nodes to which the rollback was sent. Otherwise, the rollback phase will be asynchronous. Keeping it as false improves performance of 2PC transactions.

Specified by:
syncRollbackPhase in interface Configuration.TransactionConfig

setUseEagerLocking

public void setUseEagerLocking(Boolean useEagerLocking)

useEagerLocking

public Configuration.TransactionConfig useEagerLocking(Boolean useEagerLocking)
Description copied from interface: Configuration.TransactionConfig
Only has effect for DIST mode and when useEagerLocking is set to true. When this is enabled, then only one node is locked in the cluster, disregarding numOwners config. On the opposite, if this is false, then on all cache.lock() calls numOwners RPCs are being performed. The node that gets locked is the main data owner, i.e. the node where data would reside if numOwners==1. If the node where the lock resides crashes, then the transaction is marked for rollback - data is in a consistent state, no fault tolerance.

Specified by:
useEagerLocking in interface Configuration.TransactionConfig

usingTransactionManagerLookup

public Configuration.TransactionConfig usingTransactionManagerLookup(TransactionManagerLookup transactionManagerLookup)
Description copied from interface: Configuration.TransactionConfig
Configure Transaction manager lookup directly using an instance of TransactionManagerLookup

Specified by:
usingTransactionManagerLookup in interface Configuration.TransactionConfig
Parameters:
transactionManagerLookup - instance to use as lookup
Returns:
this TransactionConfig

setEagerLockSingleNode

public Configuration.TransactionConfig setEagerLockSingleNode(Boolean eagerLockSingleNode)

eagerLockSingleNode

public Configuration.TransactionConfig eagerLockSingleNode(Boolean eagerLockSingleNode)
Description copied from interface: Configuration.TransactionConfig
Only has effect for DIST mode and when useEagerLocking is set to true. When this is enabled, then only one node is locked in the cluster, disregarding numOwners config. On the opposite, if this is false, then on all cache.lock() calls numOwners RPCs are being performed. The node that gets locked is the main data owner, i.e. the node where data would reside if numOwners==1. If the node where the lock resides crashes, then the transaction is marked for rollback - data is in a consistent state, no fault tolerance.

Specified by:
eagerLockSingleNode in interface Configuration.TransactionConfig

setCacheStopTimeout

public void setCacheStopTimeout(Integer cacheStopTimeout)

cacheStopTimeout

public Configuration.TransactionConfig cacheStopTimeout(Integer cacheStopTimeout)
Description copied from interface: Configuration.TransactionConfig
If there are any ongoing transactions when a cache is stopped, Infinispan waits for ongoing remote and local transactions to finish. The amount of time to wait for is defined by the cache stop timeout. It is recommended that this value does not exceed the transaction timeout because even if a new transaction was started just before the cache was stopped, this could only last as long as the transaction timeout allows it.

Specified by:
cacheStopTimeout in interface Configuration.TransactionConfig

equals

public boolean equals(Object o)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

willUnmarshall

public void willUnmarshall(Object parent)
Description copied from interface: JAXBUnmarshallable
Indicates that this element is about to be unmarshalled from the XML source that was processed.

Specified by:
willUnmarshall in interface JAXBUnmarshallable
Overrides:
willUnmarshall in class AbstractConfigurationBean
Parameters:
parent - parent component


Copyright © 2011 JBoss, a division of Red Hat. All Rights Reserved.