|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcatalog.model.service.impl.CachedCatalogServiceImpl
The implementation of the CatalogService.
Spring Framework is used to manage this service bean. Since this class is not dependend on Spring API, it can be used outside the Spring IOC container.
Read/write caches for products and categories are implemented inside this class. It will be configured as a singleton in the Spring container. So the caches are in the application scope.
CatalogService| Constructor Summary | |
CachedCatalogServiceImpl()
Default constructor. |
|
| Method Summary | |
void |
deleteProduct(Product product)
Delete product. |
java.util.List |
getAllCategories()
Get all categories. |
java.util.List |
getAllProducts()
Get all products. |
Category |
getCategory(java.lang.String id)
Get category by id. |
Product |
getProduct(java.lang.String id)
Get product by product id. |
void |
init()
|
Product |
saveProduct(Product product)
Save the product. |
void |
setCatalogDao(CatalogDao newCatalogDao)
Set the CatalogDao. |
void |
updateProduct(Product product)
Update product. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public CachedCatalogServiceImpl()
throws CatalogException
CatalogException - If internal error occurs while populates the caches| Method Detail |
public void setCatalogDao(CatalogDao newCatalogDao)
CatalogDao.
It can be used by the Spring IOC container.
newCatalogDao - the CatalogDao to be set
public Product saveProduct(Product product)
throws CatalogException
CatalogService
saveProduct in interface CatalogServiceproduct - the product to be saved
CatalogExceptionCatalogService.saveProduct(Product)
public void updateProduct(Product product)
throws CatalogException
CatalogService
updateProduct in interface CatalogServiceproduct - the product to be updated
CatalogExceptionCatalogService.updateProduct(Product)
public void deleteProduct(Product product)
throws CatalogException
CatalogService
deleteProduct in interface CatalogServiceproduct - the product to be deleted
CatalogExceptionCatalogService.deleteProduct(Product)public Product getProduct(java.lang.String id)
CatalogService
getProduct in interface CatalogServiceid - the product id
CatalogService.getProduct(String)public Category getCategory(java.lang.String id)
CatalogService
getCategory in interface CatalogServiceid - the category id
CatalogService.getCategory(String)public java.util.List getAllProducts()
CatalogService
getAllProducts in interface CatalogServiceCatalogService.getAllProducts()public java.util.List getAllCategories()
CatalogService
getAllCategories in interface CatalogService
public void init()
throws CatalogException
CatalogException
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||