[jboss-cvs] JBossRemoting/src/main/org/jboss/remoting/marshal/serializable ...

Ron Sigal ron_sigal at yahoo.com
Fri May 18 22:18:49 EDT 2007


  User: rsigal  
  Date: 07/05/18 22:18:48

  Modified:    src/main/org/jboss/remoting/marshal/serializable  Tag:
                        remoting_2_x SerializableMarshaller.java
  Log:
  JBREM-714: Added version parameter to read()/write().
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.11.10.4 +19 -3     JBossRemoting/src/main/org/jboss/remoting/marshal/serializable/SerializableMarshaller.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: SerializableMarshaller.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossRemoting/src/main/org/jboss/remoting/marshal/serializable/SerializableMarshaller.java,v
  retrieving revision 1.11.10.3
  retrieving revision 1.11.10.4
  diff -u -b -r1.11.10.3 -r1.11.10.4
  --- SerializableMarshaller.java	4 Feb 2007 08:40:24 -0000	1.11.10.3
  +++ SerializableMarshaller.java	19 May 2007 02:18:48 -0000	1.11.10.4
  @@ -28,8 +28,10 @@
   import java.io.OutputStream;
   import java.util.Map;
   
  +import org.jboss.remoting.Version;
   import org.jboss.remoting.marshal.Marshaller;
   import org.jboss.remoting.marshal.PreferredStreamMarshaller;
  +import org.jboss.remoting.marshal.VersionedMarshaller;
   import org.jboss.remoting.serialization.SerializationManager;
   import org.jboss.remoting.serialization.SerializationStreamFactory;
   
  @@ -39,7 +41,7 @@
    *
    * @author <a href="mailto:tom at jboss.org">Tom Elrod</a>
    */
  -public class SerializableMarshaller implements PreferredStreamMarshaller
  +public class SerializableMarshaller implements PreferredStreamMarshaller, VersionedMarshaller
   {
      static final long serialVersionUID = -5553685435323600244L;
   
  @@ -100,8 +102,22 @@
       */
      public void write(Object dataObject, OutputStream output) throws IOException
      {
  +      int version = Version.getDefaultVersion();
  +      write(dataObject, output, version);
  +   }
  +
  +   /**
  +    * Take the data object and write to the output.  Has ben customized
  +    * for working with ObjectOutputStreams since requires extra messaging.
  +    *
  +    * @param dataObject Object to be writen to output
  +    * @param output     The data output to write the object data to.
  +    * @param version    Wire format version
  +    */
  +   public void write(Object dataObject, OutputStream output, int version) throws IOException
  +   {
         ObjectOutputStream oos = (ObjectOutputStream) getMarshallingStream(output, null);
  -      SerializationStreamFactory.getManagerInstance(getSerializationType()).sendObject(oos, dataObject);
  +      SerializationStreamFactory.getManagerInstance(getSerializationType()).sendObject(oos, dataObject, version);
      }
   
      public Marshaller cloneMarshaller()
  
  
  



More information about the jboss-cvs-commits mailing list