Top Inners Fields Constructors Methods
org.jboss.marshalling.river

public Class RiverUnmarshaller

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

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class

Field Summary

Modifier and TypeField and Description
private BlockUnmarshaller
private final ArrayList<ClassDescriptor>
private final PrivilegedExceptionAction<RiverObjectInputStream>
private int
private final ArrayList<Object>
private RiverObjectInputStream
private static final Field
private static final long
private final SerializableClassRegistry
private static final Object
private SortedSet<Validator>
private int
private int
Inherited from org.jboss.marshalling.AbstractUnmarshaller:
classExternalizerFactoryclassResolverclassTableconfiguredVersionexceptionListenerobjectPreResolverobjectResolverobjectTableserializabilityCheckerstreamHeader

Constructor Summary

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

Method Summary

Modifier and TypeMethod and Description
pack-priv void
addValidation(final ObjectInputValidation validation, final int prio)

public void
public void
public void
private RiverObjectInputStream
protected void
private Object
doInitSerializable(Object obj, final SerializableClassDescriptor descriptor, final boolean discardMissing)

private Object
doReadArray(final int cnt, final boolean unshared, final boolean discardMissing)

private Object
doReadBooleanArray(final int cnt, final boolean unshared)

private Object
doReadByteArray(final int cnt, final boolean unshared)

private Object
doReadCharArray(final int cnt, final boolean unshared)

pack-priv ClassDescriptor
doReadClassDescriptor(final int classType, final boolean required)

pack-priv Object
doReadCollectionObject(final boolean unshared, final int idx, final int size, final boolean discardMissing)

private Object
doReadDoubleArray(final int cnt, final boolean unshared)

private Object
doReadFloatArray(final int cnt, final boolean unshared)

private Object
doReadIntArray(final int cnt, final boolean unshared)

private Object
doReadLongArray(final int cnt, final boolean unshared)

pack-priv Object
doReadMapObject(final boolean unshared, final int idx, final int size, final boolean key, final boolean discardMissing)

pack-priv Object
doReadNestedObject(final boolean unshared, final String enclosingClassName)

protected Object
doReadNewObject(final int streamClassType, final boolean unshared, final boolean discardMissing)

protected Object
doReadObject(final boolean
true if the instance should be unshared, false if it is shared
unshared
)

Implements abstract org.jboss.marshalling.AbstractObjectInput.doReadObject.

Implementation of the actual object-reading method.
pack-priv Object
doReadObject(final boolean unshared, final boolean discardMissing)

pack-priv Object
doReadObject(int leadByte, final boolean unshared, final boolean discardMissing)

private Object
doReadObjectArray(final int cnt, final Class<?> type, final boolean unshared, final boolean discardMissing)

private Object
doReadRecord(SerializableClass info, boolean discardMissing)

private Object
doReadShortArray(final int cnt, final boolean unshared)

public void
private BlockUnmarshaller
private RiverObjectInputStream
private Object
readCollectionData(final boolean unshared, int cacheIdx, final int len, final Collection<E> target, final boolean discardMissing)

protected void
readFields(final Object obj, final SerializableClassDescriptor descriptor, final boolean discardMissing)

private Object
readMapData(final boolean unshared, int cacheIdx, final int len, final Map<K, V> target, final boolean discardMissing)

private Object
readSortedMapData(final boolean unshared, int cacheIdx, final int len, final SortedMap<K, V> target, final boolean discardMissing)

private Object
readSortedSetData(final boolean unshared, int cacheIdx, final int len, final SortedSet<E> target, final boolean discardMissing)

protected String
public String
readUTF()

Overrides org.jboss.marshalling.SimpleDataInput.readUTF.

Implements java.io.DataInput.readUTF.

Reads in a string that has been encoded using a modified UTF-8 format.
private Object
replace(Object object)

private static Enum<E extends Enum<E>>
resolveEnumConstant(final ClassDescriptor descriptor, final String name)

private static InvalidObjectException
public void
start(final ByteInput
the new stream
byteInput
)

Overrides org.jboss.marshalling.AbstractUnmarshaller.start.

Implements org.jboss.marshalling.Unmarshaller.start.

Begin unmarshalling from a stream.

Field Detail

blockUnmarshallerback to summary
private BlockUnmarshaller blockUnmarshaller
classCacheback to summary
private final ArrayList<ClassDescriptor> classCache
createObjectInputStreamActionback to summary
private final PrivilegedExceptionAction<RiverObjectInputStream> createObjectInputStreamAction
depthback to summary
private int depth
instanceCacheback to summary
private final ArrayList<Object> instanceCache
objectInputStreamback to summary
private RiverObjectInputStream objectInputStream
proxyInvocationHandlerback to summary
private static final Field proxyInvocationHandler
proxyInvocationHandlerOffsetback to summary
private static final long proxyInvocationHandlerOffset
registryback to summary
private final SerializableClassRegistry registry
UNRESOLVEDback to summary
private static final Object UNRESOLVED
validatorsback to summary
private SortedSet<Validator> validators
validatorSeqback to summary
private int validatorSeq
versionback to summary
private int version

