import java.io.IOException;
import java.sql.SQLException;
+import java.text.MessageFormat;
import java.util.Iterator;
import javax.annotation.PostConstruct;
import javax.enterprise.context.SessionScoped;
*
* @author Roland Haeder
*/
-@Named("service")
+@Named("controller")
@SessionScoped
public class PizzaServiceBean implements PizzaBean {
/**
{
// Get new application instance
this.LOG = LogManager.getLogger(this);
- this.LOG.debug("INITIALIZER!");
+ this.LOG.debug("INITIALIZER!"); //NOI18N
this.app = new PizzaServiceApplication();
}
* Default constructor
*/
public PizzaServiceBean () {
- this.getLogger().trace("CALLED!");
+ this.getLogger().trace("CALLED!"); //NOI18N
}
@Override
@PostConstruct
public void init () throws FacesException {
// Trace message
- this.getLogger().trace("application=" + this.getApplication() + ",basket=" + this.getBasket() + " - CALLED!");
+ this.getLogger().trace(MessageFormat.format("application={0},basket={1} - CALLED!", this.getApplication(), this.getBasket())); //NOI18N
// Must not be null
if (this.getApplication() == null) {
// Abort here
- throw new NullPointerException("application is null");
+ throw new NullPointerException("application is null"); //NOI18N
}
try {
@Override
public BasketBean getBasket () {
// Trace message
- this.getLogger().trace("basket=" + this.basket + " - EXIT!");
+ //* NOISY-DEBUG: */ this.getLogger().trace(MessageFormat.format("basket={0} - EXIT!", this.basket)); //NOI18N
// Return it
return this.basket;
@Override
public void setBasket (final BasketBean basket) {
// Trace message
- this.getLogger().trace("basket=" + basket + " - CALLED!");
+ //* NOISY-DEBUG: */ this.getLogger().trace(MessageFormat.format("basket={0} - CALLED!", basket)); //NOI18N
// Set it here
this.basket = basket;
@Override
public ServletContext getApplication () {
// Trace message
- this.getLogger().trace("application=" + this.application + " - EXIT!");
+ //* NOISY-DEBUG: */ this.getLogger().trace(MessageFormat.format("application={0} - EXIT!", this.application)); //NOI18N
// Return it
return this.application;
@Override
public void setApplication (final ServletContext application) {
// Trace message
- this.getLogger().trace("application=" + application + " - CALLED!");
+ //* NOISY-DEBUG: */ this.getLogger().trace(MessageFormat.format("application={0} - CALLED!", application)); //NOI18N
// Set it here
this.application = application;
Product product = iterator.next();
// Debug message
- product.getLogger().debug("product.itemId=" + product.getItemId());
+ controller.getLogger().debug("product=" + product);
// Create an item instance form this product
AddableBasketItem item = controller.getBasket().getItem(product);
// Debug message
- product.getLogger().debug("item=" + item);
+ controller.getLogger().debug("item=" + item);
// Has it been already added to the basket?
if (item != null) {