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 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.
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.
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/>.
17 package org.mxchange.jfinancials.beans.phone;
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.jcontacts.phone.AdminContactsPhoneSessionBeanRemote;
27 import org.mxchange.jfinancials.beans.BaseFinancialsController;
28 import org.mxchange.jphone.phonenumbers.fax.DialableFaxNumber;
29 import org.mxchange.jphone.phonenumbers.landline.DialableLandLineNumber;
30 import org.mxchange.jphone.phonenumbers.mobile.DialableMobileNumber;
33 * Administrative bean (controller) for phone numbers
35 * @author Roland Häder<roland@mxchange.org>
37 @Named ("adminPhoneController")
39 public class FinancialsAdminPhoneWebRequestBean extends BaseFinancialsController implements FinancialsAdminPhoneWebRequestController {
44 private static final long serialVersionUID = 184_598_175_371_269_016L;
47 * Remote EJB for phone number (administrative)
49 private AdminContactsPhoneSessionBeanRemote adminPhoneBean;
54 private DialableFaxNumber fax;
59 private DialableLandLineNumber landLine;
64 private DialableMobileNumber mobileNumber;
69 public FinancialsAdminPhoneWebRequestBean () {
73 public DialableFaxNumber getFax () {
78 public void setFax (final DialableFaxNumber fax) {
83 public DialableLandLineNumber getLandLine () {
88 public void setLandLine (final DialableLandLineNumber landLine) {
89 this.landLine = landLine;
93 public DialableMobileNumber getMobileNumber () {
94 return this.mobileNumber;
98 public void setMobileNumber (final DialableMobileNumber mobileNumber) {
99 this.mobileNumber = mobileNumber;
103 * Post-construction method
106 public void init () {
109 // Get initial context
110 Context context = new InitialContext();
112 // Try to lookup the beans
113 this.adminPhoneBean = (AdminContactsPhoneSessionBeanRemote) context.lookup("java:global/jfinancials-ejb/admincontactphone!org.mxchange.jcontacts.phone.AdminContactsPhoneSessionBeanRemote"); //NOI18N
114 } catch (final NamingException e) {
116 throw new FaceletException(e);