Constructor Detail

RiverUnmarshallerback to summary
protected RiverUnmarshaller(final RiverMarshallerFactory marshallerFactory, final SerializableClassRegistry registry, final MarshallingConfiguration configuration)

Method Detail

addValidationback to summary
pack-priv void addValidation(final ObjectInputValidation validation, final int prio)
clearClassCacheback to summary
public void clearClassCache() throws IOException

Implements org.jboss.marshalling.Unmarshaller.clearClassCache.

Doc from org.jboss.marshalling.Unmarshaller.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.Unmarshaller.clearInstanceCache.

Doc from org.jboss.marshalling.Unmarshaller.clearInstanceCache.

Discard the instance cache.

Exceptions
IOException:
if an error occurs
closeback to summary
public void close() throws IOException

Overrides org.jboss.marshalling.SimpleDataInput.close.

Implements java.io.ObjectInput.close, java.io.Closeable.close.

Doc from java.io.ObjectInput.close.

Closes the input stream. Must be called to release any resources associated with the stream.

Exceptions
IOException:
If an I/O error has occurred.
createObjectInputStreamback to summary
private RiverObjectInputStream createObjectInputStream() throws IOException
discardFieldsback to summary
protected void discardFields(final SerializableClassDescriptor descriptor) throws IOException
doInitSerializableback to summary
private Object doInitSerializable(Object obj, final SerializableClassDescriptor descriptor, final boolean discardMissing) throws IOException, ClassNotFoundException
doReadArrayback to summary
private Object doReadArray(final int cnt, final boolean unshared, final boolean discardMissing) throws ClassNotFoundException, IOException
doReadBooleanArrayback to summary
private Object doReadBooleanArray(final int cnt, final boolean unshared) throws IOException
doReadByteArrayback to summary
private Object doReadByteArray(final int cnt, final boolean unshared) throws IOException
doReadCharArrayback to summary
private Object doReadCharArray(final int cnt, final boolean unshared) throws IOException
doReadClassDescriptorback to summary
pack-priv ClassDescriptor doReadClassDescriptor(final int classType, final boolean required) throws IOException, ClassNotFoundException
doReadCollectionObjectback to summary
pack-priv Object doReadCollectionObject(final boolean unshared, final int idx, final int size, final boolean discardMissing) throws ClassNotFoundException, IOException
doReadDoubleArrayback to summary
private Object doReadDoubleArray(final int cnt, final boolean unshared) throws IOException
doReadFloatArrayback to summary
private Object doReadFloatArray(final int cnt, final boolean unshared) throws IOException
doReadIntArrayback to summary
private Object doReadIntArray(final int cnt, final boolean unshared) throws IOException
doReadLongArrayback to summary
private Object doReadLongArray(final int cnt, final boolean unshared) throws IOException
doReadMapObjectback to summary
pack-priv Object doReadMapObject(final boolean unshared, final int idx, final int size, final boolean key, final boolean discardMissing) throws ClassNotFoundException, IOException
doReadNestedObjectback to summary
pack-priv Object doReadNestedObject(final boolean unshared, final String enclosingClassName) throws ClassNotFoundException, IOException
doReadNewObjectback to summary
protected Object doReadNewObject(final int streamClassType, final boolean unshared, final boolean discardMissing) throws ClassNotFoundException, IOException
doReadObjectback to summary
protected Object doReadObject(final boolean unshared) throws ClassNotFoundException, IOException

Implements abstract org.jboss.marshalling.AbstractObjectInput.doReadObject.

Doc from org.jboss.marshalling.AbstractObjectInput.doReadObject.

Implementation of the actual object-reading method.

Parameters
unshared:boolean

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

Returns:Object

the object to read

Exceptions
ClassNotFoundException:
if the class for the object could not be loaded
IOException:
if an I/O error occurs
doReadObjectback to summary
pack-priv Object doReadObject(final boolean unshared, final boolean discardMissing) throws IOException, ClassNotFoundException
doReadObjectback to summary
pack-priv Object doReadObject(int leadByte, final boolean unshared, final boolean discardMissing) throws IOException, ClassNotFoundException
Annotations
@SuppressWarnings:unchecked
doReadObjectArrayback to summary
private Object doReadObjectArray(final int cnt, final Class<?> type, final boolean unshared, final boolean discardMissing) throws ClassNotFoundException, IOException
doReadRecordback to summary
private Object doReadRecord(SerializableClass info, boolean discardMissing) throws IOException, ClassNotFoundException
doReadShortArrayback to summary
private Object doReadShortArray(final int cnt, final boolean unshared) throws IOException
finishback to summary
public void finish() throws IOException

Overrides org.jboss.marshalling.AbstractUnmarshaller.finish.

Implements org.jboss.marshalling.Unmarshaller.finish.

Doc from org.jboss.marshalling.AbstractUnmarshaller.finish.

Finish unmarshalling from a stream. Any transient class or instance cache is discarded.

Exceptions
IOException:

