Class SingleCachingProductRetrieveStrategyImpl

  extended by com.elasticpath.service.impl.AbstractEpServiceImpl
      extended by com.elasticpath.service.catalogview.impl.AbstractProductRetrieveStrategyImpl
          extended by com.elasticpath.service.catalogview.impl.SingleCachingProductRetrieveStrategyImpl
All Implemented Interfaces:
ProductRetrieveStrategy, EpService
Direct Known Subclasses:

public class SingleCachingProductRetrieveStrategyImpl
extends AbstractProductRetrieveStrategyImpl
implements ProductRetrieveStrategy

Provides an implementation of ProductRetrieveStrategy with JBoss tree caching ability. This service will return the same instance of a product for all customers. Catalog promotion rules have already been applied on the returned products.

Notice: since the Product is not thread-safe, you must not make any changes on the return product in your code. Otherwise, the application may have some unexpected problem.

Nested Class Summary
 class SingleCachingProductRetrieveStrategyImpl.CacheKey
          Represents a key object used in the cache.
Constructor Summary
Method Summary
 Product retrieveProduct(long productUid, ShoppingCart shoppingCart, ProductLoadTuner productLoadTuner)
          Retrieve a Product with the given product uid.
 java.util.List retrieveProducts(java.util.Collection productUids, ShoppingCart shoppingCart, ProductLoadTuner productLoadTuner)
          Retrieve a list of Product of the given product uids.
 void start()
          Prepare the underlying JBossCache TreeCache instance.
 void stop()
          Stop the jboss cache.
Methods inherited from class com.elasticpath.service.catalogview.impl.AbstractProductRetrieveStrategyImpl
getProductService, setEpRuleEngine, setProductService
Methods inherited from class com.elasticpath.service.impl.AbstractEpServiceImpl
getElasticPath, setElasticPath
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.elasticpath.service.EpService
getElasticPath, setElasticPath

Constructor Detail


public SingleCachingProductRetrieveStrategyImpl()
Method Detail


public Product retrieveProduct(long productUid,
                               ShoppingCart shoppingCart,
                               ProductLoadTuner productLoadTuner)
Retrieve a Product with the given product uid. Return null if a product with the given uid doesn't exist or the product is not displayable.

Specified by:
retrieveProduct in interface ProductRetrieveStrategy
productUid - a product uid
shoppingCart - the customer shopping cart
productLoadTuner - the product load tuner
a Product with the given product uid.


public java.util.List retrieveProducts(java.util.Collection productUids,
                                       ShoppingCart shoppingCart,
                                       ProductLoadTuner productLoadTuner)
Retrieve a list of Product of the given product uids. Only those products which are displayable are returned.

Specified by:
retrieveProducts in interface ProductRetrieveStrategy
productUids - a collection of product uids
shoppingCart - the customer shopping cart
productLoadTuner - the product load tuner
a list of Product.


public void start()
Prepare the underlying JBossCache TreeCache instance.

org.hibernate.cache.CacheException - Indicates a problem preparing cache for use.


public void stop()
Stop the jboss cache.