|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.clazzes.remoting.marshal.impl.MarshalerSupport
org.clazzes.remoting.marshal.impl.CompactMarshaler
public class CompactMarshaler
A marshaler, which marshals object in a field-by-field manner. It uses a compact binary format on the underlying streams and uses a class registry, which might contain a fixed set of classes to be marshaled. The set of classes to be marshaled may be dynamically expanded, which is usually not desirable, if a remoting server communicates with an implementation in a foreign language like C++.
Constructor Summary | |
---|---|
CompactMarshaler(MarshalerClassRegistry classRegistry,
boolean extendClasses,
boolean flattenCollections,
ObjectResolver objectResolver,
int outputBufferSize,
int inputBufferSize)
|
Method Summary | |
---|---|
void |
close()
Close the underlying transport and prepare the marshaler for calling Marshaler.setup(OutputStream, InputStream, ClassLoader) again. |
protected void |
flushStream()
This method flushes the underlying stream without flushing the write cache This method might be used by reimplementations of CompactMarshaler which obey a more complex flush policy. |
ObjectResolver |
getObjectResolver()
|
boolean |
isExtendClasses()
|
boolean |
isFlattenCollections()
|
java.lang.Object |
readObject()
Read the next object from the input stream. |
void |
reset()
Reset the state of the serializer. |
void |
setup(java.io.OutputStream os,
java.io.InputStream is,
java.lang.ClassLoader inputClassLoader)
Set up the marshaler for operation. |
void |
writeObject(java.lang.Object obj)
Write an object to the underlying transport. |
protected void |
writeObjectNoFlush(java.lang.Object obj)
This writes the object to the stream without flushing the write buffer. |
Methods inherited from class org.clazzes.remoting.marshal.impl.MarshalerSupport |
---|
getInputBufferSize, getOutputBufferSize, prepareInputStream, prepareOutputStream, setInputBufferSize, setOutputBufferSize |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CompactMarshaler(MarshalerClassRegistry classRegistry, boolean extendClasses, boolean flattenCollections, ObjectResolver objectResolver, int outputBufferSize, int inputBufferSize)
objectResolver
- outputBufferSize
- inputBufferSize
- Method Detail |
---|
public ObjectResolver getObjectResolver()
public boolean isExtendClasses()
public boolean isFlattenCollections()
public void close()
Marshaler
Marshaler.setup(OutputStream, InputStream, ClassLoader)
again.
This method should be implemented in a fashion that is tolerant for an
incomplete setup of the marshaler. It should even be possible to call
close() twice on a single marshaler object.
public java.lang.Object readObject() throws java.lang.ClassNotFoundException, java.io.IOException
Marshaler
java.lang.ClassNotFoundException
- If the underlying class loader was unable
to find the class of a serialized object.
java.io.IOException
- Upon transport errors.public void reset() throws java.io.IOException
Marshaler
java.io.IOException
- Upon transport errors.public void setup(java.io.OutputStream os, java.io.InputStream is, java.lang.ClassLoader inputClassLoader) throws java.io.IOException
Marshaler
os
- The output stream to write to.is
- The input stream to read from.inputClassLoader
- The ClassLoader to use for deserialized instances.
java.io.IOException
- Upon errors setting up the streams.protected void writeObjectNoFlush(java.lang.Object obj) throws java.io.IOException
obj
- The object to write
java.io.IOException
- Upon errors.protected void flushStream() throws java.io.IOException
java.io.IOException
- Upon errors on the underlying stream.public void writeObject(java.lang.Object obj) throws java.io.IOException
Marshaler
obj
- The object to write.
java.io.IOException
- Upon transport errors.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |