KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > javax > ejb > spi > HandleDelegate


1 /**
2  * EasyBeans
3  * Copyright (C) 2006 Bull S.A.S.
4  * Contact: easybeans@objectweb.org
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * 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: HandleDelegate.java 1100 2006-08-16 13:05:31Z benoitf $
23  * --------------------------------------------------------------------------
24  */

25
26 package javax.ejb.spi;
27
28 import java.io.IOException JavaDoc;
29 import java.io.ObjectInputStream JavaDoc;
30 import java.io.ObjectOutputStream JavaDoc;
31
32 import javax.ejb.EJBHome JavaDoc;
33 import javax.ejb.EJBObject JavaDoc;
34
35 /**
36  * Used to get used by portable implementations of javax.ejb.Handle and
37  * javax.ejb.HomeHandle.
38  * @see <a HREF="http://www.jcp.org/en/jsr/detail?id=220">EJB 3.0 specification</a>
39  * @author Florent Benoit
40  */

41 public interface HandleDelegate {
42
43     /**
44      * Serialize the EJBObject reference corresponding to a Handle. This method
45      * is called from the writeObject method of portable Handle implementation
46      * classes. The ostream object is the same object that was passed in to the
47      * Handle class's writeObject.
48      * @param ejbObject The EJBObject reference to be serialized.
49      * @param objectOutputStream The output stream.
50      * @throws IOException The EJBObject could not be serialized because of a
51      * system-level failure.
52      */

53     void writeEJBObject(final EJBObject JavaDoc ejbObject, final ObjectOutputStream JavaDoc objectOutputStream) throws IOException JavaDoc;
54
55     /**
56      * Deserialize the EJBObject reference corresponding to a Handle.
57      * readEJBObject is called from the readObject method of portable Handle
58      * implementation classes. The istream object is the same object that was
59      * passed in to the Handle class's readObject. When readEJBObject is called,
60      * istream must point to the location in the stream at which the EJBObject
61      * reference can be read. The container must ensure that the EJBObject
62      * reference is capable of performing invocations immediately after
63      * deserialization.
64      * @param objectInputStream The input stream.
65      * @return The deserialized EJBObject reference.
66      * @throws IOException The EJBObject could not be deserialized because of a
67      * system-level failure.
68      * @throws ClassNotFoundException The EJBObject could not be deserialized
69      * because some class could not be found.
70      */

71     EJBObject JavaDoc readEJBObject(ObjectInputStream JavaDoc objectInputStream) throws IOException JavaDoc, ClassNotFoundException JavaDoc;
72
73     /**
74      * Serialize the EJBHome reference corresponding to a HomeHandle. This
75      * method is called from the writeObject method of portable HomeHandle
76      * implementation classes. The ostream object is the same object that was
77      * passed in to the Handle class's writeObject.
78      * @param ejbHome The EJBHome reference to be serialized.
79      * @param objectOutputStream The output stream.
80      * @throws IOException The EJBObject could not be serialized because of a
81      * system-level failure.
82      */

83     void writeEJBHome(EJBHome JavaDoc ejbHome, ObjectOutputStream JavaDoc objectOutputStream) throws IOException JavaDoc;
84
85     /**
86      * Deserialize the EJBHome reference corresponding to a HomeHandle.
87      * readEJBHome is called from the readObject method of portable HomeHandle
88      * implementation classes. The istream object is the same object that was
89      * passed in to the HomeHandle class's readObject. When readEJBHome is
90      * called, istream must point to the location in the stream at which the
91      * EJBHome reference can be read. The container must ensure that the EJBHome
92      * reference is capable of performing invocations immediately after
93      * deserialization.
94      * @param objectInputStream The input stream.
95      * @return The deserialized EJBHome reference.
96      * @throws IOException The EJBHome could not be deserialized because of a
97      * system-level failure.
98      * @throws ClassNotFoundException The EJBHome could not be deserialized
99      * because some class could not be found.
100      */

101     EJBHome JavaDoc readEJBHome(ObjectInputStream JavaDoc objectInputStream) throws IOException JavaDoc, ClassNotFoundException JavaDoc;
102
103 }
104
Popular Tags