org.objectweb.jac.core
Class JacObjectInputStream

java.lang.Object
  |
  +--java.io.InputStream
        |
        +--java.io.ObjectInputStream
              |
              +--org.objectweb.jac.core.JacObjectInputStream
All Implemented Interfaces:
DataInput, ObjectInput, ObjectStreamConstants

public class JacObjectInputStream
extends ObjectInputStream

JacObjectInputStream is used to read JAC objects from an input stream during a deserialization process.

This stream is used when deserializing an array of bytes with JacObject.deserialize(). All the objects that are not serialized JAC objects are deserialized with the default procedure. When a serialized JAC object is encountered, a whenDeserialized event is thrown on the current AC manager so that the aspect components can parametrize the deserialization process.

A symetric process for serialization is implemented by JacObjectOutputStream.

Author:
Renaud Pawlak, Lionel Seinturier
See Also:
ACManager.whenDeserialized(SerializedJacObject,Wrappee), JacObjectOutputStream

Field Summary
 
Fields inherited from interface java.io.ObjectStreamConstants
baseWireHandle, PROTOCOL_VERSION_1, PROTOCOL_VERSION_2, SC_BLOCK_DATA, SC_EXTERNALIZABLE, SC_SERIALIZABLE, SC_WRITE_METHOD, STREAM_MAGIC, STREAM_VERSION, SUBCLASS_IMPLEMENTATION_PERMISSION, SUBSTITUTION_PERMISSION, TC_ARRAY, TC_BASE, TC_BLOCKDATA, TC_BLOCKDATALONG, TC_CLASS, TC_CLASSDESC, TC_ENDBLOCKDATA, TC_EXCEPTION, TC_LONGSTRING, TC_MAX, TC_NULL, TC_OBJECT, TC_PROXYCLASSDESC, TC_REFERENCE, TC_RESET, TC_STRING
 
Constructor Summary
JacObjectInputStream(InputStream is)
          Creates a JacObjectInputStream.
 
Method Summary
protected  Object resolveObject(Object obj)
          This method is upcalled by the Java deserialization process each time a new object to deserialize is encountered.
 
Methods inherited from class java.io.ObjectInputStream
available, close, defaultReadObject, enableResolveObject, read, read, readBoolean, readByte, readChar, readClassDescriptor, readDouble, readFields, readFloat, readFully, readFully, readInt, readLine, readLong, readObject, readObjectOverride, readShort, readStreamHeader, readUnshared, readUnsignedByte, readUnsignedShort, readUTF, registerValidation, resolveClass, resolveProxyClass, skipBytes
 
Methods inherited from class java.io.InputStream
mark, markSupported, read, reset, skip
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.io.ObjectInput
read, skip
 

Constructor Detail

JacObjectInputStream

public JacObjectInputStream(InputStream is)
                     throws IOException
Creates a JacObjectInputStream.

Parameters:
is - the input stream from which the bytes are read.
Method Detail

resolveObject

protected Object resolveObject(Object obj)
                        throws IOException
This method is upcalled by the Java deserialization process each time a new object to deserialize is encountered.

If a serialized JAC object is encountered (instance of SerializedJacObject), the aspect component manager is upcalled to parametrize the deserialization.

Overrides:
resolveObject in class ObjectInputStream
Parameters:
obj - the encountered serialized JAC object
Returns:
the final deserialized JAC object
IOException
See Also:
SerializedJacObject, ACManager.whenDeserialized(SerializedJacObject,Wrappee)