2 * Copyright (C) 2016 Roland Häder
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 package org.mxchange.pizzaapplication;
19 import java.text.MessageFormat;
20 import javax.naming.Context;
21 import javax.naming.InitialContext;
22 import javax.naming.NamingException;
23 import org.mxchange.jcore.BaseFrameworkSystem;
24 import org.mxchange.jcoreeelogger.beans.local.logger.Log;
25 import org.mxchange.jcoreeelogger.beans.local.logger.LoggerBeanLocal;
28 * A general Pizza-Service class
30 * @author Roland Häder<roland@mxchange.org>
32 public abstract class BasePizzaServiceSystem extends BaseFrameworkSystem {
38 private LoggerBeanLocal loggerBeanLocal;
41 * Protected constructor
43 protected BasePizzaServiceSystem () {
46 // Get initial context
47 Context context = new InitialContext();
50 this.loggerBeanLocal = (LoggerBeanLocal) context.lookup("java:global/jcore-logger-ejb/logger!org.mxchange.jcoreeelogger.beans.local.logger.LoggerBeanLocal"); //NOI18N
51 } catch (final NamingException ex) {
53 throw new RuntimeException(MessageFormat.format("context.lookup() failed: {0}", ex.getMessage()), ex); //NOI18N
58 * Getter for logger instance
60 * @return Logger instance
62 protected LoggerBeanLocal getLogger () {
63 return this.loggerBeanLocal;