01: /*
02: * JBoss, a division of Red Hat
03: * Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
04: * by the @authors tag. See the copyright.txt in the distribution for a
05: * full listing of individual contributors.
06: *
07: * This is free software; you can redistribute it and/or modify it
08: * under the terms of the GNU Lesser General Public License as
09: * published by the Free Software Foundation; either version 2.1 of
10: * the License, or (at your option) any later version.
11: *
12: * This software is distributed in the hope that it will be useful,
13: * but WITHOUT ANY WARRANTY; without even the implied warranty of
14: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15: * Lesser General Public License for more details.
16: *
17: * You should have received a copy of the GNU Lesser General Public
18: * License along with this software; if not, write to the Free
19: * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
20: * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
21: */
22: package org.jboss.test.scoped.ejb.b;
23:
24: import org.jboss.test.scoped.interfaces.dto.SimpleResponseDTO;
25: import org.jboss.test.scoped.interfaces.dto.SimpleRequestDTO;
26: import org.jboss.logging.Logger;
27:
28: import javax.ejb.SessionBean;
29: import javax.ejb.SessionContext;
30: import javax.ejb.EJBException;
31: import java.rmi.RemoteException;
32:
33: /**
34: * @author <a href="mailto:tom@jboss.org">Tom Elrod</a>
35: */
36: public class SessionBEJB implements SessionBean {
37: private static final long serialVersionUID = 2L;
38:
39: public SessionBEJB() {
40: super ();
41: }
42:
43: public SimpleResponseDTO runSimpleTest(SimpleRequestDTO requestDTO) {
44:
45: try {
46: SimpleResponseDTO rsDTO = new SimpleResponseDTO();
47: rsDTO.setFirstName(requestDTO.getFirstName().toUpperCase());
48: rsDTO.setLastName(requestDTO.getLastName().toUpperCase());
49: System.out.println("Got firstname: "
50: + requestDTO.getFirstName());
51: System.out.println("Got lastname:"
52: + requestDTO.getLastName());
53: return rsDTO;
54: } catch (Throwable t) {
55: Logger logger = Logger.getLogger(this .getClass());
56: logger.error(t);
57:
58: SimpleResponseDTO rsDTO = new SimpleResponseDTO();
59:
60: return rsDTO;
61: }
62: }
63:
64: public String stringTest(String request)
65: throws java.rmi.RemoteException {
66: return request.toUpperCase();
67: }
68:
69: public void setSessionContext(SessionContext arg0)
70: throws EJBException, RemoteException {
71: }
72:
73: public void ejbCreate() throws EJBException, RemoteException {
74: }
75:
76: public void ejbRemove() throws EJBException, RemoteException {
77: }
78:
79: public void ejbActivate() throws EJBException, RemoteException {
80: }
81:
82: public void ejbPassivate() throws EJBException, RemoteException {
83: }
84: }
|