|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.elasticpath.service.impl.AbstractEpServiceImpl com.elasticpath.service.catalogview.impl.AbstractProductRetrieveStrategyImpl com.elasticpath.service.catalogview.impl.SingleCachingProductRetrieveStrategyImpl
public class SingleCachingProductRetrieveStrategyImpl
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 | |
---|---|
SingleCachingProductRetrieveStrategyImpl()
|
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)
Product
with the given product uid. Return null
if a product with the given uid doesn't exist or the
product is not displayable.
retrieveProduct
in interface ProductRetrieveStrategy
productUid
- a product uidshoppingCart
- the customer shopping cartproductLoadTuner
- the product load tuner
Product
with the given product uid.public java.util.List retrieveProducts(java.util.Collection productUids, ShoppingCart shoppingCart, ProductLoadTuner productLoadTuner)
Product
of the given product uids. Only those products which are displayable are returned.
retrieveProducts
in interface ProductRetrieveStrategy
productUids
- a collection of product uidsshoppingCart
- the customer shopping cartproductLoadTuner
- the product load tuner
Product
.public void start()
org.hibernate.cache.CacheException
- Indicates a problem preparing cache for use.public void stop()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |