Top Fields Constructors Methods
org.jboss.marshalling.river

public Class RiverMarshaller

extends AbstractMarshaller
Class Inheritance
Static Imports
java.lang.System.getSecurityManager, java.security.AccessController.doPrivileged, org.jboss.marshalling.river.Protocol.*

Field Summary

Modifier and TypeField and Description
private static final IdentityIntMap<Class<?>>
private static final IdentityIntMap<Class<?>>
private static final IdentityIntMap<Class<?>>
private BlockMarshaller
private final IdentityIntMap<Class<?>>
private int
private final PrivilegedExceptionAction<RiverObjectOutputStream>
private static final Field
private static final Field
private static final Field
private final IdentityHashMap<Class<?>, Externalizer>
private final IdentityIntMap<Object>
private int
private ObjectOutput
private RiverObjectOutputStream
private final SerializableClassRegistry
private final IdentityIntMap<Class<?>>
Inherited from org.jboss.marshalling.AbstractMarshaller:
classExternalizerFactoryclassResolverclassTableconfiguredVersionexceptionListenerobjectPreResolverobjectResolverobjectTableserializabilityCheckerstreamHeader

Constructor Summary

AccessConstructor and Description
protected
RiverMarshaller(final RiverMarshallerFactory marshallerFactory, final SerializableClassRegistry registry, final MarshallingConfiguration configuration)

Method Summary

Modifier and TypeMethod and Description
public void
public void
private RiverObjectOutputStream
protected void
protected void
doWriteFields(final SerializableClass info, final Object obj)

protected void
doWriteObject(final Object
the object to write
original
,
final boolean
true if the instance is unshared, false if it is shared
unshared
)

Implements abstract org.jboss.marshalling.AbstractObjectOutput.doWriteObject.

Implementation of the actual object-writing method.
private void
protected void
doWriteSerializableObject(final SerializableClass info, final Object obj, final Class<?> objClass)

private static IdentityIntMap<Class<?>>
getBasicClasses(final int configuredVersion)

protected BlockMarshaller
private static Class<? extends Enum<E extends Enum<E>>>
private static Enum<E extends Enum<E>>[]
private static Class<? extends Enum<E extends Enum<E>>>
protected ObjectOutput
private RiverObjectOutputStream
public void
start(final ByteOutput
the new stream
byteOutput
)

Overrides org.jboss.marshalling.AbstractMarshaller.start.

Implements org.jboss.marshalling.Marshaller.start.

Begin marshalling to a stream.
private void
writeArrayObject(boolean unshared, Object obj, Class<?> objClass)

private void
writeBooleanArray(final boolean[] booleans)

protected void
writeClass(final Class<?> objClass)

protected void
writeClassClass(final Class<?> classObj)

private void
writeClassTableData(final Class<?> objClass, final ClassTable.Writer classTableWriter)

private void
protected void
writeEnumClass(final Class<? extends Enum<E extends Enum<E>>> objClass)

private void
writeExternalizable(boolean unshared, Object obj, Class<?> objClass)

protected void
writeExternalizableClass(final Class<?> objClass)

protected void
writeExternalizerClass(final Class<?> objClass, final Externalizer externalizer)

protected boolean
writeKnownClass(final Class<?> objClass, final boolean isSuper)

private void
writeKnownObject(boolean unshared, Object obj, Class<?> objClass, int id)

protected void
writeNewClass(final Class<?> objClass)

protected void
writeNewEnumClass(final Class<? extends Enum<E extends Enum<E>>> objClass)

protected void
protected void
writeNewExternalizerClass(final Class<?> objClass, final Externalizer externalizer)

protected void
writeNewProxyClass(final Class<?> objClass)

protected void
writeNewSerializableClass(final Class<?> objClass)

protected void
writeNewSerialSuperClass(final Class<?> objClass)

protected void
writeObjectArrayClass(final Class<?> objClass)

protected void
writeProxyClass(final Class<?> objClass)

protected void
writeSerializableClass(final Class<?> objClass, final boolean isSuper)

protected void
writeSerialSuperClass(final Class<?> objClass)

private void
public void
writeUTF(final String
the string value to be written.
string
)

Overrides org.jboss.marshalling.SimpleDataOutput.writeUTF.

Implements java.io.DataOutput.writeUTF.

Writes two bytes of length information to the output stream, followed by the modified UTF-8 representation of every character in the string s.
Inherited from org.jboss.marshalling.AbstractMarshaller:
closefinishwriteObjectwriteObjectUnshared

Field Detail

