01: /*
02: * JBoss, Home of Professional Open Source.
03: * Copyright 2006, Red Hat Middleware LLC, and individual contributors
04: * as indicated by the @author tags. See the copyright.txt file in the
05: * distribution for a 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.jmx.eardeployment.a.ejb;
23:
24: import java.rmi.RemoteException;
25: import javax.ejb.SessionBean;
26: import javax.ejb.SessionContext;
27: import javax.naming.InitialContext;
28: import org.jboss.logging.Logger;
29: import org.jboss.test.jmx.eardeployment.b.interfaces.SessionB;
30: import org.jboss.test.jmx.eardeployment.b.interfaces.SessionBHome;
31: import org.jboss.test.jmx.eardeployment.util.X;
32:
33: /**
34: * SessionABean.java
35: *
36: *
37: * Created: Thu Feb 21 14:48:18 2002
38: *
39: * @ejb:bean name="SessionA"
40: * jndi-name="eardeployment/SessionA"
41: * local-jndi-name="eardeployment/LocalSessionA"
42: * view-type="both"
43: * type="Stateless"
44: *
45: * @author <a href="mailto:d_jencks@users.sourceforge.net">David Jencks</a>
46: * @author Scott.Stark@jboss.org
47: * @version $Revision: 57211 $
48: */
49: public class SessionABean implements SessionBean {
50: private static String version = X.VERSION;
51:
52: /**
53: * Describe <code>callB</code> method here.
54: * @exception RemoteException if an error occurs
55: * @ejb:interface-method
56: */
57: public boolean callB() {
58: try {
59:
60: SessionBHome bhome = (SessionBHome) new InitialContext()
61: .lookup("eardeployment/SessionB");
62: SessionB b = bhome.create();
63: b.doNothing();
64: return true;
65: } catch (Exception e) {
66: Logger.getLogger(getClass()).error("error in callB", e);
67: return false;
68: } // end of try-catch
69:
70: }
71:
72: /**
73: * Describe <code>doNothing</code> method here.
74: *
75: * @ejb:interface-method
76: */
77: public void doNothing() {
78: }
79:
80: /**
81: * Describe <code>ejbCreate</code> method here.
82: *
83: * @ejb:create-method
84: */
85: public void ejbCreate() {
86: }
87:
88: public void ejbActivate() {
89: }
90:
91: public void ejbPassivate() {
92: }
93:
94: public void ejbRemove() {
95: }
96:
97: public void setSessionContext(SessionContext ctx) {
98: }
99: }
|