ehcache

net.sf.ehcache.transaction
Class TransactionAwareAttributeExtractor

java.lang.Object
  extended by net.sf.ehcache.transaction.TransactionAwareAttributeExtractor
All Implemented Interfaces:
Serializable, AttributeExtractor

public class TransactionAwareAttributeExtractor
extends Object
implements AttributeExtractor

Used to extract a search attribute value from an element in a transactional store.

Author:
Chris Dennis
See Also:
Serialized Form

Constructor Summary
TransactionAwareAttributeExtractor(ReadWriteCopyStrategy<Element> copyStrategy, AttributeExtractor delegate)
          Creates an attributed delegating to the supplied extractor, via the given copy strategy.
 
Method Summary
 Object attributeFor(Element element, String attributeName)
          Extract the attribute value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TransactionAwareAttributeExtractor

public TransactionAwareAttributeExtractor(ReadWriteCopyStrategy<Element> copyStrategy,
                                          AttributeExtractor delegate)
Creates an attributed delegating to the supplied extractor, via the given copy strategy.

Parameters:
copyStrategy - copy strategy used by the transactional store
delegate - original configured attribute extractor
Method Detail

attributeFor

public Object attributeFor(Element element,
                           String attributeName)
                    throws AttributeExtractorException
Extract the attribute value. The instance returned from this method must be one of:

NOTE: null is a legal return here as well indicating that this attribute will not be available for the given element

Specified by:
attributeFor in interface AttributeExtractor
Parameters:
element - the cache element to inspect
attributeName - the name of the requested attribute
Returns:
the attribute value
Throws:
AttributeExtractorException - if the attribute cannot be found or extracted

ehcache

Copyright 2001-2014, Terracotta, Inc.