]> git.mxchange.org Git - pizzaservice-war.git/blob
b86cf11dca8fec7248865c77a96e5958e3b94bb1
[pizzaservice-war.git] /
1 /*
2  * Copyright (C) 2017 RRoland Häder
3  *
4  * This program is free software: you can redistribute it and/or modify
5  * it under the terms of the GNU Affero General Public License as
6  * published by the Free Software Foundation, either version 3 of the
7  * License, or (at your option) any later version.
8  *
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 Affero General Public License for more details.
13  *
14  * You should have received a copy of the GNU Affero General Public License
15  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
16  */
17 package org.mxchange.pizzaapplication.beans.business.employee;
18
19 import javax.annotation.PostConstruct;
20 import javax.enterprise.context.RequestScoped;
21 import javax.faces.view.facelets.FaceletException;
22 import javax.inject.Named;
23 import javax.naming.Context;
24 import javax.naming.InitialContext;
25 import javax.naming.NamingException;
26 import org.mxchange.jcontactsbusiness.employee.AdminCompanyEmployeeSessionBeanRemote;
27 import org.mxchange.pizzaapplication.beans.BasePizzaController;
28
29 /**
30  * A request-scoped bean for administrative purposes for company employees.
31  * <p>
32  * @author Roland Häder<roland@mxchange.org>
33  */
34 @Named ("adminCompanyEmployeeController")
35 @RequestScoped
36 public class PizzaAdminCompanyEmployeeWebRequestBean extends BasePizzaController implements PizzaAdminCompanyEmployeeWebRequestController {
37
38         /**
39          * Serial number
40          */
41         private static final long serialVersionUID = 12_886_968_547_360L;
42
43         /**
44          * EJB for administrative company employee purposes
45          */
46         private AdminCompanyEmployeeSessionBeanRemote adminCompanyEmployeeBean;
47
48         /**
49          * Default constructor
50          */
51         public PizzaAdminCompanyEmployeeWebRequestBean () {
52                 // Call super constructor
53                 super();
54         }
55
56         /**
57          * Initialization method
58          */
59         @PostConstruct
60         public void init () {
61                 // Try it
62                 try {
63                         // Get initial context
64                         Context context = new InitialContext();
65
66                         // Try to lookup
67                         this.adminCompanyEmployeeBean = (AdminCompanyEmployeeSessionBeanRemote) context.lookup("java:global/pizzaservice-ejb/adminCompanyEmployee!org.mxchange.jcontactsbusiness.employee.AdminCompanyEmployeeSessionBeanRemote"); //NOI18N
68                 } catch (final NamingException e) {
69                         // Throw again
70                         throw new FaceletException(e);
71                 }
72         }
73
74 }