org.jboss.marshalling.serial
Class SerialMarshaller

java.lang.Object
  extended by org.jboss.marshalling.AbstractMarshaller
      extended by org.jboss.marshalling.serial.SerialMarshaller
All Implemented Interfaces:
java.io.Closeable, java.io.DataOutput, java.io.Flushable, java.io.ObjectOutput, java.io.ObjectStreamConstants, ByteOutput, Marshaller, ExtendedObjectStreamConstants

public final class SerialMarshaller
extends AbstractMarshaller
implements Marshaller, ExtendedObjectStreamConstants


Field Summary
 
Fields inherited from class org.jboss.marshalling.AbstractMarshaller
byteOutput, classExternalizerFactory, classResolver, classTable, configuredVersion, creator, externalizerFactory, objectResolver, objectTable, streamHeader
 
Fields inherited from interface org.jboss.marshalling.serial.ExtendedObjectStreamConstants
TC_CLASSTABLEDESC, TC_OBJECTTABLE
 
Fields inherited from interface java.io.ObjectStreamConstants
baseWireHandle, PROTOCOL_VERSION_1, PROTOCOL_VERSION_2, SC_BLOCK_DATA, SC_ENUM, 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_ENUM, TC_EXCEPTION, TC_LONGSTRING, TC_MAX, TC_NULL, TC_OBJECT, TC_PROXYCLASSDESC, TC_REFERENCE, TC_RESET, TC_STRING
 
Method Summary
 void clearClassCache()
          Discard the class cache.
 void clearInstanceCache()
          Discard the instance cache.
protected  void doStart()
          Perform any marshaller-specific start activity.
protected  void doWriteFields(SerializableClass info, java.lang.Object obj)
           
protected  void doWriteObject(java.lang.Object orig, boolean unshared)
          Implementation of the actual object-writing method.
 void finish()
          Finish marshalling to a stream.
 void flush()
          
 void start(ByteOutput byteOutput)
          Begin marshalling to a stream.
 
Methods inherited from class org.jboss.marshalling.AbstractMarshaller
close, write, write, write, writeBoolean, writeByte, writeBytes, writeChar, writeChars, writeDouble, writeFloat, writeInt, writeLong, writeObject, writeObjectUnshared, writeShort, writeUTF
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.jboss.marshalling.Marshaller
writeObjectUnshared
 
Methods inherited from interface java.io.ObjectOutput
close, write, write, write, writeObject
 
Methods inherited from interface java.io.DataOutput
writeBoolean, writeByte, writeBytes, writeChar, writeChars, writeDouble, writeFloat, writeInt, writeLong, writeShort, writeUTF
 
Methods inherited from interface org.jboss.marshalling.ByteOutput
write, write, write
 
Methods inherited from interface java.io.Closeable
close
 

Method Detail

doWriteObject

protected void doWriteObject(java.lang.Object orig,
                             boolean unshared)
                      throws java.io.IOException
Description copied from class: AbstractMarshaller
Implementation of the actual object-writing method.

Specified by:
doWriteObject in class AbstractMarshaller
Parameters:
orig - the object to write
unshared - true if the instance is unshared, false if it is shared
Throws:
java.io.IOException - if an I/O error occurs

doWriteFields

protected void doWriteFields(SerializableClass info,
                             java.lang.Object obj)
                      throws java.io.IOException
Throws:
java.io.IOException

clearInstanceCache

public void clearInstanceCache()
                        throws java.io.IOException
Description copied from interface: Marshaller
Discard the instance cache. May also discard the class cache in implementations that do not support separated class and instance caches.

Specified by:
clearInstanceCache in interface Marshaller
Throws:
java.io.IOException - if an error occurs

clearClassCache

public void clearClassCache()
                     throws java.io.IOException
Description copied from interface: Marshaller
Discard the class cache. Implicitly also discards the instance cache.

Specified by:
clearClassCache in interface Marshaller
Throws:
java.io.IOException - if an error occurs

start

public void start(ByteOutput byteOutput)
           throws java.io.IOException
Description copied from class: AbstractMarshaller
Begin marshalling to a stream.

Specified by:
start in interface Marshaller
Overrides:
start in class AbstractMarshaller
Parameters:
byteOutput - the new stream
Throws:
java.io.IOException - if an error occurs during setup, such as an error writing the header

doStart

protected void doStart()
                throws java.io.IOException
Description copied from class: AbstractMarshaller
Perform any marshaller-specific start activity. This implementation simply writes the stream header.

Overrides:
doStart in class AbstractMarshaller
Throws:
java.io.IOException - if I/O exception occurs

finish

public void finish()
            throws java.io.IOException
Description copied from class: AbstractMarshaller
Finish marshalling to a stream. Any transient class or instance cache is discarded. The stream is released. No further marshalling may be done until the Marshaller.start(ByteOutput) method is again invoked.

Specified by:
finish in interface Marshaller
Overrides:
finish in class AbstractMarshaller
Throws:
java.io.IOException - if an error occurs

flush

public void flush()
           throws java.io.IOException
Description copied from class: AbstractMarshaller

Specified by:
flush in interface java.io.Flushable
Specified by:
flush in interface java.io.ObjectOutput
Overrides:
flush in class AbstractMarshaller
Throws:
java.io.IOException