Doc from org.jboss.marshalling.Unmarshaller.finish.

if an error occurs

getBlockUnmarshallerback to summary
private BlockUnmarshaller getBlockUnmarshaller()
getObjectInputStreamback to summary
private RiverObjectInputStream getObjectInputStream() throws IOException
readCollectionDataback to summary
private Object readCollectionData(final boolean unshared, int cacheIdx, final int len, final Collection<E> target, final boolean discardMissing) throws ClassNotFoundException, IOException
Annotations
@SuppressWarnings:unchecked
readFieldsback to summary
protected void readFields(final Object obj, final SerializableClassDescriptor descriptor, final boolean discardMissing) throws IOException, ClassNotFoundException
readMapDataback to summary
private Object readMapData(final boolean unshared, int cacheIdx, final int len, final Map<K, V> target, final boolean discardMissing) throws ClassNotFoundException, IOException
Annotations
@SuppressWarnings:unchecked
readSortedMapDataback to summary
private Object readSortedMapData(final boolean unshared, int cacheIdx, final int len, final SortedMap<K, V> target, final boolean discardMissing) throws ClassNotFoundException, IOException
Annotations
@SuppressWarnings:unchecked
readSortedSetDataback to summary
private Object readSortedSetData(final boolean unshared, int cacheIdx, final int len, final SortedSet<E> target, final boolean discardMissing) throws ClassNotFoundException, IOException
Annotations
@SuppressWarnings:unchecked
readStringback to summary
protected String readString() throws IOException
readUTFback to summary
public String readUTF() throws IOException

Overrides org.jboss.marshalling.SimpleDataInput.readUTF.

Implements java.io.DataInput.readUTF.

Doc from java.io.DataInput.readUTF.

Reads in a string that has been encoded using a modified UTF-8 format. The general contract of readUTF is that it reads a representation of a Unicode character string encoded in modified UTF-8 format; this string of characters is then returned as a String.

First, two bytes are read and used to construct an unsigned 16-bit integer in exactly the manner of the readUnsignedShort method . This integer value is called the UTF length and specifies the number of additional bytes to be read. These bytes are then converted to characters by considering them in groups. The length of each group is computed from the value of the first byte of the group. The byte following a group, if any, is the first byte of the next group.

If the first byte of a group matches the bit pattern 0xxxxxxx (where x means "may be 0 or 1"), then the group consists of just that byte. The byte is zero-extended to form a character.

If the first byte of a group matches the bit pattern 110xxxxx, then the group consists of that byte a and a second byte b. If there is no byte b (because byte a was the last of the bytes to be read), or if byte b does not match the bit pattern 10xxxxxx, then a UTFDataFormatException is thrown. Otherwise, the group is converted to the character:

(char)(((a & 0x1F) << 6) | (b & 0x3F))
If the first byte of a group matches the bit pattern 1110xxxx, then the group consists of that byte a and two more bytes b and c. If there is no byte c (because byte a was one of the last two of the bytes to be read), or either byte b or byte c does not match the bit pattern 10xxxxxx, then a UTFDataFormatException is thrown. Otherwise, the group is converted to the character:
(char)(((a & 0x0F) << 12) | ((b & 0x3F) << 6) | (c & 0x3F))
If the first byte of a group matches the pattern 1111xxxx or the pattern 10xxxxxx, then a UTFDataFormatException is thrown.

If end of file is encountered at any time during this entire process, then an EOFException is thrown.

After every group has been converted to a character by this process, the characters are gathered, in the same order in which their corresponding groups were read from the input stream, to form a String, which is returned.

The writeUTF method of interface DataOutput may be used to write data that is suitable for reading by this method.

Returns:String

a Unicode string.

Exceptions
IOException:
if an I/O error occurs.
replaceback to summary
private Object replace(Object object)
resolveEnumConstantback to summary
private static Enum<E extends Enum<E>> resolveEnumConstant(final ClassDescriptor descriptor, final String name)
Annotations
@SuppressWarnings:unchecked
sharedMismatchback to summary
private static InvalidObjectException sharedMismatch()
startback to summary
public void start(final ByteInput byteInput) throws IOException

Overrides org.jboss.marshalling.AbstractUnmarshaller.start.

Implements org.jboss.marshalling.Unmarshaller.start.

Doc from org.jboss.marshalling.AbstractUnmarshaller.start.

Begin unmarshalling from a stream.

Parameters
byteInput:ByteInput

Doc from org.jboss.marshalling.Unmarshaller.start.

the new stream

Exceptions
IOException:

Doc from org.jboss.marshalling.Unmarshaller.start.

if an error occurs during setup, such as an invalid header

org.jboss.marshalling.river back to summary

private Class RiverUnmarshaller.UnsafeHolder

extends Object
Class Inheritance

Field Summary

Modifier and TypeField and Description
private static final Unsafe

Constructor Summary

AccessConstructor and Description
private

Method Summary

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

unsafeback to summary
private static final Unsafe unsafe

Constructor Detail

UnsafeHolderback to summary
private UnsafeHolder()