BASIC_CLASSES_V2back to summary
private static final IdentityIntMap<Class<?>> BASIC_CLASSES_V2
BASIC_CLASSES_V3back to summary
private static final IdentityIntMap<Class<?>> BASIC_CLASSES_V3
BASIC_CLASSES_V4back to summary
private static final IdentityIntMap<Class<?>> BASIC_CLASSES_V4
blockMarshallerback to summary
private BlockMarshaller blockMarshaller
classCacheback to summary
private final IdentityIntMap<Class<?>> classCache
classSeqback to summary
private int classSeq
createObjectOutputStreamActionback to summary
private final PrivilegedExceptionAction<RiverObjectOutputStream> createObjectOutputStreamAction
ENUM_MAP_KEY_TYPE_FIELDback to summary
private static final Field ENUM_MAP_KEY_TYPE_FIELD
ENUM_SET_ELEMENT_TYPE_FIELDback to summary
private static final Field ENUM_SET_ELEMENT_TYPE_FIELD
ENUM_SET_VALUES_FIELDback to summary
private static final Field ENUM_SET_VALUES_FIELD
externalizersback to summary
private final IdentityHashMap<Class<?>, Externalizer> externalizers
instanceCacheback to summary
private final IdentityIntMap<Object> instanceCache
instanceSeqback to summary
private int instanceSeq
objectOutputback to summary
private ObjectOutput objectOutput
objectOutputStreamback to summary
private RiverObjectOutputStream objectOutputStream
registryback to summary
private final SerializableClassRegistry registry
serialClassCacheback to summary
private final IdentityIntMap<Class<?>> serialClassCache

Constructor Detail

RiverMarshallerback to summary
protected RiverMarshaller(final RiverMarshallerFactory marshallerFactory, final SerializableClassRegistry registry, final MarshallingConfiguration configuration) throws IOException

Method Detail

clearClassCacheback to summary
public void clearClassCache() throws IOException

Implements org.jboss.marshalling.Marshaller.clearClassCache.

Doc from org.jboss.marshalling.Marshaller.clearClassCache.

Discard the class cache. Implicitly also discards the instance cache.

Exceptions
IOException:
if an error occurs
clearInstanceCacheback to summary
public void clearInstanceCache() throws IOException

Implements org.jboss.marshalling.Marshaller.clearInstanceCache.

Doc from org.jboss.marshalling.Marshaller.clearInstanceCache.

Discard the instance cache. May also discard the class cache in implementations that do not support separated class and instance caches.

Exceptions
IOException:
if an error occurs
createObjectOutputStreamback to summary
private RiverObjectOutputStream createObjectOutputStream() throws IOException
doWriteEmptyFieldsback to summary
protected void doWriteEmptyFields(final SerializableClass info) throws IOException
doWriteFieldsback to summary
protected void doWriteFields(final SerializableClass info, final Object obj) throws IOException
doWriteObjectback to summary
protected void doWriteObject(final Object original, final boolean unshared) throws IOException

Implements abstract org.jboss.marshalling.AbstractObjectOutput.doWriteObject.

Doc from org.jboss.marshalling.AbstractObjectOutput.doWriteObject.

Implementation of the actual object-writing method.

Parameters
original:Object

the object to write

unshared:boolean

true if the instance is unshared, false if it is shared

Exceptions
IOException:
if an I/O error occurs
doWriteRecordback to summary
private void doWriteRecord(Object object, SerializableClass info) throws IOException
doWriteSerializableObjectback to summary
protected void doWriteSerializableObject(final SerializableClass info, final Object obj, final Class<?> objClass) throws IOException
getBasicClassesback to summary
private static IdentityIntMap<Class<?>> getBasicClasses(final int configuredVersion)
getBlockMarshallerback to summary
protected BlockMarshaller getBlockMarshaller()
getEnumMapKeyTypeback to summary
private static Class<? extends Enum<E extends Enum<E>>> getEnumMapKeyType(final Object obj)
getEnumSetElementsback to summary
private static Enum<E extends Enum<E>>[] getEnumSetElements(final Object obj)
getEnumSetElementTypeback to summary
private static Class<? extends Enum<E extends Enum<E>>> getEnumSetElementType(final Object obj)
getObjectOutputback to summary
protected ObjectOutput getObjectOutput()
getObjectOutputStreamback to summary
private RiverObjectOutputStream getObjectOutputStream() throws IOException
startback to summary
public void start(final ByteOutput byteOutput) throws IOException

Overrides org.jboss.marshalling.AbstractMarshaller.start.

Implements org.jboss.marshalling.Marshaller.start.

Doc from org.jboss.marshalling.AbstractMarshaller.start.

Begin marshalling to a stream.

Parameters
byteOutput:ByteOutput

Doc from org.jboss.marshalling.Marshaller.start.

the new stream

Exceptions
IOException:

Doc from org.jboss.marshalling.Marshaller.start.

if an error occurs during setup, such as an error writing the header

writeArrayObjectback to summary
private void writeArrayObject(boolean unshared, Object obj, Class<?> objClass) throws IOException
writeBooleanArrayback to summary
private void writeBooleanArray(final boolean[] booleans) throws IOException
writeClassback to summary
protected void writeClass(final Class<?> objClass) throws IOException
writeClassClassback to summary
protected void writeClassClass(final Class<?> classObj) throws IOException
writeClassTableDataback to summary
private void writeClassTableData(final Class<?> objClass, final ClassTable.Writer classTableWriter) throws IOException
writeEndBlockback to summary
private void writeEndBlock() throws IOException
writeEnumClassback to summary
protected void writeEnumClass(final Class<? extends Enum<E extends Enum<E>>> objClass) throws IOException
writeExternalizableback to summary
private void writeExternalizable(boolean unshared, Object obj, Class<?> objClass) throws IOException
writeExternalizableClassback to summary
protected void writeExternalizableClass(final Class<?> objClass) throws IOException
writeExternalizerClassback to summary
protected void writeExternalizerClass(final Class<?> objClass, final Externalizer externalizer) throws IOException
writeKnownClassback to summary
protected boolean writeKnownClass(final Class<?> objClass, final boolean isSuper) throws IOException
writeKnownObjectback to summary
private void writeKnownObject(boolean unshared, Object obj, Class<?> objClass, int id) throws IOException
writeNewClassback to summary
protected void writeNewClass(final Class<?> objClass) throws IOException
writeNewEnumClassback to summary
protected void writeNewEnumClass(final Class<? extends Enum<E extends Enum<E>>> objClass) throws IOException
writeNewExternalizableClassback to summary
protected void writeNewExternalizableClass(final Class<?> objClass) throws IOException
writeNewExternalizerClassback to summary
protected void writeNewExternalizerClass(final Class<?> objClass, final Externalizer externalizer) throws IOException
writeNewProxyClassback to summary
protected void writeNewProxyClass(final Class<?> objClass) throws IOException
writeNewSerializableClassback to summary
protected void writeNewSerializableClass(final Class<?> objClass) throws IOException
writeNewSerialSuperClassback to summary
protected void writeNewSerialSuperClass(final Class<?> objClass) throws IOException
writeObjectArrayClassback to summary
protected void writeObjectArrayClass(final Class<?> objClass) throws IOException
writeProxyClassback to summary
protected void writeProxyClass(final Class<?> objClass) throws IOException
writeSerializableClassback to summary
protected void writeSerializableClass(final Class<?> objClass, final boolean isSuper) throws IOException
writeSerialSuperClassback to summary
protected void writeSerialSuperClass(final Class<?> objClass) throws IOException
writeStringback to summary
private void writeString(String string) throws IOException
writeUTFback to summary
public void writeUTF(final String string) throws IOException

Overrides org.jboss.marshalling.SimpleDataOutput.writeUTF.

Implements java.io.DataOutput.writeUTF.

Doc from java.io.DataOutput.writeUTF.

Writes two bytes of length information to the output stream, followed by the modified UTF-8 representation of every character in the string s. If s is null, a NullPointerException is thrown. Each character in the string s is converted to a group of one, two, or three bytes, depending on the value of the character.

If a character c is in the range \u0001 through \u007f, it is represented by one byte:

(byte)c 

If a character c is \u0000 or is in the range \u0080 through \u07ff, then it is represented by two bytes, to be written in the order shown:

(byte)(0xc0 | (0x1f & (c >> 6)))
(byte)(0x80 | (0x3f & c))

If a character c is in the range \u0800 through uffff, then it is represented by three bytes, to be written in the order shown:

(byte)(0xe0 | (0x0f & (c >> 12)))
(byte)(0x80 | (0x3f & (c >>  6)))
(byte)(0x80 | (0x3f & c))

First, the total number of bytes needed to represent all the characters of s is calculated. If this number is larger than 65535, then a UTFDataFormatException is thrown. Otherwise, this length is written to the output stream in exactly the manner of the writeShort method; after this, the one-, two-, or three-byte representation of each character in the string s is written.

The bytes written by this method may be read by the readUTF method of interface DataInput, which will then return a String equal to s.

Parameters
string:String

the string value to be written.

Exceptions
IOException:
if an I/O error occurs.