package ca.nexcel.books.business;

import java.util.HashMap;

import org.picocontainer.Startable;

import ca.nexcel.books.beans.Book;

public class BookServiceImpl implements BookService, Startable {
	
	private static HashMap books = new HashMap();
	
	public Book read(String isbn) {
		return (Book) books.get(isbn);
	}
	
	
	/* (non-Javadoc)
	 * @see org.picocontainer.Startable#start()
	 */
	public void start() {
		Book book = null;
		
		book = new Book();
		book.setAuthor("George Franciscus, Danilo Gurovich");
		book.setDescription("A collection of solid strategies to building Struts applications");
		book.setIsbn("1");
		book.setPages(450);
		book.setPrice(67.00);
		book.setPublisher("Manning");
		book.setTitle("Struts Recipes");
		books.put(book.getIsbn(), book);

	}
	/* (non-Javadoc)
	 * @see org.picocontainer.Startable#stop()
	 */
	public void stop() {
		// TODO Auto-generated method stub

	}
}
