View Javadoc

1   /**********************************************************************
2    * SerializeAdapter.java
3    * created on 08.08.2004 by netseeker
4    * $Source: /cvsroot/ejoe/EJOE/src/de/netseeker/ejoe/adapter/SerializeAdapter.java,v $
5    * $Date: 2006/02/04 15:16:45 $
6    * $Revision: 1.7 $
7    *********************************************************************/
8   
9   package de.netseeker.ejoe.adapter;
10  
11  import java.io.IOException;
12  import java.io.InputStream;
13  import java.io.OutputStream;
14  import java.io.Serializable;
15  
16  /***
17   * Interface defining all methods required by a (de)serialize adapter.
18   *
19   * @author netseeker aka Michael Manske
20   */
21  public interface SerializeAdapter extends Serializable
22  {
23  	/***
24  	 * Deserializes an object out of an given InputStream
25  	 *
26  	 * @param in
27  	 *            the input stream to use for deserialization
28  	 * @return a deserialized object instance
29  	 * @throws IOException
30  	 */
31  	public Object read(InputStream in) throws IOException;
32  
33  	/***
34  	 * Serializes an object into an output stream
35  	 *
36  	 * @param obj
37  	 *            object that should get serialized
38  	 * @param out
39  	 *            the outputstream into which the object should serialized
40  	 * @throws IOException
41  	 */
42  	public void write(Object obj, OutputStream out) throws IOException;
43  
44  	/***
45  	 * Signals a change of the ContextClassLoader of the current thread to the
46  	 * adapter. This method will be called when the EJOE client is started with
47  	 * support for remote classloading.
48  	 *
49  	 * @param classLoader
50  	 */
51  	public void handleClassLoaderChange(ClassLoader classLoader);
52  }