Package org.jboss.marshalling
Class AbstractMarshaller
- java.lang.Object
-
- java.io.OutputStream
-
- org.jboss.marshalling.SimpleByteOutput
-
- org.jboss.marshalling.ByteOutputStream
-
- org.jboss.marshalling.SimpleDataOutput
-
- org.jboss.marshalling.AbstractObjectOutput
-
- org.jboss.marshalling.AbstractMarshaller
-
- All Implemented Interfaces:
java.io.Closeable,java.io.DataOutput,java.io.Flushable,java.io.ObjectOutput,java.lang.AutoCloseable,ByteOutput,Marshaller
- Direct Known Subclasses:
RiverMarshaller,SerialMarshaller
public abstract class AbstractMarshaller extends AbstractObjectOutput implements Marshaller
An abstract implementation of theMarshallerinterface. Most of the write methods delegate directly to the current data output.
-
-
Field Summary
Fields Modifier and Type Field Description protected ClassExternalizerFactoryclassExternalizerFactoryThe configured class externalizer factory.protected ClassResolverclassResolverThe configured class resolver.protected ClassTableclassTableThe configured class table.protected intconfiguredVersionThe configured version to write.protected ExceptionListenerexceptionListenerThe configured exception listener.protected ObjectResolverobjectPreResolverThe configured pre object resolver.protected ObjectResolverobjectResolverThe configured object resolver.protected ObjectTableobjectTableThe configured object table.protected SerializabilityCheckerserializabilityCheckerThe configured serializability checker.protected StreamHeaderstreamHeaderThe configured stream header.-
Fields inherited from class org.jboss.marshalling.SimpleDataOutput
buffer, bufferSize
-
Fields inherited from class org.jboss.marshalling.ByteOutputStream
byteOutput
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractMarshaller(AbstractMarshallerFactory marshallerFactory, MarshallingConfiguration configuration)Construct a new marshaller instance.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private static intcalcBufferSize(AbstractMarshallerFactory marshallerFactory, MarshallingConfiguration configuration)voidclose()voidfinish()Finish writing to a stream.voidstart(ByteOutput byteOutput)Begin writing to a stream.voidwriteObject(java.lang.Object obj)voidwriteObjectUnshared(java.lang.Object obj)-
Methods inherited from class org.jboss.marshalling.AbstractObjectOutput
doWriteObject
-
Methods inherited from class org.jboss.marshalling.SimpleDataOutput
flush, shallowFlush, write, write, write, writeBoolean, writeByte, writeBytes, writeChar, writeChars, writeDouble, writeFloat, writeInt, writeLong, 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.ByteOutput
write, write, write
-
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.Marshaller
clearClassCache, clearInstanceCache
-
-
-
-
Field Detail
-
classExternalizerFactory
protected final ClassExternalizerFactory classExternalizerFactory
The configured class externalizer factory.
-
streamHeader
protected final StreamHeader streamHeader
The configured stream header.
-
classResolver
protected final ClassResolver classResolver
The configured class resolver.
-
objectResolver
protected final ObjectResolver objectResolver
The configured object resolver.
-
objectPreResolver
protected final ObjectResolver objectPreResolver
The configured pre object resolver.
-
classTable
protected final ClassTable classTable
The configured class table.
-
objectTable
protected final ObjectTable objectTable
The configured object table.
-
exceptionListener
protected final ExceptionListener exceptionListener
The configured exception listener.
-
serializabilityChecker
protected final SerializabilityChecker serializabilityChecker
The configured serializability checker.
-
configuredVersion
protected final int configuredVersion
The configured version to write.
-
-
Constructor Detail
-
AbstractMarshaller
protected AbstractMarshaller(AbstractMarshallerFactory marshallerFactory, MarshallingConfiguration configuration)
Construct a new marshaller instance.- Parameters:
marshallerFactory- the marshaller factoryconfiguration-
-
-
Method Detail
-
calcBufferSize
private static int calcBufferSize(AbstractMarshallerFactory marshallerFactory, MarshallingConfiguration configuration)
-
start
public void start(ByteOutput byteOutput) throws java.io.IOException
Begin writing to a stream.- Specified by:
startin interfaceMarshaller- Overrides:
startin classSimpleDataOutput- Parameters:
byteOutput- the new stream- Throws:
java.io.IOException- if an error occurs
-
writeObjectUnshared
public final void writeObjectUnshared(java.lang.Object obj) throws java.io.IOException- Specified by:
writeObjectUnsharedin interfaceMarshaller- Overrides:
writeObjectUnsharedin classAbstractObjectOutput- Parameters:
obj- the object to be written- Throws:
java.io.IOException- if an error occurs
-
writeObject
public final void writeObject(java.lang.Object obj) throws java.io.IOException- Specified by:
writeObjectin interfacejava.io.ObjectOutput- Overrides:
writeObjectin classAbstractObjectOutput- Throws:
java.io.IOException
-
finish
public void finish() throws java.io.IOExceptionFinish writing to a stream. The stream is released. No further writing may be done until theSimpleDataOutput.start(ByteOutput)method is again invoked.- Specified by:
finishin interfaceMarshaller- Overrides:
finishin classSimpleDataOutput- Throws:
java.io.IOException- if an error occurs
-
close
public void close() throws java.io.IOException- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Specified by:
closein interfacejava.io.ObjectOutput- Overrides:
closein classSimpleDataOutput- Throws:
java.io.IOException
-
-