01: /**
02: * JOnAS: Java(TM) Open Application Server
03: * Copyright (C) 1999 Bull S.A.
04: * Contact: jonas-team@objectweb.org
05: *
06: * This library is free software; you can redistribute it and/or
07: * modify it under the terms of the GNU Lesser General Public
08: * License as published by the Free Software Foundation; either
09: * version 2.1 of the License, or any later version.
10: *
11: * This library is distributed in the hope that it will be useful,
12: * but WITHOUT ANY WARRANTY; without even the implied warranty of
13: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14: * Lesser General Public License for more details.
15: *
16: * You should have received a copy of the GNU Lesser General Public
17: * License along with this library; if not, write to the Free Software
18: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
19: * USA
20: *
21: * --------------------------------------------------------------------------
22: * $Id: JSessionHandle.java 6673 2005-04-28 16:53:00Z benoitf $
23: * --------------------------------------------------------------------------
24: */package org.objectweb.jonas_ejb.container;
25:
26: import java.io.Serializable;
27: import java.rmi.RemoteException;
28:
29: import javax.ejb.EJBObject;
30: import javax.ejb.Handle;
31:
32: import org.objectweb.util.monolog.api.BasicLevel;
33:
34: /**
35: * This class implements javax.ejb.Handle interface. For a Session Bean a Handle
36: * is directly its RMI Reference because its life time is limited by the JOnAS
37: * Server life time. (no need to retrieve it after the JOnAS Server has been
38: * restarted)
39: * @author Philippe Coq
40: */
41: public class JSessionHandle implements Handle, Serializable {
42:
43: /**
44: * @serial
45: */
46: private EJBObject ejbO = null;
47:
48: /**
49: * constructor
50: * @param jb the EJBObject represented by this handle.
51: */
52: public JSessionHandle(EJBObject jb) {
53: if (TraceEjb.isDebugIc()) {
54: TraceEjb.interp.log(BasicLevel.DEBUG, "");
55: }
56: ejbO = jb;
57: }
58:
59: /**
60: * @return the EJBObject represented by this handle.
61: * @throws RemoteException e The EJB object could not be obtained because of
62: * a system-level failure.
63: */
64: public EJBObject getEJBObject() throws RemoteException {
65: return ejbO;
66: }
67: }
|