1
2
3
4
5 package test.crispy.example.ejb;
6
7 import java.rmi.RemoteException;
8
9 import javax.ejb.EJBException;
10 import javax.ejb.SessionBean;
11 import javax.ejb.SessionContext;
12
13 import org.apache.commons.logging.Log;
14 import org.apache.commons.logging.LogFactory;
15
16 import test.crispy.example.model.Kunde;
17
18 /**
19 * @author Linke
20 *
21 */
22 public class EjbServiceBean implements SessionBean {
23
24 private static final long serialVersionUID = 1873589347589758L;
25
26 protected static final Log log = LogFactory.getLog (EjbServiceBean.class);
27
28
29
30
31 public String echo(String pvEchoString) {
32 if (log.isDebugEnabled()) { log.debug("Echo: " + pvEchoString); }
33 if (pvEchoString == null) {
34 return null;
35 } else {
36 return "Return Echo: " + pvEchoString;
37 }
38 }
39
40 public Kunde renameKunde(Kunde pvKunde, String pvNewName) {
41 if (pvKunde == null) { return null; }
42 pvKunde.setName(pvNewName);
43 return pvKunde;
44 }
45
46
47 public int add(int a, int b) {
48 return a+b;
49 }
50
51 public Long addLong (Long a, Long b) {
52 if (a == null || b == null) {
53 return null;
54 } else {
55 return new Long(a.longValue() + b.longValue());
56 }
57 }
58
59
60 /**
61 * @see javax.ejb.SessionBean#setSessionContext(javax.ejb.SessionContext)
62 */
63 public void setSessionContext(SessionContext pvSessionContext) throws EJBException, RemoteException {
64
65 }
66
67 /**
68 * @see javax.ejb.SessionBean#ejbRemove()
69 */
70 public void ejbRemove() throws EJBException, RemoteException {
71 if (log.isDebugEnabled()) { log.debug("ejbRemove"); }
72 }
73
74 /**
75 * @see javax.ejb.SessionBean#ejbActivate()
76 */
77 public void ejbActivate() throws EJBException, RemoteException {
78 if (log.isDebugEnabled()) { log.debug("ejbActivate"); }
79 }
80
81 /**
82 * @see javax.ejb.SessionBean#ejbPassivate()
83 */
84 public void ejbPassivate() throws EJBException, RemoteException {
85 if (log.isDebugEnabled()) { log.debug("ejbPassivate"); }
86 }
87
88 public void ejbCreate() throws javax.ejb.CreateException {
89 if (log.isDebugEnabled()) { log.debug("ejbCreate"); }
90 }
91
92 }