blob: 42dbc5a80093227104de14a412d837f266ae0ca9 [file] [log] [blame]
Vinay Vishal57171472018-09-18 20:22:00 +05301/*
2 * Copyright (c) 2002, 2018 Oracle and/or its affiliates. All rights reserved.
3 *
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v. 2.0, which is available at
6 * http://www.eclipse.org/legal/epl-2.0.
7 *
8 * This Source Code may also be made available under the following Secondary
9 * Licenses when the conditions for such availability set forth in the
10 * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
11 * version 2 with the GNU Classpath Exception, which is available at
12 * https://www.gnu.org/software/classpath/license.html.
13 *
14 * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15 */
16
17package myejb;
18
19import java.io.Serializable;
David Matějčekf4dc06a2021-05-17 12:10:57 +020020import java.rmi.RemoteException;
Gaurav Guptaed5e7312020-05-01 07:54:26 +053021import jakarta.ejb.SessionBean;
22import jakarta.ejb.SessionContext;
23import jakarta.ejb.EJBException;
Vinay Vishal57171472018-09-18 20:22:00 +053024import javax.naming.*;
25
26public class InterestEJB implements SessionBean {
27
28 private SessionContext sc;
David Matějčekf4dc06a2021-05-17 12:10:57 +020029
Vinay Vishal57171472018-09-18 20:22:00 +053030 public InterestEJB(){}
David Matějčekf4dc06a2021-05-17 12:10:57 +020031
Vinay Vishal57171472018-09-18 20:22:00 +053032 public void ejbCreate() throws RemoteException {
David Matějčekf4dc06a2021-05-17 12:10:57 +020033 System.out.println("In InterestEJB::ejbCreate !!");
Vinay Vishal57171472018-09-18 20:22:00 +053034 }
35
36 public void calculateInterest(double balance, double period) {
37 System.out.println(" Inside calculateInterest interest is : " + (balance * period * 0.1));
38 }
39
40 public void setSessionContext(SessionContext sc) {
David Matějčekf4dc06a2021-05-17 12:10:57 +020041
Vinay Vishal57171472018-09-18 20:22:00 +053042 this.sc = sc;
43 }
David Matějčekf4dc06a2021-05-17 12:10:57 +020044
Vinay Vishal57171472018-09-18 20:22:00 +053045 public void ejbRemove() throws RemoteException {}
David Matějčekf4dc06a2021-05-17 12:10:57 +020046
Vinay Vishal57171472018-09-18 20:22:00 +053047 public void ejbActivate() {}
David Matějčekf4dc06a2021-05-17 12:10:57 +020048
Vinay Vishal57171472018-09-18 20:22:00 +053049 public void ejbPassivate() {}
50}