org.jboss.remoting.marshal.serializable
Class SerializableMarshaller

java.lang.Object
  extended by org.jboss.remoting.marshal.serializable.SerializableMarshaller
All Implemented Interfaces:
java.io.Serializable, Marshaller, PreferredStreamMarshaller, SerialMarshaller, VersionedMarshaller
Direct Known Subclasses:
CompressingMarshaller, EncryptingMarshaller, HTTPMarshaller

public class SerializableMarshaller
extends java.lang.Object
implements PreferredStreamMarshaller, VersionedMarshaller

Simple marshaller that simply serializes java objects using standard output stream.

Author:
Tom Elrod
See Also:
Serialized Form

Field Summary
static java.lang.String DATATYPE
           
 
Constructor Summary
SerializableMarshaller()
           
 
Method Summary
 Marshaller cloneMarshaller()
           
 java.io.OutputStream getMarshallingStream(java.io.OutputStream outputStream)
          An application that calls getMarshallingStream() should provide a basic OutputStream, e.g., SocketOutputStream, which can be wrapped to provide the facilities desired by the PreferredStreamMarshaller.
 java.io.OutputStream getMarshallingStream(java.io.OutputStream outputStream, java.util.Map config)
          SerializableMarshaller prefers to write to an ObjectOutputStream wrapped around a BufferedOutputStream.
 java.lang.String getSerializationType()
           
 void setSerializationType(java.lang.String serializationType)
           
 void write(java.lang.Object dataObject, java.io.OutputStream output)
          Take the data object and write to the output.
 void write(java.lang.Object dataObject, java.io.OutputStream output, int version)
          Take the data object and write to the output.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DATATYPE

public static final java.lang.String DATATYPE
See Also:
Constant Field Values
Constructor Detail

SerializableMarshaller

public SerializableMarshaller()
Method Detail

setSerializationType

public void setSerializationType(java.lang.String serializationType)
Specified by:
setSerializationType in interface SerialMarshaller

getSerializationType

public java.lang.String getSerializationType()
Specified by:
getSerializationType in interface SerialMarshaller

getMarshallingStream

public java.io.OutputStream getMarshallingStream(java.io.OutputStream outputStream)
                                          throws java.io.IOException
Description copied from interface: PreferredStreamMarshaller
An application that calls getMarshallingStream() should provide a basic OutputStream, e.g., SocketOutputStream, which can be wrapped to provide the facilities desired by the PreferredStreamMarshaller.

Specified by:
getMarshallingStream in interface PreferredStreamMarshaller
Parameters:
outputStream - a raw OutputStream
Returns:
the OutputStream to be used for marshalling
Throws:
java.io.IOException - if it unable to create OutputStream

getMarshallingStream

public java.io.OutputStream getMarshallingStream(java.io.OutputStream outputStream,
                                                 java.util.Map config)
                                          throws java.io.IOException
SerializableMarshaller prefers to write to an ObjectOutputStream wrapped around a BufferedOutputStream.

Specified by:
getMarshallingStream in interface PreferredStreamMarshaller
Parameters:
outputStream - a raw OutputStream
config - a Map with configuration information (e.g., serialization type)
Returns:
the OutputStream to be used for marshalling
Throws:
java.io.IOException - if it unable to create OutputStream

write

public void write(java.lang.Object dataObject,
                  java.io.OutputStream output)
           throws java.io.IOException
Take the data object and write to the output. Has ben customized for working with ObjectOutputStreams since requires extra messaging.

Specified by:
write in interface Marshaller
Parameters:
dataObject - Object to be writen to output
output - The data output to write the object data to.
Throws:
java.io.IOException

write

public void write(java.lang.Object dataObject,
                  java.io.OutputStream output,
                  int version)
           throws java.io.IOException
Take the data object and write to the output. Has ben customized for working with ObjectOutputStreams since requires extra messaging.

Specified by:
write in interface VersionedMarshaller
Parameters:
dataObject - Object to be writen to output
output - The data output to write the object data to.
version - Wire format version
Throws:
java.io.IOException

cloneMarshaller

public Marshaller cloneMarshaller()
                           throws java.lang.CloneNotSupportedException
Specified by:
cloneMarshaller in interface Marshaller
Throws:
java.lang.CloneNotSupportedException


Copyright © 1998-2005 JBoss Inc . All Rights Reserved.