01: package ca.nexcel.books.business;
02:
03: import java.util.HashMap;
04:
05: import org.picocontainer.Startable;
06:
07: import ca.nexcel.books.beans.Book;
08:
09: public class BookServiceImpl implements BookService, Startable {
10:
11: private static HashMap books = new HashMap();
12:
13: public Book read(String isbn) {
14: return (Book) books.get(isbn);
15: }
16:
17: /* (non-Javadoc)
18: * @see org.picocontainer.Startable#start()
19: */
20: public void start() {
21: Book book = null;
22:
23: book = new Book();
24: book.setAuthor("George Franciscus, Danilo Gurovich");
25: book
26: .setDescription("A collection of solid strategies to building Struts applications");
27: book.setIsbn("1");
28: book.setPages(450);
29: book.setPrice(67.00);
30: book.setPublisher("Manning");
31: book.setTitle("Struts ²âÊÔ");
32: books.put(book.getIsbn(), book);
33:
34: }
35:
36: /* (non-Javadoc)
37: * @see org.picocontainer.Startable#stop()
38: */
39: public void stop() {
40: // TODO Auto-generated method stub
41:
42: }
43: }
|