--- /dev/null
+/*
+ * Copyright (C) 2015 Roland Haeder
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+package org.mxchange.pizzaapplication.beans.basket;
+
+import java.io.IOException;
+import java.sql.SQLException;
+import javax.enterprise.context.SessionScoped;
+import javax.inject.Inject;
+import javax.inject.Named;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
+import org.mxchange.jcore.exceptions.BadTokenException;
+import org.mxchange.jcore.exceptions.UnsupportedDatabaseBackendException;
+import org.mxchange.pizzaapplication.beans.item.ItemBean;
+
+/**
+ * A bean for basket items
+ *
+ * @author Roland Haeder
+ */
+@Named("item")
+@SessionScoped
+public class BasketItemBean implements ItemBean {
+ /**
+ * Serial number
+ */
+ private static final long serialVersionUID = 324813539158845L;
+
+ /**
+ * Class' logger
+ */
+ private final Logger LOG;
+
+ /**
+ * Instance of wrapped basket
+ */
+ @Inject
+ private BasketBean basket;
+
+ /**
+ * Initializer block
+ */
+ {
+ // Get logger
+ LOG = LogManager.getLogger(this);
+ }
+
+ /**
+ * Default constructor to be able to throw exceptions from super constructor
+ * @throws org.mxchange.jcore.exceptions.UnsupportedDatabaseBackendException If the backend is unsupported
+ * @throws java.sql.SQLException If an SQL error occurs
+ * @throws java.io.IOException If an IO Error occurs
+ * @throws org.mxchange.jcore.exceptions.BadTokenException If a bad token was found
+ */
+ public BasketItemBean () throws UnsupportedDatabaseBackendException, SQLException, IOException, BadTokenException {
+ // Trace message
+ this.getLogger().trace("CALLED!");
+ }
+
+ /**
+ * Getter for logger
+ *
+ * @return Logger
+ */
+ @Override
+ public Logger getLogger () {
+ return this.LOG;
+ }
+
+ /**
+ * @return the basket
+ */
+ @Override
+ public BasketBean getBasket () {
+ // Trace message
+ //* NOISY-DEBUG: */ this.getLogger().trace(MessageFormat.format("basket={0} - EXIT!", this.basket)); //NOI18N
+
+ // Return it
+ return this.basket;
+ }
+
+ /**
+ * @param basket the basket to set
+ */
+ @Override
+ public void setBasket (final BasketBean basket) {
+ // Trace message
+ //* NOISY-DEBUG: */ this.getLogger().trace(MessageFormat.format("basket={0} - CALLED!", basket)); //NOI18N
+
+ // Set it here
+ this.basket = basket;
+ }
+}
--- /dev/null
+/*
+ * Copyright (C) 2015 Roland Haeder
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+package org.mxchange.pizzaapplication.beans.item;
+
+import java.io.Serializable;
+import org.apache.logging.log4j.Logger;
+import org.mxchange.pizzaapplication.beans.basket.BasketBean;
+
+/**
+ * An interface for an item bean
+ *
+ * @author Roland Haeder
+ */
+public interface ItemBean extends Serializable {
+ /**
+ * @return the basket
+ */
+ public BasketBean getBasket ();
+
+ /**
+ * @param basket the basket to set
+ */
+ public void setBasket (final BasketBean basket);
+
+ /**
+ * Getter for logger
+ *
+ * @return Logger
+ */
+ public Logger getLogger ();
+}