org.jboss.jms.wireformat
Class JMSWireFormat

java.lang.Object
  extended by org.jboss.jms.wireformat.JMSWireFormat
All Implemented Interfaces:
java.io.Serializable, org.jboss.remoting.marshal.Marshaller, org.jboss.remoting.marshal.UnMarshaller

public class JMSWireFormat
extends java.lang.Object
implements org.jboss.remoting.marshal.Marshaller, org.jboss.remoting.marshal.UnMarshaller

We do not use Java or JBoss serialization to send data over the wire. Serialization adds considerable overhead in terms of the amount of data sent (it adds class information plus block data information) which significantly degrades performance. Instead we define a customer wire format that minimises the amount of data sent. The only exception to this rule is when sending an ObjectMessage which contains a user defined object whose type is only known at run-time. In this case we use serialization.

Version:
$Revision: 3265 $ $Id: JMSWireFormat.java 3265 2007-10-31 12:44:42Z timfox $
Author:
Tim Fox, Ovidiu Feodorov
See Also:
Serialized Form

Field Summary
protected  boolean trace
           
 
Constructor Summary
JMSWireFormat()
           
 
Method Summary
 org.jboss.remoting.marshal.Marshaller cloneMarshaller()
           
 org.jboss.remoting.marshal.UnMarshaller cloneUnMarshaller()
           
 java.lang.Object read(java.io.InputStream in, java.util.Map map)
           
 void setClassLoader(java.lang.ClassLoader classloader)
           
 void write(java.lang.Object obj, java.io.OutputStream out)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

trace

protected boolean trace
Constructor Detail

JMSWireFormat

public JMSWireFormat()
Method Detail

write

public void write(java.lang.Object obj,
                  java.io.OutputStream out)
           throws java.io.IOException
Specified by:
write in interface org.jboss.remoting.marshal.Marshaller
Throws:
java.io.IOException

cloneMarshaller

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

read

public java.lang.Object read(java.io.InputStream in,
                             java.util.Map map)
                      throws java.io.IOException,
                             java.lang.ClassNotFoundException
Specified by:
read in interface org.jboss.remoting.marshal.UnMarshaller
Throws:
java.io.IOException
java.lang.ClassNotFoundException

cloneUnMarshaller

public org.jboss.remoting.marshal.UnMarshaller cloneUnMarshaller()
                                                          throws java.lang.CloneNotSupportedException
Specified by:
cloneUnMarshaller in interface org.jboss.remoting.marshal.UnMarshaller
Throws:
java.lang.CloneNotSupportedException

setClassLoader

public void setClassLoader(java.lang.ClassLoader classloader)
Specified by:
setClassLoader in interface org.jboss.remoting.marshal.UnMarshaller


Copyright © 2006 JBoss Inc. All Rights Reserved.