01: /**
02: * EasyBeans
03: * Copyright (C) 2006 Bull S.A.S.
04: * Contact: easybeans@ow2.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: EasyBeansHandle.java 1970 2007-10-16 11:49:25Z benoitf $
23: * --------------------------------------------------------------------------
24: */package org.ow2.easybeans.container.svc;
25:
26: import javax.ejb.EJBObject;
27: import javax.ejb.Handle;
28:
29: /**
30: * Handle object of an EJB. This object allows to get the EJB Object. It uses
31: * the HandleDelegate APi for managing its own serialization.
32: * @author Florent Benoit.
33: */
34: public class EasyBeansHandle implements Handle {
35:
36: /**
37: * UId used for the serialization.
38: */
39: private static final long serialVersionUID = -5201378510750050833L;
40:
41: /**
42: * EJB Object proxy (that is serializable).
43: */
44: private EJBObject ejbObject = null;
45:
46: /**
47: * Build an handle for an EJBObject.
48: * @param ejbObject the given EJBObject proxy.
49: */
50: public EasyBeansHandle(final EJBObject ejbObject) {
51: this .ejbObject = ejbObject;
52: }
53:
54: /**
55: * Obtain the EJB object reference represented by this handle.
56: * @return the EJB object reference represented by this handle.
57: */
58: public EJBObject getEJBObject() {
59: return ejbObject;
60: }
61:
62: /**
63: * Specific implementation of serialization. Must call
64: * HandleDelegate.writeEJBObject, as specified in 19.5.5.1 of spec EJB 2.1
65: * @param out The output stream used to write object
66: * @throws IOException error when writing object.
67: private void writeObject(java.io.ObjectOutputStream out) throws IOException {
68: // Get the handle delegate Object.
69: getHandleDelegate().writeEJBObject(getEJBObject(), out);
70: }
71: */
72:
73: /**
74: * Specific implementation of deserialization. Must call
75: * HandleDelegate.readEJBObject, as specified in 19.5.5.1 of spec EJB 2.1
76: * @param in The input Stream from where is read the object.
77: * @throws IOException error when reading object.
78: * @throws ClassNotFoundException -
79: private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException {
80: EJBObject obj = getHandleDelegate().readEJBObject(in);
81: }
82: */
83:
84: }
|