org.springframework.transaction.interceptor
Class AttributesTransactionAttributeSource

java.lang.Object
  extended by org.springframework.transaction.interceptor.AbstractFallbackTransactionAttributeSource
      extended by org.springframework.transaction.interceptor.AttributesTransactionAttributeSource
All Implemented Interfaces:
InitializingBean, TransactionAttributeSource

public class AttributesTransactionAttributeSource
extends AbstractFallbackTransactionAttributeSource
implements InitializingBean

Implementation of the TransactionAttributeSource interface that reads metadata via Spring's Attributes abstraction.

Typically used for reading in source-level attributes via Commons Attributes.

Author:
Rod Johnson, Juergen Hoeller
See Also:
Attributes, CommonsAttributes

Field Summary
 
Fields inherited from class org.springframework.transaction.interceptor.AbstractFallbackTransactionAttributeSource
attributeCache, logger
 
Constructor Summary
AttributesTransactionAttributeSource()
          Create a new AttributesTransactionAttributeSource.
AttributesTransactionAttributeSource(Attributes attributes)
          Create a new AttributesTransactionAttributeSource.
 
Method Summary
 void afterPropertiesSet()
          Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).
protected  Collection findAllAttributes(Class clazz)
          Subclasses should implement this to return all attributes for this class.
protected  Collection findAllAttributes(Method method)
          Subclasses should implement this to return all attributes for this method.
 void setAttributes(Attributes attributes)
          Set the Attributes implementation to use.
 
Methods inherited from class org.springframework.transaction.interceptor.AbstractFallbackTransactionAttributeSource
findTransactionAttribute, getCacheKey, getTransactionAttribute
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AttributesTransactionAttributeSource

public AttributesTransactionAttributeSource()
Create a new AttributesTransactionAttributeSource.

See Also:
setAttributes(org.springframework.metadata.Attributes)

AttributesTransactionAttributeSource

public AttributesTransactionAttributeSource(Attributes attributes)
Create a new AttributesTransactionAttributeSource.

Parameters:
attributes - the Attributes implementation to use
See Also:
CommonsAttributes
Method Detail

setAttributes

public void setAttributes(Attributes attributes)
Set the Attributes implementation to use.

See Also:
CommonsAttributes

afterPropertiesSet

public void afterPropertiesSet()
Description copied from interface: InitializingBean
Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).

This method allows the bean instance to perform initialization only possible when all bean properties have been set and to throw an exception in the event of misconfiguration.

Specified by:
afterPropertiesSet in interface InitializingBean

findAllAttributes

protected Collection findAllAttributes(Class clazz)
Description copied from class: AbstractFallbackTransactionAttributeSource
Subclasses should implement this to return all attributes for this class.

Specified by:
findAllAttributes in class AbstractFallbackTransactionAttributeSource
Parameters:
clazz - class to retrieve attributes for
Returns:
all attributes associated with this class (may be null)

findAllAttributes

protected Collection findAllAttributes(Method method)
Description copied from class: AbstractFallbackTransactionAttributeSource
Subclasses should implement this to return all attributes for this method. We need all because of the need to analyze rollback rules.

Specified by:
findAllAttributes in class AbstractFallbackTransactionAttributeSource
Parameters:
method - the method to retrieve attributes for
Returns:
all attributes associated with this method (may be null)


Copyright (c) 2002-2007 The Spring Framework Project.