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.a;
23:
24: import org.jboss.logging.Logger;
25: import org.jboss.test.util.Debug;
26: import org.jboss.test.scoped.interfaces.dto.SimpleResponseDTO;
27: import org.jboss.test.scoped.interfaces.dto.SimpleRequestDTO;
28:
29: import javax.ejb.SessionBean;
30: import javax.ejb.EJBException;
31: import javax.ejb.CreateException;
32: import javax.ejb.SessionContext;
33: import javax.naming.InitialContext;
34: import java.rmi.RemoteException;
35:
36: /**
37: * @author <a href="mailto:tom@jboss.org">Tom Elrod</a>
38: */
39: public class SessionAEJB implements SessionBean {
40: private static final long serialVersionUID = 1L;
41:
42: public SessionAEJB() {
43: super ();
44: }
45:
46: public SimpleResponseDTO runSimpleTest(SimpleRequestDTO requestDTO) {
47:
48: try {
49: SimpleResponseDTO rsDTO = new SimpleResponseDTO();
50: rsDTO.setFirstName(requestDTO.getFirstName().toUpperCase());
51: rsDTO.setLastName(requestDTO.getLastName().toUpperCase());
52: System.out.println("Got firstname: "
53: + requestDTO.getFirstName());
54: System.out.println("Got lastname:"
55: + requestDTO.getLastName());
56: return rsDTO;
57: } catch (Throwable t) {
58: Logger logger = Logger.getLogger(this .getClass());
59: logger.error(t);
60:
61: SimpleResponseDTO rsDTO = new SimpleResponseDTO();
62:
63: return rsDTO;
64: }
65: }
66:
67: public String stringTest(String request)
68: throws java.rmi.RemoteException {
69: return request.toUpperCase();
70: }
71:
72: public void setSessionContext(SessionContext arg0)
73: throws EJBException, RemoteException {
74: }
75:
76: public void ejbCreate() throws EJBException, RemoteException {
77: }
78:
79: public void ejbRemove() throws EJBException, RemoteException {
80: }
81:
82: public void ejbActivate() throws EJBException, RemoteException {
83: }
84:
85: public void ejbPassivate() throws EJBException, RemoteException {
86: }
87: }
|